WO2025007263A1 - 编解码方法、码流、编码器、解码器以及存储介质 - Google Patents

编解码方法、码流、编码器、解码器以及存储介质 Download PDF

Info

Publication number
WO2025007263A1
WO2025007263A1 PCT/CN2023/105611 CN2023105611W WO2025007263A1 WO 2025007263 A1 WO2025007263 A1 WO 2025007263A1 CN 2023105611 W CN2023105611 W CN 2023105611W WO 2025007263 A1 WO2025007263 A1 WO 2025007263A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
transformation model
model
syntax element
transformation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2023/105611
Other languages
English (en)
French (fr)
Inventor
张莱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to PCT/CN2023/105611 priority Critical patent/WO2025007263A1/zh
Priority to CN202380099990.6A priority patent/CN121488481A/zh
Publication of WO2025007263A1 publication Critical patent/WO2025007263A1/zh
Priority to MX2025015516A priority patent/MX2025015516A/es
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the present application relates to the field of video coding and decoding technology, and in particular to a coding and decoding method, a bit stream, an encoder, a decoder and a storage medium.
  • Intra Block Copy (IBC) technology is an intra prediction technology based on block matching to obtain predicted pixels. Similar to inter prediction, prediction is achieved through a block vector pointing from the current block to the reference block. The difference is that the reference block of inter prediction comes from the encoded reconstructed frame, while the reference block of IBC comes from the reconstructed part of the current frame.
  • Local Illumination Compensation (LIC) technology is a block-level linear transformation technology. The LIC method characterizes that there is a linear relationship between the current coding block and the reference block.
  • IBC technology can determine the reference block from the current frame by block compensation. On this basis, IBC technology can be combined with LIC technology to perform linear transformation on the reference block to determine the prediction block, thereby improving the accuracy of prediction.
  • linear transformation parameters in the LIC technology are derived from the adjacent reconstructed pixels of the current block and the reference block, which cannot provide a variety of parameter choices and has limitations, affecting the encoding and decoding performance.
  • the present application provides a coding and decoding method, a bit stream, an encoder, a decoder and a storage medium, which can improve the diversity of prediction and thus improve the coding and decoding performance.
  • an embodiment of the present application provides a decoding method, which is applied to a decoder, and the method includes:
  • the constructed transformation model list includes at least two types of transformation models
  • a prediction block of a current block is determined.
  • an embodiment of the present application provides an encoding method, which is applied to an encoder, and the method includes:
  • a first transformation model is obtained from the constructed transformation model list;
  • the constructed transformation model list includes at least two types of transformation models;
  • an embodiment of the present application provides a code stream, which is generated by bit encoding according to information to be encoded; wherein the information to be encoded includes at least one of the following:
  • the first syntax element is used to indicate a prediction mode of a current block using an intra-block copy technology
  • the second syntax element is used to indicate whether the current block is predicted using a transform model list
  • the third syntax element is used to indicate whether to use a transform technique for prediction
  • the fourth syntax element is used to indicate a model index of the transformation model in the transformation model list
  • the fifth syntax element is used to indicate the index of the local compensation model when using the multi-mode local compensation technology
  • the sixth syntax element is used to indicate index information of a reference block.
  • an embodiment of the present application provides a decoder, including:
  • the decoding part is configured to obtain relevant syntax elements of the current block; wherein the relevant syntax elements are used to indicate whether the current block is predicted using an intra-block copy technology combined with a transform model list;
  • a first determining part is configured to determine a reference block obtained by using the intra-block copying technology for a current block
  • the constructed transformation model list includes at least two types of transformation models
  • the first prediction part is configured to determine a prediction block of a current block based on the reference block and the first transform model.
  • an embodiment of the present application provides a decoder, comprising a first memory and a first processor; wherein:
  • a first memory for storing a computer program that can be run on the first processor
  • the first processor is used to execute the decoding method as described in the first aspect when running a computer program.
  • an encoder including:
  • the second determining part is configured to determine a candidate block vector list of the current block; determine a reference block vector based on the candidate block vector list; determine a reference block based on the reference block vector; when determining that the prediction mode of the current block is the intra block copy technology combined with the transformation model list for prediction, obtain a first transformation model from the constructed transformation model list; the constructed transformation model list includes at least two types of transformation models;
  • a second prediction part is configured to determine a prediction block of a current block based on the reference block and the first transformation model
  • the encoding part is configured to encode the relevant syntax elements of the current block, and write the obtained encoding bits into the bitstream through the writing part; wherein the relevant syntax elements are used to indicate whether the current block is predicted using the intra-frame block copy technology combined with the transformation model list.
  • an encoder including a second memory and a second processor; wherein:
  • a second memory for storing a computer program that can be run on a second processor
  • the second processor is used to execute the encoding method as described in the second aspect when running the computer program.
  • an embodiment of the present application provides a computer-readable storage medium, which stores a computer program.
  • the computer program When the computer program is executed by a first processor, it implements the decoding method as described in the first aspect, or when it is executed by a second processor, it implements the encoding method as described in the second aspect.
  • the embodiment of the present application provides a coding and decoding method, a bit stream, an encoder, a decoder and a storage medium.
  • the decoder or the encoder can select a first transformation model from a transformation model list including at least two types of transformation models; the selected first transformation model is used to transform the reference block, and then the prediction block is determined. Therefore, in the process of coding and decoding implementation, the first transformation model used to implement the transformation can be selected and determined from the transformation model list, which can ensure the diversity of selection, thereby making the possibility in the prediction process higher, improving the diversity of prediction, and ultimately improving the coding and decoding performance.
  • Figure 1 is a schematic diagram of the prediction process of an Intra TMP technology
  • FIG2 is a schematic diagram of a matching block of the Intra TMP technology
  • FIG3 is a schematic diagram of a template type of Intra TMP technology
  • FIG4A is a schematic diagram of a rough search process of template matching in the Intra TMP technology
  • FIG4B is a schematic diagram of a detailed search process of template matching in the Intra TMP technology
  • FIG5 is a schematic diagram of weighted fusion of an IntraTMP fusion prediction technology
  • FIG6A is a schematic diagram of a filter shape
  • FIG6B is a schematic diagram of a filter coefficient derivation method
  • FIG7 is a schematic diagram of a coding block vertical and horizontal division method
  • Fig. 8 is a schematic diagram of the position
  • FIG9A is a schematic block diagram of a composition of an encoder provided in an embodiment of the present application.
  • FIG9B is a schematic block diagram of a decoder provided in an embodiment of the present application.
  • FIG10 is a schematic diagram of a network architecture of a coding and decoding system provided in an embodiment of the present application.
  • FIG11 is a schematic diagram of a flow chart of a decoding method provided in an embodiment of the present application.
  • FIG12 is a schematic diagram of a flow chart of an encoding method provided in an embodiment of the present application.
  • FIG13 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application.
  • FIG14 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application.
  • FIG15 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application.
  • FIG16 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application.
  • CU Coding Unit
  • CTU Coding Tree Unit
  • MSE Mean Square Error
  • ECM Enhanced Compression Model
  • JVET Joint Video Experts Team
  • BDPCM Block Differential Pulse Coded Modulation
  • IBC Intra Block Copy
  • LIC Local Illumination Compensation
  • a first color component, a second color component, and a third color component are generally used to represent a coding block.
  • the three color components are a brightness component, a blue chroma component, and a red chroma component.
  • the brightness component is usually represented by the symbol Y
  • the blue chroma component is usually represented by the symbol Cb or U
  • the red chroma component is usually represented by the symbol Cr or V; in this way, the video image can be represented in the YCbCr format or the YUV format.
  • Intra TMP technology is a special intra-frame prediction technology, referred to as IntraTMP technology, which is a special intra-frame prediction coding tool, mainly used for screen content coding.
  • IntraTMP is mainly implemented through the following process: select some reconstructed pixels adjacent to the current coding block as templates, search for the most similar template in the given reconstructed area of the current frame, and use the reconstructed block corresponding to the most similar template as a matching block, which is used as the prediction block of the current coding block.
  • the template of the coding block usually selects the adjacent reconstructed area of the current coding block.
  • the area filled with a grid represents the reconstructed area
  • R1, R2, R3 and R4 in the reconstructed area are search areas, and R1 to R4 are searched in turn to find matching blocks.
  • the adjacent area of the current block is the first template (T); and the adjacent area of the matching block (also referred to as the "reference block") is the second template (i.e., the "reference block template” or "matching template", T_BEST).
  • both the encoder and the decoder search the template (T) of the coding block in the predefined search range in the current image to determine the matching template (T_BEST) with the smallest template error value, and then use the corresponding reconstructed block (Ref Block) of the matching template as the prediction block of the current coding block (Cur Block).
  • the similarity between templates is represented by the size of the template error value. The smaller the template error value, the higher the similarity.
  • the template error value can be the absolute error and SAD, the absolute transformation difference and SATD, the mean square error MSE, the error square sum SSD, the mean absolute difference MAD, the mean error square sum MSD, the normalized correlation coefficient NCC, etc., which is not specifically limited here.
  • the template error value at this time is as follows:
  • Ti is the template in the search process
  • M represents the number of pixels in the template.
  • the Intra TMP technology uses the adjacent reconstructed pixels of the current block as templates to search for matching templates in a predefined search area, where the adjacent reconstructed pixels can be the upper reference pixel, upper left reference pixel, upper right reference pixel, left reference pixel and lower left reference pixel of the current block, etc. Therefore, the template type can be classified and the corresponding template type can be determined according to the availability of the adjacent reconstructed pixels.
  • FIG. 3 shows a schematic diagram of the template type of the Intra TMP technology. As shown in Figure 3, the block filled with a grid is the current block, and the adjacent area of the current block is the template T. Six template types are shown here.
  • the six template types are as follows:
  • the value of refTemplateType is 1, and the template shape is as shown in (a) of FIG. 3 ;
  • the codec uses the flag intra_tmp_flag to indicate whether the current coding block is encoded using the IntraTMP mode. If so, the same template matching process is performed on the decoding end to obtain the same prediction block on the decoding end, without the need to additionally encode the block vector information from the current coding block to the matching block.
  • the Intra TMP technology uses the flag intra_tmp_flag to indicate whether the current coding block is encoded using the IntraTMP mode. If so, the same template matching process is performed on the decoding end to obtain the same prediction block on the decoding end, without the need to additionally encode the block vector information from the current coding block to the matching block.
  • IntraTMP adaptation for camera-captured content is based on the original IntraTMP technology. It proposes to perform template matching with a step size of S (i.e., every S points in the horizontal and vertical directions, S>1) (as shown in Figure 4A). For example, in the search area, instead of searching for matching blocks point by point according to the raster scan, the search area is searched at every other point in the horizontal and vertical directions. For example, if the current block vector for template matching is (X0, Y0), the next block vector for template matching should be (X0+S, Y0), and the vertical coordinate of the block vector for template matching in the downstream should be Y0+S.
  • the best matching block is refined within a certain range (as shown in Figure 4B, template matching is performed with a smaller step size S') to optimize the matching result.
  • This technology effectively reduces the complexity of the IntraTMP mode while maintaining good coding efficiency.
  • IntraTMP multi-candidate technology obtains N candidate matching blocks in the reference area through the template matching process, or builds a candidate block list of length N.
  • the candidate matching blocks in the list can be sorted according to the template error value between the current block and the current block.
  • a candidate block in the list is selected as the final prediction block by index.
  • intra_tmp_flag For the coded block using IntraTMP multi-candidate technology, after decoding the IntraTMP flag intra_tmp_flag as true, continue to decode intra_tmp_idx, and the intra_tmp_idx syntax element can represent the index of the selected candidate block.
  • a template matching process for constructing a candidate block list is as follows:
  • the first step is to perform the first search with a certain step size, for example, the horizontal step size and the vertical step size are both 4. N optimal matching blocks with a certain spacing are obtained (the first N with the smallest template error value);
  • a second search is performed in the N neighboring areas of the matching blocks obtained in the first step. These neighboring areas can be set to multiple non-overlapping areas according to the step size in the first step. M optimal matching blocks (which may include the matching blocks obtained in the first step) are obtained from these areas.
  • the same construction process is used at the encoding and decoding ends to obtain a consistent list of candidate blocks.
  • Intra_tmp_idx can use fixed-length encoding or variable-length encoding, for example, truncated binary encoding.
  • a variable length encoding method is:
  • a shorter codeword can be set for a smaller intra_tmp_idx. For example, as shown in Table 1:
  • IntraTMP fusion prediction technology also known as IntraTMP multi-matching block fusion technology
  • the template error values of the reconstructed block and the current coding block at different positions can be obtained.
  • These reconstructed blocks can be represented by the block vectors of the current coding block pointing to the reconstructed blocks; a candidate block vector list is constructed to record the block vectors with smaller template error values in the template matching process; one or more block vectors are selected from the candidate block vector list according to conditions such as the block vector spacing and the template error value, and the reconstructed blocks pointed to are used as matching blocks of the current coding block; a weight value is determined for each matching block; these matching blocks are weighted and fused according to their weight values to obtain the final prediction block, thus realizing the IntraTMP combined fusion prediction.
  • the process is shown in Figures 5A and 5B.
  • the weight of each matching block can be determined by using a preset fixed value, calculating according to a template error value, or deducing according to a template.
  • the matching block (also called reference block) obtained by intra-frame template matching is usually directly used as the prediction block of the current block.
  • the prediction block can be filtered to improve the prediction effect.
  • a block-level flag can be used to indicate whether the current block uses the filtering process on the prediction block.
  • C is the pixel to be filtered
  • N is the pixel above it
  • S is the pixel below it
  • W is the pixel on the left
  • E is the pixel on the right, as shown in FIG6A.
  • B (Bias) is a fixed value, for example, B is the median of the pixel range.
  • c0 to c5 are filter coefficients.
  • One method of determining the filter coefficients is to train the filter coefficients using the reference block template and the current block template.
  • the template area is the reconstruction area of the upper 4 rows and the left 4 columns of the current block.
  • an additional row of areas on the upper, lower, left and right sides of the template area is also required as a reference. As shown in FIG6B , if part of the additional area is not encoded, it can be copied from the template area.
  • One method for training filter coefficients is to calculate a set of coefficients so that the template error value between the filtered reference block template and the current block template is minimized.
  • a method for filtering the prediction block directly obtained from the reference block is to filter each pixel in order from left to right and from top to bottom, and use the filtered value as the prediction value.
  • IntraTMP fusion prediction can obtain multiple reference blocks through the intra-frame template matching process and perform weighted fusion on these reference blocks.
  • the weight value is usually obtained by using a predefined fixed value or calculating based on the template error of each reference block.
  • n is the total number of reference blocks
  • Wi is the weight value corresponding to the reference block with a template error value of SADi.
  • the form of the prediction block after weighted fusion can be as shown in formula (6):
  • the template-derived IntraTMP fusion method uses a method similar to filter coefficient training to obtain weights for fusion prediction based on the reference block template and the current block template. For example, using 5 reference blocks for weighted fusion, the form is shown in formula (7):
  • One weighted method is to calculate a set of coefficients so that the template error between the reference block template and the current block template is minimized.
  • the template-based intra mode derivation (TIMD) technology uses the reconstructed pixels of the L-shaped part adjacent to the current coding block as a template, and calculates the predicted pixels of the template area under different intra prediction modes by traversing the MPM list.
  • the template error values of the predicted pixels and reconstructed pixels under different intra prediction modes are obtained, which are represented by the Sum of Absolute Transformed Difference (SATD).
  • SATD Sum of Absolute Transformed Difference
  • the optimal intra prediction mode is selected according to the template error value.
  • the intra prediction mode is obtained by the same derivation method, thereby reducing the coding bits of the mode information.
  • CIIP Combined Inter and Intra Prediction
  • ECM ECM
  • CIIP is combined with template-based prediction technology, and different weight values are assigned to different regions, which further improves the accuracy of prediction.
  • its intra prediction block pred_intra is obtained by TIMD mode
  • the inter prediction block pred_inter is obtained by template-based Merge mode.
  • the weight values wIntra and wInter are determined.
  • wIntra and wInter are determined according to the intra prediction mode intra_dir derived from TIMD.
  • 2 ⁇ intra_dir ⁇ 34 the current coding block is divided into four equal parts vertically;
  • the weight values of each region wIntra and wInter are shown in Table 3:
  • indexes of each region under vertical or horizontal quadrisection are shown in Figure 7.
  • intra_dir is equal to 0 or 1
  • the sub-region is not divided, and wIntra and wInter are selected from (3,1), (2,2), (1,3) according to the coding type (intra-frame or inter-frame) of the two coding blocks located on the left and on the top.
  • Intra Block Copy (IBC) technology is an intra prediction technology based on block matching to obtain predicted pixels. Similar to inter prediction, prediction is achieved through the block vector pointing from the current block to the reference block. The difference is that the reference block of inter prediction comes from the encoded reconstructed frame, while the reference block of IBC comes from the reconstructed part of the current frame. Block vector information needs to be transmitted by the bitstream, so similar to intra prediction, there are IBC-AMVP mode and IBC-Merge mode.
  • the IBC-AMVP mode obtains the predicted block vector by constructing a list of candidate block vectors. Based on the predicted block vector, the reference block of the current block and the corresponding final block vector are obtained through hash search, full search and other processes. The final block vector is encoded according to the predicted block vector to improve coding efficiency.
  • the IBC-Merge mode predicts by constructing a list of candidate block vectors, and selects the best block vector in the list as the final block vector through SATD, RDO and other encoding processes, and uses the reconstructed block it points to as the reference block to complete the prediction.
  • the index of the block vector in the list is encoded instead of the block vector itself, which improves the encoding efficiency.
  • the candidate block vector list may be composed of coding information such as block vectors of adjacent coded blocks, historically coded block vectors, and average block vectors.
  • the candidate block vector list may include information such as a local illumination compensation LIC flag. If the LIC flag of a candidate is true, when the current block selects the candidate block vector, the LIC flag of the current block is set to true.
  • Local illumination compensation technology is a block-level linear transformation technology.
  • ⁇ and ⁇ can be derived from pixels in a reconstructed area adjacent to the current coding block and pixels in a reconstructed area adjacent to the reference block, and obtained by a least square method or the like.
  • a threshold value can be set, and different linear parameters can be selected according to the size relationship between the reference block pixels and the threshold value, which can be expressed as formula (10):
  • the inter-frame coding block in Merge mode can add non-adjacent candidates when constructing the Merge List.
  • each non-adjacent point is selected and the merge candidate is attempted to be constructed.
  • the pixel positions of the non-adjacent points and the current block are shown in FIG8 .
  • the positions marked 1-5 in FIG8 are called candidates for adjacent positions, and the rest are called candidates for non-adjacent positions.
  • the multi-mode IBC-LIC technique divides the IBC-LIC method into multiple sub-methods according to the template area used to derive the linear parameters and the number of linear transformation models.
  • One example is to divide IBC-LIC into the following four methods:
  • a specific IBC-LIC sub-method can be selected by means of a coding index.
  • IBC technology can obtain a reference block from the current frame by means of block compensation.
  • IBC technology can be combined with LIC technology to perform a linear transformation on the reference block, thereby improving the accuracy of prediction.
  • LIC technology is that its linear transformation parameters are derived from the reconstructed pixels adjacent to the current block and the reference block, and cannot provide a variety of parameter options.
  • This application proposes a method for constructing a list of candidate transformation models for a current coding block based on the transformation models used by the coded blocks, which can improve the diversity of predictions.
  • the coding end makes a decision to select the optimal transformation model for the current coding block, thereby improving coding efficiency.
  • the encoder 100 may include a transform and quantization unit 101, an intra-frame estimation unit 102, an intra-frame prediction unit 103, a motion compensation unit 104, a motion estimation unit 105, an inverse transform and inverse quantization unit 106, a filter control analysis unit 107, a filtering unit 108, an encoding unit 109, and a decoded image cache unit 110, etc.
  • the filtering unit 108 may implement deblocking filtering and sample adaptive offset (Sample Adaptive Offset, SAO) filtering
  • the encoding unit 109 may implement header information encoding and context-based adaptive binary arithmetic coding (Context-based Adaptive Binary Arithmetic Coding, CABAC).
  • a video coding block can be obtained by dividing the coding tree unit (CTU), and then the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transformation and quantization unit 101 to transform the video coding block, including transforming the residual information from the pixel domain to the transform domain, and quantizing the obtained transform coefficients to further reduce the bit rate;
  • the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to perform intra-frame prediction on the video coding block; specifically, the intra-frame estimation unit 102 and the intra-frame prediction unit 103 are used to determine the intra-frame prediction mode to be used to encode the video coding block;
  • the motion compensation unit 104 and the motion estimation unit 105 are used to perform inter-frame prediction coding of the received video coding block relative to one or more blocks in one or more reference frames to provide temporal prediction information;
  • the motion estimation performed by the motion estimation unit 105 is a process of generating a motion vector, and the motion vector can estimate the motion of the video coding block, and then
  • the motion vector determined by the motion estimation unit 105 performs motion compensation; after determining the intra-frame prediction mode, the intra-frame prediction unit 103 is also used to provide the selected intra-frame prediction data to the encoding unit 109, and the motion estimation unit 105 also sends the calculated and determined motion vector data to the encoding unit 109; in addition, the inverse transform and inverse quantization unit 106 is used to reconstruct the video coding block, reconstruct the residual block in the pixel domain, and the reconstructed residual block is removed by the filter control analysis unit 107 and the filtering unit 108.
  • the encoding unit 109 is used to encode various coding parameters and quantized transform coefficients.
  • the context content can be based on adjacent coding blocks and can be used to encode information indicating the determined intra-frame prediction mode and output the code stream of the video signal; and the decoded image buffer unit 110 is used to store the reconstructed video coding block for prediction reference. As the video image encoding proceeds, new reconstructed video encoding blocks are continuously generated, and these reconstructed video encoding blocks are stored in the decoded image buffer unit 110 .
  • the decoder 200 includes a decoding unit 201, an inverse transform and inverse quantization unit 202, an intra-frame prediction unit 203, a motion compensation unit 204, a filtering unit 205, and a decoded image cache unit 206, etc., wherein the decoding unit 201 can implement header information decoding and CABAC decoding, and the filtering unit 205 can implement deblocking filtering and SAO filtering.
  • the decoding unit 201 can implement header information decoding and CABAC decoding
  • the filtering unit 205 can implement deblocking filtering and SAO filtering.
  • a code stream of the video signal is output; the code stream is input to the decoder 200, and first passes through the decoding unit 201 to obtain the decoded transform coefficients; the transform coefficients are processed by the inverse transform and inverse quantization unit 202 to generate residual blocks in the pixel domain; the intra-frame prediction unit 203 can be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction mode and the data from the previously decoded blocks of the current frame or picture; the motion compensation unit 204 is to determine the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and use The prediction information is used to generate a predictive block of the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 202 and the corresponding predictive block generated by the intra-frame prediction unit 203 or the motion compensation unit 204; the decoded video signal passes through the filtering unit 205 to remove the block effect artifacts
  • the embodiment of the present application also provides a network architecture of a codec system including an encoder and a decoder, wherein Figure 10 shows a schematic diagram of the network architecture of a codec system provided by the embodiment of the present application.
  • the network architecture includes one or more electronic devices 13 to 1N and a communication network 01, wherein the electronic devices 13 to 1N can perform video interaction through the communication network 01.
  • the electronic device can be various types of devices with video codec functions during implementation, for example, the electronic device can include a smart phone, a tablet computer, a personal computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensor device, a server, etc., which are not specifically limited here.
  • the decoder or encoder described in the embodiment of the present application can be the above-mentioned electronic device.
  • the method of the embodiment of the present application is mainly applied to the intra-estimation unit 102 and the intra-prediction unit 103 as shown in FIG9A and the intra-prediction unit 203 as shown in FIG9B . That is to say, the embodiment of the present application can be applied to both the encoder and the decoder, and can even be applied to both the encoder and the decoder at the same time, but the embodiment of the present application is not specifically limited.
  • the "current block” specifically refers to the coding block currently to be intra-frame predicted; when applied to the intra-frame prediction unit 203, the "current block” specifically refers to the decoding block currently to be intra-frame predicted.
  • FIG11 a schematic flow chart of a decoding method provided by an embodiment of the present application is shown. As shown in FIG11, the method may include:
  • S104 Determine a prediction block of the current block based on the reference block and the first transformation model.
  • the decoding method is applied in the scenario for the intra-frame block copy technology.
  • the reference block can be transformed before determining the prediction block of the current block, or the reference block can be not transformed to achieve the determination of the prediction block.
  • the embodiment of the present application proposes a method for transforming a reference block and then predicting it, which can be implemented based on a constructed transformation model list.
  • transforming the reference block may include: implementing based on the selection of a transform model in a transform model list.
  • the transform of the reference block may also be implemented based on one of a preset LIC transform, a multi-model LIC transform, or a filter transform.
  • the transform model list includes at least two types of transform models.
  • the reference block can be transformed to obtain the prediction block.
  • the transformation of the reference block can be in the following ways:
  • Multi-model LIC transformation The relationship between the predicted block pixel Pred(x, y) and the reference block pixel ref(x, y) is as shown in formula (12):
  • threshold is the reference pixel threshold, and different parameters are used to perform linear transformation on the reference block pixels that exceed the threshold.
  • Pred(x,y) c0C+c1N+c2S+c3E+c4W+c5B
  • C is the reference block pixel at (x, y)
  • N is the pixel above it
  • S is the pixel below it
  • W is the pixel to the left
  • E is the pixel to the right, as shown in the figure below.
  • B (Bias) is a fixed value, for example, B is the median of the pixel range.
  • c0 to c5 are filter coefficients.
  • the filter transforms the reference pixels in a certain area
  • some pixels outside the area will be used as input, and the pixels inside the area can be used to fill the part outside the area.
  • the pixels outside the area have been reconstructed, the reconstructed values are directly used.
  • the required parameter information (such as ⁇ i , ⁇ i , c i , threshold, etc.) can be saved as the parameter information and model type corresponding to the position of the codec block, which is used when the subsequent IBC codec block constructs the transformation model candidate list.
  • a code stream may be acquired or parsed to obtain relevant syntax elements of the current block, and the relevant syntax elements are used to indicate whether the current block is predicted using an intra-block copy technology combined with a transform model list.
  • the relevant syntax element information may include multiple syntax elements.
  • the relevant syntax elements include at least: a second syntax element.
  • the second syntax element is used to indicate whether the current block is predicted using a transform model list.
  • the decoder can use one of the existing preset LIC transforms, multi-model LIC transforms, or filter transforms to implement the transform of the reference block, or does not transform the reference block, which is not limited in the embodiments of the present application.
  • the second syntax element may be represented by cu_ibc_model_merge_flag, representing a merge flag in the IBC mode.
  • the relevant syntax elements may further include: a first syntax element; the first syntax element is used to indicate a prediction mode of the current block using an intra-block copy technology.
  • the first syntax element may be represented by pu_merge_flag, which indicates a prediction mode flag bit that the current block uses the intra-block copy technology.
  • the prediction mode using the intra-block copy technology may include: optimized motion vector prediction (IBC-AMVP) mode or merge mode (IBC-Merge).
  • the decoder parses the bitstream to obtain the encoding information of the block vector, and based on the candidate block vector list constructed based on the candidate block, it can determine the reference block of the current block when using the intra-frame block copy technology.
  • the decoder determines that the current decoding uses prediction based on the transform model list based on the relevant syntax elements
  • the first transform model can be determined from the transform model list based on the relevant syntax elements.
  • the decoder transforms the reference block based on the first transform model to obtain the prediction block of the current block, and then determines the prediction value of the prediction block.
  • the decoder parses the coding residual in the bitstream, it determines the reconstruction value of the current block based on the prediction value and the coding residual, and completes the decoding process of the current block.
  • the decoder parses the bitstream and decodes the first syntax element; determines the prediction mode of the current block using the intra-block copy technology according to the first syntax element, and decodes the second syntax element.
  • the value of the decoded first syntax element when the value of the decoded first syntax element is a first value, it indicates that the prediction mode of the current block using the intra-block copy technology is an optimized motion vector prediction mode, and when the value of the decoded first syntax element is a second value, it indicates that the prediction mode of the current block using the intra-block copy technology is a merge mode.
  • the manner of decoding the second syntax element may be different.
  • the value of the decoded second syntax element when the value of the decoded second syntax element is a first value, it indicates that the current block is predicted using the transformation model list, and when the value of the decoded second syntax element is a second value, it indicates that the current block is not predicted using the transformation model list.
  • the first value is different from the second value, and the first value and the second value can be in parameter form or in digital form.
  • the first identification information can be a parameter written in the profile or a flag value, which is not specifically limited here.
  • the first value can be set to 1 and the second value can be set to 0; or, the first value can be set to 0 and the second value can be set to 1; or, the first value can be set to true and the second value can be set to false; or, the first value can be set to false and the second value can be set to true; but this is not specifically limited here.
  • the value of the second syntax element is 0 (false)
  • it can be determined that the prediction method of the transform model list is not used for the current block that is, the decoding method based on the transform model list proposed in the present application is not used
  • the value of the first identification information is 1 (true)
  • it can be determined that the prediction method of the transform model list is used for the current block that is, the decoding method based on the transform model list proposed in the present application is used.
  • the embodiment of the present application does not limit the expression form of the first value and the second value.
  • the first value is 0 (false) and the second value is 1 (true) as an example for description.
  • the decoder determines whether to use the transformation model list for prediction based on the value of the decoded second syntax element, and can further determine which is the first transformation model for prediction and whether transformation processing is required.
  • the transformation model list contains multiple transformation models. In the process of encoding each block, a different transformation model can be selected each time. This can increase the diversity of predictions and choose a suitable method for transformation for each block, instead of using a unified preset transformation model for the same transformation processing, thereby improving decoding performance.
  • a flowchart of an optional decoding method provided by the basic application embodiment may include:
  • the decoding process of S201 is consistent with the process in the aforementioned embodiment and will not be repeated here.
  • the first syntax element is represented by pu_merge_flag
  • pu_merge_flag indicates that the prediction mode is a merge model.
  • the pu_merge_flag decoded by the decoder is the first value, that is, false
  • the decoder can determine that the current block uses an optimized motion vector prediction mode.
  • the decoder continues to parse the bitstream and can decode the third syntax element.
  • the relevant syntax elements include: the third syntax element.
  • the third syntax element indicates whether to use the transform technology for prediction.
  • cu_ibc_lic_flag may be used to represent the third syntax element.
  • cu_ibc_lic_flag indicates whether a transform is used to process the reference block for prediction. If the third syntax element is true, the transform is used; if the third syntax element is false, the transform is not used. However, even if a transform is used to process the reference block, it is necessary to further determine whether the transform model list is used for the transform, because the same preset transform model may be used to perform the same transform on all blocks.
  • the value of the third syntax element can also be the first value, the second value, etc., which is the same as the setting expression of the first syntax element and the second syntax element, and will not be repeated here.
  • the fourth syntax element is used to indicate the model index of the transformation model in the transformation model list;
  • the related syntax element information also includes: the fourth syntax element;
  • the decoder may decode the third syntax element as the first value (false) or the second value (true).
  • the decoded third syntax element is the second value, it indicates that the current block is predicted by transforming the reference block, and the decoder needs to continue decoding the second syntax element to see whether to select a transform model suitable for the current block by using a transform model list or directly use a preset single transform model for transformation.
  • the decoder in the process of decoding the second syntax element, when the decoder decodes the value of the second syntax element as the second value (true), indicating that the current block is predicted using the transformation model list, the decoder can continue to parse the bitstream, decode the fourth syntax element included in the relevant syntax element, and obtain the index information of the transformation model in the transformation model list.
  • the fourth syntax element is used to indicate the model index of the transformation model in the transformation model list.
  • the decoder may use cu_ibc_model_merge_idx to represent the fourth syntax element.
  • S205 Determine a first transformation model in the constructed transformation model list based on the index information of the transformation model.
  • S206 Determine a prediction block of the current block based on the reference block and the first transformation model.
  • the decoder when the decoder decodes the fourth syntax element, it can determine the first transformation model corresponding to the index information of the transformation model represented by the fourth syntax element from the constructed transformation model list. In other words, during the prediction process of the current block, the decoder determines the first transformation model adapted to the current block from the transformation model list. In this way, the decoder can implement the transformation processing of the reference block based on the first transformation model, thereby obtaining the prediction block of the current block, and then perform subsequent decoding processing based on the prediction block.
  • a candidate list of transformation models is constructed for the current block, and the prediction mode and transformation model of the current block are determined by writing the block-level mode flags (first syntax element, second syntax element, third syntax element) and the candidate index (fourth syntax element) of the bitstream.
  • the syntax elements are as follows:
  • the decoding process is as follows: Decode IBC prediction mode related elements. Decode cu_ibc_lic_flag. If cu_ibc_lic_flag is true, it indicates that the reference block of the coding block needs to be transformed. Further decode cu_ibc_model_merge_flag. If cu_ibc_model_merge_flag is true, it indicates that the transformation model is determined by building a transformation model candidate list. Further decode cu_ibc_model_merge_idx to determine which transformation model in the list is used. If cu_ibc_model_merge_flag is false, it indicates that the coding block uses the IBC-LIC method. If cu_ibc_lic_flag is false, it indicates that other IBC-based prediction methods are used.
  • cu_ibc_lic_flag and cu_ibc_model_merge_flag can adopt an entropy coding method based on a context model.
  • the value range of cu_ibc_model_merge_idx can be less than or equal to the maximum transform model candidate list length, and variable length coding can be used. The smaller the index, the shorter the corresponding codeword.
  • the value range of cu_ibc_model_merge_idx is n, and truncated binary code coding is used.
  • the codewords are shown in Table 4 below, and each bit under different codewords in Table 4 can use context model coding (Intra_tmp_idx) or equal probability coding.
  • the decoder determines the first transformation model in the constructed transformation model list based on the index information of the transformation model, and the process may also include: if the fourth syntax element of the transformation model is a third value, indicating at least one other transformation model in the transformation model list, wherein the other transformation models are transformation methods corresponding to other reference blocks.
  • the reference block transformation methods of other IBCs can also be used as model candidates in the transformation model list, and these methods and the inherited available transformation models can be encoded through a unified syntax element.
  • a syntax element is used to represent the index of the transformation method transmission corresponding to other reference blocks, and the value of the index may indicate the selection of other LIC models, etc., to achieve multiplexing on the syntax element.
  • the decoding method further includes:
  • whether to decode the second syntax element can be determined by changing the meaning of the third syntax element. For example, when the third syntax element is true, it indicates that the reference block is not processed by transformation. When the third syntax element is false, it indicates that the reference block is processed by transformation.
  • the decoder can decode the second syntax element when the value of the third syntax element is the first value (false).
  • S207 is an alternative implementation method to S203, and the embodiment of the present application does not limit this.
  • syntax elements are as follows:
  • cu_ibc_lic_flag Decode cu_ibc_lic_flag. If cu_ibc_lic_flag is true, it indicates that the coding block uses the IBC-LIC method. If cu_ibc_lic_flag is false, further decode cu_ibc_model_merge_flag. If cu_ibc_model_merge_flag is true, it indicates that the transformation model is determined by building a transformation model candidate list. Further decode cu_ibc_model_merge_idx to determine which transformation model in the list is used. If cu_ibc_model_merge_flag is false, it indicates that other IBC-based prediction methods are used.
  • the decoder when the decoder decodes the second syntax element as true, it indicates that the current block is predicted by using a transformation model list, and then the transformation model list needs to be constructed.
  • the process of constructing the transformation model list by the decoder includes: sequentially adding at least one different transformation model to the initial transformation model list to obtain the transformation model list;
  • the at least one transformation model includes at least one of the following:
  • a third transformation model corresponding to pixels at at least one non-adjacent position of the current block
  • At least one different transformation model is sequentially added to the initial transformation model list.
  • the order of adding the models can be any order between the second transformation model, the third transformation model, the fourth transformation model, the available transformation model in the time domain, and the preset transformation model.
  • any type of transformation model can include multiple.
  • the order of adding at least one transformation model when constructing the transformation model candidate list may be different, for example, adding historical available transformation models first, and then adding non-adjacent available transformation models, etc., which is not limited in the embodiment of the present application.
  • transformation model list has a maximum length, which is not limited in the embodiments of the present application.
  • a transform model candidate list is constructed for the current coding block, with a maximum length of N.
  • the list may be composed of the following candidates in order:
  • the available transformation model of the adjacent position (the second transformation model).
  • the default transformation model may include: a LIC transformation model with parameters ⁇ 0 , ⁇ 0 , and a transformation model obtained by adjusting the existing transformation models in the list.
  • redundancy determination may be performed. For example, a transformation model to be added is added to the list only if it is different from all candidates in the list.
  • variable model candidates in the time domain may be added.
  • the list is constructed in the following order:
  • the preset transformation model includes: a model corresponding to the preset model parameters or a model obtained by offsetting at least one of the second transformation model, the third transformation model and the fourth transformation model, the model corresponding to the preset model parameters and the available transformation model in the time domain.
  • the offset refers to the offset of any parameter in any transformation model.
  • a new transformation model can be obtained by performing some offsets on the existing candidate transformation model parameters and added to the transformation model list.
  • the transformation model in the time domain is obtained by checking multiple adjacent points in the same frame in the reference frame list.
  • the variable model candidates in the time domain after translation can also be added.
  • the list is constructed in the following order:
  • the motion vector for translation is first obtained based on the neighboring blocks of the current block, and then the vector is applied to each checkpoint of the temporal candidate as a new checkpoint to obtain the available transformation model of the temporal domain after translation.
  • the above temporal candidate acquisition process can refer to the temporal candidate acquisition process in inter-frame prediction.
  • the prediction type of the block corresponding to the second transformation model, the third transformation model and the fourth transformation model included in the transformation model list is any one of intra-frame simulation matching prediction and intra-frame block copy technology.
  • the second transformation model, the third transformation model and the fourth transformation model can be from the IBC or IntraTMP intra-frame simulation matching prediction block, or only the transformation model from IBC or only the transformation model from IntraTMP can be used, which is not limited in the embodiments of the present application.
  • the process of acquiring at least one transformation model to be added to the transformation model list can be obtained only when the transformation condition is met.
  • a transformation condition includes at least one of the following:
  • the block where the pixel is located uses the intra-block copy technology, the transformation model flag is valid, and the size of the block where the pixel is located meets the first preset size.
  • the judgment of whether the above-mentioned at least one transformation model can be obtained can be: if the codec unit at the position is encoded and decoded by IBC mode or IntraTMP mode, and its prediction block is obtained by transforming the reference block, whether there is a transformation model, there is a transformation model flag (similar to the LIC flag) flag is valid, then the transformation model is obtained, and the transformation type is saved as a flag, which is convenient for checking the flag when the subsequent block construction list is constructed, but it is not transmitted by the encoder (the encoder transmission flag is also possible, different syntax elements), then the model used for transformation belongs to at least one transformation model. In addition, it is determined whether the codec unit at the position meets the predefined size limit to determine at least one transformation model.
  • the at least one different transformation model includes at least one of the following: at least one transformation model has a different transformation type, has different model parameters, and uses different template areas under the same transformation type.
  • transformation types are different, they are different, and the LIC transformations using different template regions are treated as different types;
  • the decoder sequentially adds at least one different transformation model to the initial transformation model list, and the process of obtaining the transformation model list may be:
  • the decoder sequentially adds at least one different transformation model to the initial transformation model list to obtain an intermediate transformation model list; and reorders the intermediate transformation model list to obtain a transformation model list.
  • the order of adding the at least one transformation model added in sequence is not limited.
  • the reordering process is optional and is not limited in the embodiment of the present application.
  • the decoder reorders the intermediate transformation model list to obtain the transformation model list, including:
  • the template error values of each transformation model are from small to large, and the index information of the corresponding transformation model list is from small to large.
  • the error value is determined to be the maximum value.
  • the offset value offset is calculated according to the current block template and the reference block template for the subsequent prediction value calculation; here, all transformation models need to be traversed to calculate the offset of each transformation model. It should be noted that if there is no reordering, only the offset of the selected transformation model can be calculated, and it is not necessary to calculate the offset for all candidates.
  • the N rows above the current block and the M columns on the left are used as the current block template, and the corresponding adjacent area of the reference block is the reference block template.
  • the transformation model list For a certain transformation model in the transformation model list, it is applied to the reference block template to obtain the prediction of the reference block template, and then the error value between the reference block template prediction and the current block template is obtained.
  • the error value can be calculated by SAD, and the offset value is added to obtain the template error value; finally, the list is reordered according to the template error value corresponding to each transformation model. For example, the smaller the template error value of the transformation model, the smaller the corresponding model index; when the reference block template is not available, the SAD is set to the maximum value, such as the maximum value of the integer.
  • each transformation model of different transformation types corresponds to a different reference block template area; and each transformation model error value is an average template error value of the number of pixels in the respective reference block template.
  • the template error value of each transformation model can use different template areas, and the average template error value can be calculated according to the number of pixels of the template for comparison. It can also be extended to the scene of calculating offest, and different template areas can be used with different transformation types. For example, if the transformation type is LIC transformation using the left template, the left template can be used when calculating offset.
  • first position information (upper left corner coordinates) of the current block and the current size of the current block are obtained;
  • At least one adjacent position of the current block and at least one non-adjacent position of the current block are determined based on the first position information and the current size.
  • the adjacent position and the non-adjacent position can be determined according to the position and size of the current block. For example, if the coordinates of the upper left corner of the current block are (X, Y), and the width and height are (W, H), then the adjacent positions can be (X-1, Y+H-1), (X+W-1, Y-1), (X-1, Y+H), (X-1, Y-1).
  • the derived local compensation model is obtained, and the local compensation model is added to the transformation model list.
  • the historical available transformation model may overlap with the available transformation model of the adjacent position and the available transformation model of the non-adjacent position, but the historical available transformation model corresponds to more areas, and the historical available transformation model saves the most recent historical transformation model of the most recent codec block in the coding and decoding order.
  • the decoder maintains a list of historical transformation models, and removes duplicates from this list of historical transformation models in turn and then adds them to the list of candidate transformation models.
  • a historical transformation model used in the decoding process is obtained; when the same model exists in the historical transformation model and in the historical transformation model list, the same model in the historical transformation model list is removed, and the historical transformation model is added to the first sequence position of the historical transformation model list; when the same model does not exist in the historical transformation model and in the historical transformation model list, the historical transformation model is added to the first sequence position of the historical transformation model list.
  • the process of adding a historical transformation model to the first sequence position of a historical transformation model list is: when the historical transformation model list meets a first preset list length, the transformation model at the last sequence position in the historical transformation model list is removed, and then the historical transformation model is added to the first sequence position of the historical transformation model list.
  • the fourth transformation model is determined sequentially from the historical transformation models in the order from the first sequence digit to the last sequence digit of the historical transformation models.
  • a list consisting of transformation models of encoded and decoded blocks can be maintained during the encoding and decoding process, which can be called a historical transformation model list, and is used to add candidates for historical transformation models (i.e., the fourth transformation model) when constructing a transformation model list for subsequent encoding and decoding blocks.
  • the historical coding model list has a maximum length K and is a first-in-first-out list. That is, the transformation model added first is at the bottom of the list, and the transformation model added last is at the top of the list.
  • the transformation model can be added to the historical list. When adding, determine whether the same model exists in the list.
  • the historical transformation model list is updated based on the historical transformation model.
  • a fifth syntax element is decoded; the fifth syntax element is used to indicate an index of a local compensation model when using a multi-mode local compensation technology;
  • a prediction block of the current block is determined.
  • the fifth syntax element is used to indicate the index of the local compensation model when using the multi-mode local compensation technology
  • a prediction block of the current block is determined.
  • the fifth syntax element can be expressed by cu_ibc_lic_idc.
  • cu_ibc_lic_idc represents the index of the IBC-LIC sub-method under the multi-mode IBC-LIC technology.
  • cu_ibc_lic_idc indicates the index of the LIC sub-method under the multi-mode IBC-LIC.
  • the transformation model list includes multiple transformation models. In the process of encoding each block, a different transformation model can be selected each time, which can increase the diversity of prediction and select a suitable method for each block to transform, rather than using a unified preset transformation model for the same transformation processing, thereby improving the decoding performance.
  • the transformation model list is not used for transformation, the LIC transformation model or the multi-mode IBC-LIC can also be used to implement the transformation processing to ensure decoding efficiency.
  • the present application provides a flowchart of an optional decoding method, which may include:
  • the decoding process of S201 is consistent with the process in the aforementioned embodiment and will not be repeated here.
  • the decoder when the first syntax element is represented by pu_merge_flag, it indicates that the prediction mode is a merge model. Then, when the pu_merge_flag decoded by the decoder is the second value, that is, true, the decoder can determine that the current block adopts the optimized merge mode. At this time, the decoder continues to parse the bitstream and can decode the second syntax element.
  • the fourth syntax element (cu_ibc_model_merge_idx), determines the index information of the transformation model, and skips the process of the current block inheriting the local compensation flag from the merge candidate block; the fourth syntax element is used to indicate the model index of the transformation model in the transformation model list; the related syntax element information also includes: the fourth syntax element;
  • S304 Determine a first transformation model in the constructed transformation model list based on the index information of the transformation model.
  • the decoding process of S303-S305 is consistent with the process of S204-S206 in the aforementioned embodiment, and will not be repeated here.
  • a transformation model candidate list is constructed for the current coding block, and the prediction mode and transformation model of the current coding block are determined by writing the block-level mode flag (first syntax element, second syntax element) and the candidate index (fourth syntax element) of the bitstream.
  • the syntax elements are as follows:
  • the reference block is transformed according to the transformation model selected by cu_ibc_mdel_merge_idx.
  • the decoding process is the same as the above embodiment.
  • the process of the decoder determining the prediction block of the current block based on the reference block and the first transformation model is:
  • the reference block is transformed by using the first transformation model, and the first offset value is compensated in the transformation result corresponding to each pixel to obtain a prediction block of the current block; or, the first offset value is used to compensate the parameters in the first transformation model to obtain an updated first transformation model, and then the updated first transformation model is used to transform the reference block.
  • the first transformation model is an LIC model or a multi-mode LIC
  • using the first offset value to compensate the parameters in the first transformation model is to compensate for ⁇ in the transformation model, thereby obtaining an updated first transformation model with updated ⁇ .
  • the offset value offset can be calculated according to the pixel values of the current block and the reference block template area (matching template) to adjust the predicted value, for example:
  • the final prediction value can be the transformed prediction value plus the offset block.
  • Pred(x,y) ⁇ ref(x,y)+ ⁇ +offset (30)
  • the calculation in the embodiment of the present application can be implemented by integer-based addition, multiplication and shift operations (rounding can be performed during shift operations), and the embodiment of the present application is not limited.
  • the first transformation model is a local compensation model
  • the method for calculating the offset can use the parameter derivation method of the LIC technology (derive ⁇ and ⁇ based on the template area, derive ⁇ based on the minimum error, and then derive ⁇ based on ⁇ and the pixel value in the area). That is, the LIC technology can be deduced to obtain ⁇ and ⁇ .
  • the local compensation flag (LIC flag) of the current block is determined to be a second value.
  • the IBC coding block constructs the Merge list, it refers to a certain position PU to construct the merge candidate. If the cu_ibc_model_merge_flag of the PU is true, then the next block, such as the next block on the right, can set the LIC flag of the merge candidate to true as the candidate for the Merge list of the next block.
  • the process of the decoder determining the prediction block of the current block based on the reference block and the first transformation model is to use the first transformation model and the local compensation transformation model indicated by the local compensation flag to perform secondary transformation on the reference block in turn to determine the prediction block of the current block.
  • the reference block is transformed according to the local compensation transformation model derived from the current block template and the reference block template to determine the prediction block of the current block.
  • the LIC flag is true and cu_ibc_model_merge_flag is also true, two transformations can be performed at the same time, and the execution order is not limited. If the IBC coding block selects the merge candidate, the LIC flag of the coding block is true, and the LIC transformation should be performed on the reference block.
  • the linear parameters are derived from the current block template and the reference block template.
  • the local compensation flag (LIC flag) of the current block is determined to be a first value.
  • IBC coding blocks construct Merge list, they refer to a certain position PU to construct merge candidates, and the cu_ibc_model_merge_flag of the PU can be ignored, that is, the cu_ibc_model_merge_flag of the PU is not used to determine whether the merge candidate undergoes LIC transformation. Whether the encoding and decoding of the subsequent blocks are transformed may have nothing to do with cu_ibc_model_merge_flag. That is, if cu_ibc_model_merge_flag is true, the LIC flag of the merge candidate can be set to false.
  • the decoder may further decode the second syntax element according to the decoded information during the process of decoding the second syntax element, wherein the decoded information includes at least one of the following:
  • the size of the current block, the CIIP flag, GPM flag, MBVD flag, skip flag and TM_merge flag of the current block is the size of the current block, the CIIP flag, GPM flag, MBVD flag, skip flag and TM_merge flag of the current block.
  • the first decoding condition includes at least one of the following:
  • the value of the CIIP flag is the first value (false);
  • the value of the GPM flag is the first value (false);
  • the MBVD flag is the first value (false);
  • the skip flag is the first value (false);
  • the TM_merge flag is the first value
  • the size of the current block is smaller than the third preset size
  • the area of the current block is greater than a first preset area threshold.
  • the flag cu_ibc_model_merge_flag it is possible to determine whether to decode the flag cu_ibc_model_merge_flag only when the width and height of the current block meet a certain range and some limiting conditions according to the existing codec information. If the conditions are not met, cu_ibc_model_merge_flag is false and cu_ibc_model_merge_idx is not decoded. For example, the CIIP flag, GPM flag, MBVD flag, TM_merge flag and skip flag of the current block.
  • the decoding process can be:
  • decode cu_ibc_model_merge_flag may depend on other decoded mode flags, which is not limited in the embodiment of the present application.
  • a second syntax element when at least one of a sequence-level syntax element, a frame-level syntax element, a slice-level syntax element, and a size of a current block satisfies a second decoding condition, a second syntax element is decoded.
  • cu_ibc_model_merge_flag and cu_ibc_model_merge_idx can be determined based on conditions such as frame level, slice level flag, block size, etc.
  • sequence-level flag sps_ibc_model_merge_enable_flag there is a sequence-level flag sps_ibc_model_merge_enable_flag, and the decoding process may be:
  • a reference block for the current block is determined, and at least one prediction based on intra-frame block copy technology-intra-frame/inter-frame joint prediction, intra-frame block copy technology-geometric partitioning mode and intra-frame block copy technology-reconstruction value reordering is performed to obtain a reference prediction block of the reference block; the reference prediction block is used to update the reference block.
  • the aforementioned reference block may also be a prediction block obtained by technologies such as IBC-CIIP, IBC-GPM, and RRIBC.
  • update parameters of the multi-mode local compensation model are recalculated based on the current block template and the reference block template; and the first transformation model is updated based on the updated parameters.
  • the threshold can be recalculated based on the templates of the current block and the reference block.
  • the threshold in the transformation model list is available, but it can also be recalculated and used to transform the reference block.
  • many decoding methods may be used to decode the second syntax element, which is not limited by the embodiments of the present application.
  • cu_ibc_model_merge_flag can use multiple context models for joint encoding and decoding, select the context model according to the encoding and decoding information of adjacent blocks, or use equal probability encoding and decoding.
  • decoding the fourth syntax element and determining the index information of the transformation model includes at least one of the following:
  • the fourth grammatical element is decoded by partially adopting a decoding method of the second context model and partially adopting an equal probability decoding method to determine index information of the transformation model.
  • each bit of cu_ibc_model_merge_idx can use context model coding and decoding, or use equal probability coding and decoding, or partially use context model coding and decoding and partially use equal probability coding and decoding.
  • the relationship between the first context model for decoding the second syntax element information and the first context model for decoding the second syntax element information when the prediction mode of the current block using the intra-frame block copy technology is the merge mode includes: the same or different.
  • the second context model for decoding the fourth syntax element information when the prediction mode of the current block using the intra-frame block copy technology is the optimized motion vector prediction mode, the second context model for decoding the fourth syntax element information, and when the prediction mode of the current block using the intra-frame block copy technology is the merge mode, the relationship between the second context model for decoding the fourth syntax element information includes: the same or different.
  • cu_ibc_model_merge_flag and cu_ibc_model_merge_idx in IBC-AMVP mode and IBC-Merge mode can be encoded and decoded using different context models, or can be encoded and decoded using the same context model.
  • the same context model can be used to encode and decode cu_ibc_model_merge_flag or cu_ibc_model_merge_idx.
  • cu_ibc_model_merge_flag can use multiple context models for encoding and decoding, and select which context model to use based on the encoded and decoded information of the adjacent blocks. For example, when three context models are used, if the cu_ibc_model_merge_flag of the left block and the upper block are both true, context model 1 is used; if only one of the cu_ibc_model_merge_flag of the left block and the upper block is true, context model 2 is used; otherwise, context model 3 is used, etc., which is not limited in the embodiments of the present application.
  • the present application provides a flowchart of an optional decoding method, which may include:
  • the decoder when determining the reference block, can also decode and obtain the sixth syntax element of the reference block of the current block, which is used to indicate the index information of the reference block. In this way, the decoder can determine the reference block obtained by the intra-block copy technology for the current block in the Merge list based on the sixth syntax element.
  • the decoder can determine the reference block of IBC according to the IBC-Merge related elements. For example, a Merge list is constructed for the current block, a merge candidate is determined according to the Merge index, and information such as the block vector and block vector accuracy of the current block is obtained, thereby obtaining the reference block of the current block through motion compensation.
  • the decoder obtains the second syntax element of the merge candidate block of the reference information source corresponding to the reference block, that is, the cu_ibc_model_merge_flag of the decoded merge candidate block. If the cu_ibc_model_merge_flag of the merge candidate block of the current block is true, then the cu_ibc_model_merge_flag of the current block can be directly true, and the first transform model of the current block can be determined according to the transform model of the reference corresponding to the merge candidate block, instead of parsing the second syntax element of the current block from the bitstream, thereby reducing the transmission codewords.
  • a merge candidate is constructed with reference to a certain position PU. If the cu_ibc_model_merge_flag of the candidate PU is true, the cu_ibc_model_merge_flag of the current coding block is set to true, and the transformation model of the PU is set to the transformation model of the current coding block.
  • a transformation model candidate list is constructed for the current block, and the prediction mode and transformation model of the current block are determined according to the encoding and decoding information of the Merge candidates. There is no need to encode cu_ibc_model_merge_flag or cu_ibc_model_merge_idx, that is, cu_ibc_model_merge_flag is not transmitted.
  • determining the first transform model of the current block based on the transform model of the reference corresponding to the merge candidate block includes at least one of the following:
  • the reference transformation model is used as the first transformation model.
  • a first transformation model type of a reference transformation model is determined; and a first transformation model consistent with the first transformation type is re-derived according to the reference block template and the current block template.
  • S406 Determine a prediction block of the current block based on the reference block and the first transformation model.
  • the decoding process of S406 is consistent with the process of S206 in the aforementioned embodiment, and will not be repeated here.
  • the cu_ibc_model_merge_flag flag of the merge candidate it is determined whether the current block transforms the reference block. If cu_ibc_model_merge_flag is true, the first transformation model is used to calculate the offset value offset according to the reference pixels of the current block and the reference block template area, and the reference block of the current block is transformed to obtain the final prediction block, thereby completing the encoding and decoding of the current block.
  • the historical transformation model list is updated based on the first transformation model.
  • the first transformation model used by the current block is saved and added to the historical transformation model list for use in constructing the transformation model list of subsequent blocks.
  • a prediction block of the current block is determined based on the reference block
  • a fifth transform model of the current block is constructed in the template area or within the block for use in a subsequent decoding process.
  • the second syntax element of the current block is the first value, indicating that the prediction method of the transform model list is not applicable
  • the second syntax element of the merged candidate block of the current block is the first value, indicating that the second syntax element is the first value.
  • one implementation is to indicate that the reference block is not processed using the transform technology, so the decoder can determine the prediction block of the current block based on the reference block.
  • a transformation model is derived based on the reconstructed pixel values (template area or block) after coding and decoding, which is used for the subsequent transformation model list construction and inheritance of the method of this application.
  • a corresponding transformation model is also constructed, so that the subsequent blocks can inherit it when the coded block is used as a reference block.
  • the decoding method further includes:
  • the method further includes:
  • the seventh transformation model is used to replace the first transformation model, and the transformation model list is updated; or,
  • the seventh transformation model is adopted and the transformation model list is updated.
  • a transformation model is derived in the template area or block for subsequent transformation model list construction and inheritance of the method of this application.
  • a transformation model (the type can be consistent with the original one) can be re-derived based on the reconstructed value of the current code block (intra-block area or template area) to directly replace the first transformation model used in the prediction process (update the model in the transformation model list).
  • it is determined based on the error value such as SAD whether to replace the original transformation model in the transformation model list, leaving the model with a small error, or saving both models.
  • the decoding method provided in the present application can be implemented based on inter-frame prediction or IntraTMP prediction, that is, the IBC coding block in the scheme is replaced by an Inter coding block or an IntraTMP coding block, and the embodiments of the present application are not limited thereto.
  • FIG. 12 a flow chart of an encoding method provided in an embodiment of the present application is shown. As shown in FIG. 12 , the method may include:
  • a first transformation model is obtained from the constructed transformation model list;
  • the constructed transformation model list includes at least two types of transformation models;
  • S506 encode relevant syntax elements of the current block, and write the obtained coded bits into the bitstream; wherein the relevant syntax elements are used to indicate whether the current block is predicted using the intra-block copy technology combined with the transformation model list.
  • the related syntax elements include at least: a second syntax element (cu_ibc_model_merge_flag);
  • the second syntax element is used to indicate whether the current block is predicted using a transform model list
  • the related syntax elements further include: a first syntax element (pu_merge_flag), and the first syntax element is used to indicate a prediction mode of the current block using an intra block copy technology.
  • a first syntax element (pu_merge_flag)
  • the first syntax element is used to indicate a prediction mode of the current block using an intra block copy technology.
  • the prediction modes of the intra block copy technology include: a merge mode and an optimized motion vector prediction mode; the method further includes:
  • the value of the first syntax element is encoded as a first value, and a third syntax element is encoded; the third syntax element is used to indicate whether to use the transformation technology for prediction; the third syntax element belongs to the related syntax element;
  • the method further includes:
  • the prediction mode of the current block using the intra block copy technology is the merge mode
  • the value of the first syntax element is encoded as a second value
  • the second syntax element is encoded.
  • the method further includes:
  • the second syntax element is encoded as a second value
  • the index information of the first transformation model in the transformation model list is encoded as a fourth syntax element
  • the fourth syntax element is used to indicate the model index of the transformation model in the transformation model list
  • the related syntax element information also includes: the fourth syntax element.
  • the method further includes:
  • the transformation model list is constructed.
  • the step of constructing the transformation model list includes:
  • the at least one transformation model comprises at least one of the following:
  • a third transformation model corresponding to pixels at at least one non-adjacent position of the current block
  • the preset transformation model includes: a model corresponding to the preset model parameters or a model obtained by offsetting at least one of the second transformation model, the third transformation model and the fourth transformation model, the model corresponding to the preset model parameters and the available transformation model in the time domain.
  • the method further includes:
  • a transformation condition includes at least one of the following:
  • the block where the pixel is located uses the intra-block copy technology, the transform model flag is valid, and the size of the block where the pixel is located meets the first preset size.
  • the at least one different transformation model includes at least one of the following: the at least one transformation model has a different transformation type, has different model parameters, and uses different template areas under the same transformation type.
  • the step of sequentially adding at least one different transformation model to the initial transformation model list to obtain the transformation model list includes:
  • the intermediate transformation model list is reordered to obtain the transformation model list.
  • the reordering of the intermediate transformation model list to obtain the transformation model list includes:
  • each of the transformation models respectively predicting the reference block template, and determining the reference block template prediction of each transformation model
  • the transformation models are reordered according to the template error values of the transformation models to obtain the transformation model list.
  • the template error values of the transformation models are arranged from small to large, and the index information of the corresponding transformation model list is arranged from small to large.
  • the error value is determined to be a maximum value.
  • first position information (upper left corner coordinates) of the current block and the current size of the current block are obtained;
  • At least one adjacent position of the current block and at least one non-adjacent position of the current block are determined based on the first position information and the current size.
  • a historical transformation model used in the encoding process is obtained
  • the historical transformation model is added to the first order position of the historical transformation model list.
  • the adding the historical transformation model to the first order position of the historical transformation model list includes:
  • the historical transformation model list meets the first preset list length, after the transformation model at the last order in the historical transformation model list is removed, the historical transformation model is added to the first order in the historical transformation model list.
  • the fourth transformation model is determined sequentially from the historical transformation models in the order of the historical transformation models from the first sequence position to the last sequence position.
  • the historical transformation model list is updated based on the historical transformation model.
  • determining a prediction block of a current block based on the reference block and the first transformation model includes:
  • the reference block is transformed by using the first transformation model, and the first offset value is compensated in the transformation result corresponding to each pixel to obtain a prediction block of the current block; or, the parameters in the first transformation model are compensated by using the first offset value to obtain an updated first transformation model, and then the updated first transformation model is used to transform the reference block.
  • the local compensation flag (LIC flag) of the current block is determined to be a second value
  • the step of determining a prediction block of a current block based on the reference block and the first transformation model comprises:
  • the first transformation model and the transformation model of local compensation indicated by the local compensation flag are used to perform secondary transformation on the reference block in sequence to determine the prediction block of the current block.
  • the reference block is transformed according to the transformation model of local compensation derived from the current block template and the reference block template to determine the prediction block of the current block.
  • encoding the second syntax element includes:
  • the size of the current block, the CIIP flag, GPM flag, MBVD flag, skip flag and TM_merge flag of the current block is the size of the current block, the CIIP flag, GPM flag, MBVD flag, skip flag and TM_merge flag of the current block.
  • encoding the second syntax element according to the encoded information includes:
  • the first encoding condition includes at least one of the following:
  • the value of the CIIP flag is a first value (false);
  • the value of the GPM flag is a first value (false);
  • the MBVD flag is a first value (false);
  • the skip flag is a first value (false);
  • the TM_merge flag bit is a first value
  • the size of the current block is smaller than a third preset size
  • the area of the current block is greater than a first preset area threshold.
  • each transformation model of different transformation types corresponds to a different reference block template area
  • the error value of each transformation model is an average template error value of the number of pixels in the respective reference block template.
  • a sixth transform model is determined
  • the third syntax element is encoded as the first value or the second value, and a fifth syntax element is encoded; the fifth syntax element is used to indicate an index of a local compensation model when a multi-mode local compensation technology is used.
  • the local compensation flag (LIC flag) of the current block is determined to be a first value.
  • encoding the second syntax element includes:
  • the second syntax element is encoded.
  • the fourth syntax element is encoded as a third value, wherein the other transformation model is a transformation mode corresponding to other reference blocks.
  • the step of constructing the transformation model list includes:
  • the derived local compensation model is obtained, and the local compensation model is added to the transformation model list.
  • a reference block of the current block is determined to be predicted based on at least one of intra-frame block copy technology-intra-frame/inter-frame joint prediction, intra-frame block copy technology-geometric partition mode, and intra-frame block copy technology-reconstruction value reordering to obtain a reference prediction block of the reference block;
  • the reference block is updated using the reference prediction block.
  • update parameters of the multi-mode local compensation model are recalculated based on the current block template and the reference block template;
  • the first transformation model is updated.
  • encoding the second syntax element includes:
  • the second syntax element is encoded by adopting an equal probability encoding method.
  • encoding the index information of the first transformation model in the transformation model list as a fourth syntax element includes at least one of the following:
  • the index information of the first transformation model in the transformation model list is encoded as a fourth syntax element by partially adopting the encoding method of the second context model and partially adopting the equal probability encoding method.
  • the relationship between the first context model for encoding the second syntax element information and the first context model for encoding the second syntax element information when the prediction mode of the current block using the intra-frame block copy technology is the merge mode includes: the same or different.
  • the relationship between the second context model for encoding the fourth syntax element information includes: the same or different.
  • index information of a reference block is determined, and the index information of the reference block is encoded as a sixth syntax element, where the sixth syntax element is used to indicate the index information of the reference block.
  • the method further includes:
  • a first transformation model of the current block is determined.
  • determining the first transform model of the current block based on the reference transform model corresponding to the merge candidate block includes:
  • the reference transformation model is used as the first transformation model.
  • determining the first transform model of the current block based on the reference transform model corresponding to the merge candidate block includes:
  • the first transform model consistent with the first transform type is re-derived according to the reference block template and the current block template.
  • determining the first transform model of the current block based on the reference transform model corresponding to the merge candidate block includes:
  • a first transformation model of the current block is determined based on a reference transformation model corresponding to the merged candidate block.
  • the method further includes:
  • a fifth transform model of the current block is constructed in the template area or within the block for use in a subsequent encoding process.
  • the method further includes:
  • the seventh transformation model is adopted to update the transformation model list.
  • the method further includes:
  • the first transformation model is a local compensation model, obtaining pixel values of a first reconstructed region adjacent to the current coding block and pixel values of a second reconstructed region adjacent to the reference block;
  • the prediction type of the block corresponding to the second transformation model, the third transformation model and the fourth transformation model included in the transformation model list is any one of intra-frame template matching prediction and intra-frame block copy technology.
  • the historical transformation model list is updated based on the first transformation model.
  • the first syntax element is encoded as a first value.
  • the encoder can select a first transform model from a transform model list including at least two types of transform models; use the selected first transform model to transform the reference block, and then determine the prediction block. Therefore, in the process of encoding implementation, the first transform model used to implement the transformation can be selected and determined from the transform model list, which can ensure the diversity of selection, thereby making the possibility of the prediction process higher, improving the diversity of prediction, and ultimately improving the encoding performance.
  • the embodiment of the present application provides a code stream, wherein the code stream is generated by bit encoding according to information to be encoded; wherein the information to be encoded includes at least one of the following: a first syntax element, a second syntax element, a third syntax element, a fourth syntax element, a fifth syntax element, a sixth syntax element, a size of a current block, a CIIP flag bit of the current block, a GPM flag bit, an MBVD flag bit, a skip flag bit, a TM_merge flag bit and a context model; wherein,
  • the first syntax element is used to indicate a prediction mode of a current block using an intra-block copy technology
  • the second syntax element is used to indicate whether the current block is predicted using a transform model list
  • the third syntax element is used to indicate whether to use a transform technique for prediction
  • the fourth syntax element is used to indicate a model index of the transformation model in the transformation model list
  • the fifth syntax element is used to indicate the index of the local compensation model when using the multi-mode local compensation technology
  • the sixth syntax element is used to indicate index information of a reference block.
  • an embodiment of the present application provides a decoder 1, comprising:
  • the decoding part 11 is configured to obtain relevant syntax elements of the current block; wherein the relevant syntax elements are used to indicate whether the current block is predicted using an intra-block copy technology combined with a transform model list;
  • a first determining part 12 is configured to determine a reference block obtained by using the intra-block copying technique for a current block
  • the constructed transformation model list includes at least two types of transformation models
  • the first prediction part 13 is configured to determine a prediction block of a current block based on the reference block and the first transform model.
  • the relevant syntax elements include at least: a second syntax element
  • the second syntax element is used to indicate whether the current block is predicted using a transform model list.
  • the related syntax elements also include: a first syntax element; the first syntax element is used to indicate a prediction mode of the current block using an intra-block copy technology.
  • the decoding part 11 is further configured to decode the first syntax element
  • a prediction mode of the current block using the intra block copy technology is determined, and the second syntax element is decoded.
  • the first determining part 12 is further configured to determine that the prediction mode of the current block using the intra block copy technology is an optimized motion vector prediction mode when the value of the first syntax element is a first value;
  • the decoding part 11 is further configured to decode a third syntax element, the third syntax element is used to indicate whether to use a transform technique for prediction; the third syntax element belongs to the related syntax element;
  • the second syntax element is decoded.
  • the first determining part 12 is further configured to determine that the prediction mode of the current block using the intra block copy technology is an optimized motion vector prediction mode when the value of the first syntax element is the first value, and the decoding part 11 is further configured to decode the second syntax element;
  • the first determination part 12 is further configured to determine that the prediction mode of the current block using the intra-block copy technology is a merge mode when the value of the first syntax element is a second value, and the decoding part 11 is further configured to decode the second syntax element.
  • the decoding part 11 is further configured to, when the value of the second syntax element is the second value, indicate that the current block uses the transformation model list for prediction, decode the fourth syntax element, determine the index information of the transformation model, and skip the process of the current block inheriting the local compensation flag from the merged candidate block; the fourth syntax element is used to indicate the model index of the transformation model in the transformation model list; the related syntax element information also includes: the fourth syntax element;
  • the first determining part 12 is further configured to determine the first transformation model in the constructed transformation model list based on the index information of the transformation model.
  • the first determining part 12 is further configured to construct the transformation model list when the value of the second syntax element is a second value.
  • the first determining part 12 is further configured to sequentially add at least one different transformation model to the initial transformation model list to obtain the transformation model list;
  • the at least one transformation model comprises at least one of the following:
  • a third transformation model corresponding to pixels at at least one non-adjacent position of the current block
  • the preset transformation model includes: a model corresponding to the preset model parameters or a model obtained by offsetting at least one of the second transformation model, the third transformation model and the fourth transformation model, the model corresponding to the preset model parameters and the available transformation model in the time domain.
  • the first determining part 12 is further configured to obtain, for a pixel at any adjacent position of the current block or a pixel at any non-adjacent position of the current block, a second transformation model of the adjacent position of the current block if the pixel satisfies a transformation condition, or obtain a third transformation model corresponding to a pixel at any non-adjacent position of the current block; wherein the transformation condition includes at least one of the following:
  • the block where the pixel is located uses the intra-block copy technology, the transform model flag is valid, and the size of the block where the pixel is located meets the first preset size.
  • the at least one different transformation model includes at least one of the following: at least one transformation model has a different transformation type, has different model parameters, and uses different template areas under the same transformation type.
  • the first determining part 12 is further configured to sequentially add at least one different transformation model to the initial transformation model list to obtain an intermediate transformation model list;
  • the intermediate transformation model list is reordered to obtain the transformation model list.
  • the first determining part 12 is further configured to traverse each transformation model in the intermediate transformation model list to determine the offset value of each transformation model;
  • each of the transformation models respectively predicting the reference block template, and determining the reference block template prediction of each transformation model
  • the transformation models are reordered according to the template error values of the transformation models to obtain the transformation model list.
  • the template error values of the respective transformation models are from small to large, and the index information of the corresponding transformation model list is from small to large.
  • the error value is determined to be a maximum value.
  • the first determining part 12 is further configured to obtain first position information of the current block and a current size of the current block;
  • At least one adjacent position of the current block and at least one non-adjacent position of the current block are determined based on the first position information and the current size.
  • the first determining part 12 is further configured to obtain a historical transformation model to be used in the decoding process
  • the historical transformation model is added to the first order position of the historical transformation model list.
  • the first determination part 12 is further configured to, when the historical transformation model list meets a first preset list length, remove the transformation model in the last sequence position in the historical transformation model list and then add the historical transformation model to the first sequence position of the historical transformation model list.
  • the fourth transformation model is determined sequentially from the historical transformation models in the order of the first sequence bit to the last sequence bit of the historical transformation models.
  • the historical transformation model list is updated based on the historical transformation model.
  • the first prediction part 13 is further configured to use the first transformation model to predict the reference block template of the current block and determine the predicted value of the pixel of the reference block template; determine the total error value between the predicted value of each pixel and the pixel of the current block template; based on the total error value, average each pixel to obtain a first offset value; use the first transformation model to transform the reference block, and compensate the first offset value in the transformation result corresponding to each pixel to obtain the predicted block of the current block; or, use the first offset value to compensate the parameters in the first transformation model to obtain an updated first transformation model, and then use the updated first transformation model to transform the reference block.
  • the first determining part 12 is further configured to determine that the local compensation flag of the current block is a second value when the second syntax element corresponding to the merge candidate block of the current block is predicted using the transform model list;
  • the first prediction part 13 is further configured to adopt the first transformation model and the local compensation transformation model indicated by the local compensation flag to perform secondary transformation on the reference block in sequence to determine the prediction block of the current block.
  • the decoding part 11 is further configured to decode the second syntax element according to the decoded information, wherein the decoded information includes at least one of the following:
  • the size of the current block, the CIIP flag, GPM flag, MBVD flag, skip flag and TM_merge flag of the current block is the size of the current block, the CIIP flag, GPM flag, MBVD flag, skip flag and TM_merge flag of the current block.
  • the decoding part 11 is further configured to decode the second syntax element when the decoded information satisfies a first decoding condition
  • the first decoding condition includes at least one of the following:
  • the value of the CIIP flag bit is a first value
  • the value of the GPM flag is a first value
  • the MBVD flag bit is a first value
  • the skip flag bit is a first value
  • the TM_merge flag bit is a first value
  • the size of the current block is smaller than a third preset size
  • the area of the current block is greater than a first preset area threshold.
  • each transformation model of different transformation types corresponds to a different reference block template area
  • the error value of each transformation model is an average template error value of the number of pixels in the respective reference block template.
  • the decoding part 11 is further configured to decode a fifth syntax element when the value of the third syntax element is the first value and after decoding the second syntax element, when the value of the third syntax element is the second value; the fifth syntax element is used to indicate an index of a local compensation model when using a multi-mode local compensation technology;
  • the first determining part 12 is further configured to determine a sixth transformation model based on the fifth syntax element
  • the first prediction part 13 is further configured to determine a prediction block of the current block based on the reference block and the sixth transformation model.
  • the first determination part 12 is further configured to determine that the local compensation flag of the current block is a first value when the second syntax element corresponding to the merge candidate block of the current block is predicted using the transformation model list.
  • the decoding part 11 is further configured to decode the second syntax element when at least one of the sequence-level syntax elements, frame-level syntax elements, slice-level syntax elements, and the size of the current block meets the second decoding condition.
  • the decoding part 11 is further configured to decode a fifth syntax element when the value of the third syntax element is the second value and after decoding the second syntax element, when the value of the third syntax element is the first value; the fifth syntax element is used to indicate an index of a local compensation model when using a multi-mode local compensation technology;
  • the first determining part 12 is further configured to determine a sixth transformation model based on the fifth syntax element
  • the first prediction part 13 is further configured to determine a prediction block of the current block based on the reference block and the sixth transformation model.
  • the first determination part 12 is further configured to indicate at least one other transformation model in the transformation model list if the fourth syntax element of the transformation model is a third value, wherein the other transformation model is a transformation mode corresponding to other reference blocks.
  • the first determining part 12 is further configured to obtain a derived local compensation model and add the local compensation model to the transformation model list.
  • the first determining part 12 is further configured to determine a reference block of the current block, and perform at least one prediction based on intra-frame block copy technology-intra-frame/inter-frame joint prediction, intra-frame block copy technology-geometric partition mode and intra-frame block copy technology-reconstruction value reordering to obtain a reference prediction block of the reference block;
  • the reference block is updated using the reference prediction block.
  • the first determining part 12 is further configured to recalculate update parameters of the multi-mode local compensation model based on the current block template and the reference block template when the first transformation model is a local compensation model using a multi-mode local compensation technology;
  • the first transformation model is updated.
  • the decoding part 11 is further configured to determine a first context model from at least one context model based on the decoding information of the adjacent blocks;
  • the second syntax element is decoded by using an equal probability decoding method.
  • the decoding part 11 is further configured to include at least one of the following:
  • Decoding the fourth syntax element by using an equal probability decoding method to determine the index information of the transformation model
  • the fourth syntax element is decoded by partially adopting a decoding method of the second context model and partially adopting an equal probability decoding method to determine the index information of the transformation model.
  • the relationship between the first context model for decoding the second syntax element information and the first context model for decoding the second syntax element information when the prediction mode of the current block using the intra-frame block copy technology is the merge mode includes: the same or different.
  • the second context model for decoding the fourth syntax element information when the prediction mode of the current block using the intra-frame block copy technology is the optimized motion vector prediction mode, the second context model for decoding the fourth syntax element information, and when the prediction mode of the current block using the intra-frame block copy technology is the merge mode, the relationship between the second context model for decoding the fourth syntax element information includes: the same or different.
  • the decoding part 11 is further configured to obtain a sixth syntax element of a reference block of the current block, where the sixth syntax element is used to indicate index information of the reference block;
  • the first determining part 12 is further configured to determine, based on the sixth syntax element, a reference block obtained by using the intra block copy technology for the current block.
  • the first determining part 12 is further configured to obtain a second syntax element of a merge candidate block of the current block after determining the reference block obtained by the current block using the intra block copy technology;
  • a first transformation model of the current block is determined.
  • the first determining part 12 is further configured to use the reference transformation model as the first transformation model.
  • the first determining part 12 is further configured to determine a first transformation model type of the reference transformation model
  • the first transform model consistent with the first transform type is re-derived according to the reference block template and the current block template.
  • the first determining part 12 is further configured to obtain a flip reference block flag of the merge candidate block
  • a first transformation model of the current block is determined based on a reference transformation model corresponding to the merged candidate block.
  • the first determining part 12 is further configured to determine the prediction block of the current block based on the reference block when the second syntax element of the current block is a first value, or when the second syntax element of the merge candidate block of the current block is a first value;
  • a fifth transform model of the current block is constructed in the template area or within the block for use in a subsequent decoding process.
  • the first determining part 12 is further configured to determine the reconstructed pixel value of the current block based on the prediction block of the current block after determining the prediction block of the current block based on the reference block and the first transformation model;
  • the seventh transformation model is adopted to update the transformation model list.
  • the first determining part 12 is further configured to obtain pixel values of a first reconstructed region adjacent to the current coding block and pixel values of a second reconstructed region adjacent to the reference block when the first transformation model is a local compensation model;
  • the first prediction part 13 is further configured to transform the reference block using the third transformation model to obtain a prediction block of the current block.
  • the prediction type of the block corresponding to the second transformation model, the third transformation model and the fourth transformation model included in the transformation model list is any one of intra-frame template matching prediction and intra-frame block copy technology.
  • the historical transformation model list is updated based on the first transformation model.
  • each functional unit of the decoder also executes the decoding method described in any one of the aforementioned embodiments.
  • a "unit” may be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course, it may be a module, or it may be non-modular.
  • the components in the present embodiment may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional module.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
  • an embodiment of the present application provides a computer-readable storage medium, which is applied to the decoder 170.
  • the computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the decoding method described in any one of the aforementioned embodiments.
  • the decoder 170 may include: a first communication interface 1801, a first memory 1802 and a first processor 1803; each component is coupled together through a first bus system 1804. It can be understood that the first bus system 1804 is used to achieve connection and communication between these components.
  • the first bus system 1804 also includes a power bus, a control bus and a status signal bus.
  • various buses are labeled as the first bus system 1804 in Figure 14. Among them,
  • the first communication interface 1801 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
  • a first memory 1802 used for storing a computer program that can be run on the first processor 1703;
  • the first processor 1803 is configured to decode a method when running the computer program.
  • the first memory 1802 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories.
  • the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
  • the volatile memory can be a random access memory (RAM), which is used as an external cache.
  • RAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate synchronous DRAM
  • ESDRAM enhanced synchronous DRAM
  • SLDRAM synchronous link DRAM
  • DRRAM direct RAM bus RAM
  • the first processor 1803 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the first processor 1803.
  • the above-mentioned first processor 1803 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • the methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
  • the steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be executed.
  • the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc.
  • the storage medium is located in the first memory 1802, and the first processor 1803 reads the information in the first memory 1802 and completes the steps of the above method in combination with its hardware.
  • the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application or a combination thereof.
  • ASIC Application Specific Integrated Circuits
  • DSP Digital Signal Processing
  • DSP Device digital signal processing devices
  • PLD programmable logic devices
  • FPGA field programmable gate array
  • general processors controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application or a combination thereof.
  • the technology described in this application can be implemented by a module (such as a process, function, etc.) that performs the functions described in this application.
  • the software code can be stored in a memory and executed by a processor.
  • the memory can be implemented in the processor or outside the processor.
  • the first processor 1803 is further configured to execute the decoding method described in any one of the aforementioned embodiments when running the computer program.
  • This embodiment provides a decoder, for which the decoder can select a first transformation model from a transformation model list including at least two types of transformation models; the selected first transformation model is used to transform the reference block, and then the prediction block is determined. Therefore, in the decoding implementation process, the first transformation model used to implement the transformation can be selected and determined from the transformation model list, which can ensure the diversity of selection, thereby making the possibility in the prediction process higher, improving the diversity of prediction, and ultimately improving the decoding performance.
  • FIG. 15 a schematic diagram of the composition structure of an encoder 2 provided in an embodiment of the present application is shown.
  • the encoder 2 comprises:
  • the second determining part 20 is configured to determine a candidate block vector list of the current block; determine a reference block vector based on the candidate block vector list; determine a reference block based on the reference block vector; when determining that the prediction mode of the current block is the intra block copy technology combined with the transformation model list for prediction, obtain a first transformation model from the constructed transformation model list; the constructed transformation model list includes at least two types of transformation models;
  • a second prediction part 21 is configured to determine a prediction block of a current block based on the reference block and the first transformation model
  • the encoding part 22 is configured to encode the relevant syntax elements of the current block, and write the obtained encoding bits into the bitstream through the writing part 23; wherein the relevant syntax elements are used to indicate whether the current block is predicted using the intra-frame block copy technology combined with the transformation model list.
  • the relevant syntax elements include at least: a second syntax element
  • the second syntax element is used to indicate whether the current block is predicted using a transform model list
  • the related syntax elements further include: a first syntax element, and the first syntax element is used to indicate a prediction mode of the current block using an intra-block copy technology.
  • the prediction modes of the intra-block copying technique include: a merge mode and an optimized motion vector prediction mode;
  • the encoding part 22 is further configured to encode the value of the first syntax element as a first value when the prediction mode of the current block using the intra-block copy technology is an optimized motion vector prediction mode, and encode a third syntax element; the third syntax element is used to indicate whether to use the transformation technology for prediction; the third syntax element belongs to the related syntax element;
  • the encoding part 22 is further configured to encode the value of the first syntax element as a second value and encode the second syntax element when the prediction mode of the current block using the intra-block copy technology is a merge mode.
  • the encoding part 22 is further configured as
  • the second syntax element is encoded as a second value
  • the index information of the first transformation model in the transformation model list is encoded as a fourth syntax element
  • the fourth syntax element is used to indicate the model index of the transformation model in the transformation model list
  • the related syntax element information also includes: the fourth syntax element.
  • the second determining part 20 is further configured to construct the transformation model list when the current block is predicted using the transformation model list.
  • the second determining part 20 is further configured to sequentially add at least one different transformation model to the initial transformation model list to obtain the transformation model list;
  • the at least one transformation model includes at least one of the following:
  • a third transformation model corresponding to pixels at at least one non-adjacent position of the current block
  • the preset transformation model includes: a model corresponding to the preset model parameters or a model obtained by offsetting at least one of the second transformation model, the third transformation model and the fourth transformation model, the model corresponding to the preset model parameters and the available transformation model in the time domain.
  • the second determining part 20 is further configured to obtain, for a pixel at any adjacent position of the current block or a pixel at any non-adjacent position of the current block, a second transformation model of the adjacent position of the current block if the pixel satisfies a transformation condition, or obtain a third transformation model corresponding to a pixel at any non-adjacent position of the current block; wherein the transformation condition includes at least one of the following:
  • the block where the pixel is located uses the intra-block copy technology, the transform model flag is valid, and the size of the block where the pixel is located meets the first preset size.
  • the at least one different transformation model includes at least one of the following: at least one transformation model has a different transformation type, has different model parameters, and uses different template areas under the same transformation type.
  • the second determining part 20 is further configured to sequentially add at least one different transformation model to the initial transformation model list to obtain an intermediate transformation model list;
  • the intermediate transformation model list is reordered to obtain the transformation model list.
  • the second determining part 20 is further configured to traverse each transformation model in the intermediate transformation model list to determine the offset value of each transformation model;
  • each of the transformation models respectively predicting the reference block template, and determining the reference block template prediction of each transformation model
  • the transformation models are reordered according to the template error values of the transformation models to obtain the transformation model list.
  • the template error values of the respective transformation models are from small to large, and the index information of the corresponding transformation model list is from small to large.
  • the error value is determined to be a maximum value.
  • the second determining part 20 is further configured to obtain first position information of the current block and a current size of the current block;
  • At least one adjacent position of the current block and at least one non-adjacent position of the current block are determined based on the first position information and the current size.
  • the second determining part 20 is further configured to obtain a historical transformation model to be used in the encoding process
  • the historical transformation model is added to the first order position of the historical transformation model list.
  • the second determination part 20 is further configured to, when the historical transformation model list meets a first preset list length, remove the transformation model in the last sequence position in the historical transformation model list and then add the historical transformation model to the first sequence position of the historical transformation model list.
  • the fourth transformation model is determined sequentially from the historical transformation models in the order of the first sequence bit to the last sequence bit of the historical transformation models.
  • the second determining part 20 is further configured to update the historical transformation model list based on the historical transformation model when the size of the block corresponding to the historical transformation model to be added meets a second preset size.
  • the second prediction part 21 is further configured to use the first transformation model to predict the reference block template of the current block to determine the predicted value of the pixel of the reference block template;
  • the reference block is transformed by using the first transformation model, and the first offset value is compensated in the transformation result corresponding to each pixel to obtain a prediction block of the current block; or, the parameters in the first transformation model are compensated by using the first offset value to obtain an updated first transformation model, and then the updated first transformation model is used to transform the reference block.
  • the second determining part 20 is further configured to determine that the local compensation flag of the current block is a second value when the second syntax element corresponding to the merge candidate block of the current block is predicted using the transform model list;
  • the second prediction part 21 is further configured to adopt the first transformation model and the local compensation transformation model indicated by the local compensation flag to perform secondary transformation on the reference block in sequence to determine the prediction block of the current block.
  • the encoding part 22 is further configured to encode the second syntax element according to the encoded information, wherein the encoded information includes at least one of the following:
  • the size of the current block, the CIIP flag, GPM flag, MBVD flag, skip flag and TM_merge flag of the current block is the size of the current block, the CIIP flag, GPM flag, MBVD flag, skip flag and TM_merge flag of the current block.
  • encoding the second syntax element according to the encoded information includes:
  • the first encoding condition includes at least one of the following:
  • the value of the CIIP flag bit is a first value
  • the value of the GPM flag is a first value
  • the MBVD flag bit is a first value
  • the skip flag bit is a first value
  • the TM_merge flag bit is a first value
  • the size of the current block is smaller than a third preset size
  • the area of the current block is greater than a first preset area threshold.
  • each transformation model of different transformation types corresponds to a different reference block template area
  • the error value of each transformation model is an average template error value of the number of pixels in the respective reference block template.
  • the encoding part 22 is further configured to determine a sixth transform model when the current block is predicted using a transform technique and a non-transform model list;
  • the second prediction part 21 is further configured to determine a prediction block of the current block based on the reference block and the sixth transformation model;
  • the encoding part 22 is further configured to encode the third syntax element as the first value or the second value, and encode the fifth syntax element; the fifth syntax element is used to indicate the index of the local compensation model when using the multi-mode local compensation technology.
  • the local compensation flag of the current block is determined to be a first value.
  • the encoding part 22 is further configured to encode the second syntax element when at least one of the sequence-level syntax elements, frame-level syntax elements, slice-level syntax elements, and the size of the current block meets the second encoding condition.
  • the fourth syntax element is encoded as a third value, wherein the other transformation model is a transformation mode corresponding to other reference blocks.
  • the second determining part 20 is further configured to obtain a derived local compensation model and add the local compensation model to the transformation model list.
  • the second determining part 20 is further configured to determine the reference block of the current block, and perform at least one prediction based on the intra-frame block copy technology-intra-frame/inter-frame joint prediction, the intra-frame block copy technology-geometric partition mode and the intra-frame block copy technology-reconstruction value reordering to obtain a reference prediction block of the reference block;
  • the reference block is updated using the reference prediction block.
  • the second determining part 20 is further configured to recalculate update parameters of the multi-mode local compensation model based on the current block template and the reference block template when the first transformation model is a local compensation model using a multi-mode local compensation technology;
  • the first transformation model is updated.
  • the encoding part 22 is further configured to determine a first context model from at least one context model according to encoding information of adjacent blocks;
  • the second syntax element is encoded by adopting an equal probability encoding method.
  • the encoding part 22 is further configured to include at least one of the following:
  • the index information of the first transformation model in the transformation model list is encoded as a fourth syntax element by partially adopting the encoding method of the second context model and partially adopting the equal probability encoding method.
  • the relationship between the first context model for encoding the second syntax element information includes: the same or different.
  • the relationship between the second context model for encoding the fourth syntax element information includes: the same or different.
  • index information of a reference block is determined, and the index information of the reference block is encoded as a sixth syntax element, where the sixth syntax element is used to indicate the index information of the reference block.
  • the second determining part 20 is further configured to obtain a second syntax element of the reference block after determining the reference block based on the reference block vector;
  • a first transformation model of the current block is determined.
  • the second determining part 20 is further configured to use the reference transformation model as the first transformation model.
  • the second determining part 20 is further configured to determine a first transformation model type of the reference transformation model
  • the first transform model consistent with the first transform type is re-derived according to the reference block template and the current block template.
  • the second determining part 20 is further configured to obtain a flip reference block flag of the merge candidate block
  • a first transformation model of the current block is determined based on a reference transformation model corresponding to the merged candidate block.
  • the second determining part 20 is further configured to determine the prediction block of the current block based on the reference block when the second syntax element of the current block is a first value, or when the second syntax element of the merge candidate block of the current block is a first value;
  • a fifth transform model of the current block is constructed in the template area or within the block for use in a subsequent encoding process.
  • the second determining part 20 is further configured to determine the reconstructed pixel value of the current block based on the prediction block of the current block after determining the prediction block of the current block based on the reference block and the first transformation model;
  • the seventh transformation model is adopted to update the transformation model list.
  • the second determining part 20 is further configured to obtain pixel values of a first reconstructed region adjacent to the current coding block and pixel values of a second reconstructed region adjacent to the reference block when the first transformation model is a local compensation model;
  • the reference block is transformed using the third transformation model to obtain a prediction block of the current block.
  • the prediction type of the block corresponding to the second transformation model, the third transformation model and the fourth transformation model included in the transformation model list is any one of intra-frame template matching prediction and intra-frame block copy technology.
  • the second determining part 20 is further configured to update the historical transformation model list based on the first transformation model.
  • the encoding part 22 is further configured to encode the first syntax element as a first value when it is determined that the prediction mode of the current block is predicted using a non-intra block copy technology.
  • each functional unit of the encoder also executes the encoding method described in any one of the aforementioned embodiments.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • this embodiment provides a computer-readable storage medium, which is applied to the encoder 190, and the computer-readable storage medium stores a computer program. When the computer program is executed by the second processor, the encoding method described in any one of the above embodiments is implemented.
  • the encoder 190 may include: a second communication interface 2001, a second memory 2002 and a second processor 2003; each component is coupled together through a second bus system 2004. It can be understood that the second bus system 2004 is used to achieve connection and communication between these components.
  • the second bus system 2004 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as the second bus system 2004 in Figure 16. Among them,
  • the second communication interface 2001 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
  • the second memory 2002 is used to store a computer program that can be run on the second processor 2003;
  • the second processor 2003 is configured to execute the encoding method when running the computer program.
  • the second processor 2003 is further configured to execute the encoding method described in any one of the aforementioned embodiments when running the computer program.
  • This embodiment provides an encoder, for which the encoder can select a first transformation model from a transformation model list including at least two types of transformation models; the selected first transformation model is used to transform the reference block, and then the prediction block is determined. Therefore, in the process of encoding implementation, the first transformation model used to implement the transformation can be selected and determined from the transformation model list, which can ensure the diversity of selection, thereby making the possibility in the prediction process higher, improving the diversity of prediction, and ultimately improving the encoding performance.
  • the embodiment of the present application provides a coding and decoding method, a bit stream, an encoder, a decoder and a storage medium.
  • the decoder or the encoder can select a first transformation model from a transformation model list including at least two types of transformation models; the selected first transformation model is used to transform the reference block, and then the prediction block is determined. Therefore, in the process of coding and decoding implementation, the first transformation model used to implement the transformation can be selected and determined from the transformation model list, which can ensure the diversity of selection, thereby making the possibility in the prediction process higher, improving the diversity of prediction, and ultimately improving the coding and decoding performance.

Landscapes

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

Abstract

本申请实施例公开了一种编解码方法、码流、编码器、解码器以及存储介质,获取当前块的相关语法元素;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测;确定当前块使用所述帧内块复制技术得到的参考块;根据所述相关语法元素,确定基于构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;基于所述参考块和所述第一变换模型,确定当前块的预测块。

Description

编解码方法、码流、编码器、解码器以及存储介质 技术领域
本申请涉及视频编解码技术领域,尤其涉及一种编解码方法、码流、编码器、解码器以及存储介质。
背景技术
帧内块复制(Intra Block Copy,IBC)技术,是一种基于块匹配来获得预测像素的帧内预测技术。类似帧间预测,通过由当前块指向参考块的块向量实现预测,区别在于帧间预测的参考块来自于已编码的重建帧,而IBC的参考块来自于当前帧的已重建部分。局部光照补偿(Local Illumination Compensation,LIC)技术,是一种块级的线性变换技术。LIC方法表征当前编码块和参考块之前存在线性关系。
现有技术中,IBC技术可以通过块补偿的方式,从当前帧内确定参考块。在这基础上,IBC技术可以结合LIC技术,对参考块进行线性变换,确定预测块,以此提升预测的准确性。
然而,LIC技术中的线性变换参数由当前块、参考块相邻的重建像素推导得到,不能提供多样化的参数选择,存在局限性,影响编解码性能。
发明内容
本申请提供一种编解码方法、码流、编码器、解码器以及存储介质,能够提高预测的多样性,进而提升编解码性能。
本申请的技术方案可以如下实现:
第一方面,本申请实施例提供了一种解码方法,应用于解码器,该方法包括:
获取当前块的相关语法元素;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测;
确定当前块使用所述帧内块复制技术得到的参考块;
根据所述相关语法元素,确定基于构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;
基于所述参考块和所述第一变换模型,确定当前块的预测块。
第二方面,本申请实施例提供了一种编码方法,应用于编码器,该方法包括:
确定当前块的候选块向量列表;
基于所述候选块向量列表,确定参考块向量;
基于所述参考块向量,确定参考块;
在确定当前块的预测模式为帧内块复制技术结合变换模型列表进行预测时,从构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;
基于所述参考块和所述第一变换模型,确定当前块的预测块;
编码当前块的相关语法元素,将所得到的编码比特写入码流;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测。
第三方面,本申请实施例提供了一种码流,该码流是根据待编码信息进行比特编码生成的;其中,待编码信息包括下述至少一项:
第一语法元素、第二语法元素、第三语法元素、第四语法元素、第五语法元素、第六语法元素、当前块的尺寸、当前块的CIIP标志位、GPM标志位、MBVD标志位和skip标志位、上下文模型;其中,
所述第一语法元素用于用于指示当前块使用帧内块复制技术的预测模式;
所述第二语法元素用于指示当前块是否使用变换模型列表进行预测;
所述第三语法元素用于指示是否使用变换技术进行预测;
所述第四语法元素用于指示变换模型在所述变换模型列表中的模型索引;
所述第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引;
所述第六语法元素用于指示参考块的索引信息。
第四方面,本申请实施例提供了一种解码器,包括:
解码部分,被配置为获取当前块的相关语法元素;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测;
第一确定部分,被配置为确定当前块使用所述帧内块复制技术得到的参考块;
根据所述相关语法元素,确定基于构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;
第一预测部分,被配置为基于所述参考块和所述第一变换模型,确定当前块的预测块。
第五方面,本申请实施例提供了一种解码器,包括第一存储器和第一处理器;其中:
第一存储器,用于存储能够在第一处理器上运行的计算机程序;
第一处理器,用于在运行计算机程序时,执行如第一方面所述的解码方法。
第六方面,本申请实施例提供了一种编码器,包括:
第二确定部分,被配置为确定当前块的候选块向量列表;基于所述候选块向量列表,确定参考块向量;基于所述参考块向量,确定参考块;在确定当前块的预测模式为帧内块复制技术结合变换模型列表进行预测时,从构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;
第二预测部分,被配置为基于所述参考块和所述第一变换模型,确定当前块的预测块;
编码部分,被配置为编码当前块的相关语法元素,通过写入部分将所得到的编码比特写入码流;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测。
第七方面,本申请实施例提供了一种编码器,包括第二存储器和第二处理器;其中:
第二存储器,用于存储能够在第二处理器上运行的计算机程序;
第二处理器,用于在运行计算机程序时,执行如第二方面所述的编码方法。
第八方面,本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现如第一方面所述的解码方法、或者被第二处理器执行时实现如第二方面所述的编码方法。
本申请实施例提供了一种编解码方法、码流、编码器、解码器以及存储介质,解码器或编码器可以从包括至少两种类型的变换模型的变换模型列表中,去选择第一变换模型;采用选中的第一变换模型来进行对参考块的变换,进而确定出预测块。因此,在编解码实现的过程中,用于实现变换的第一变换模型是可以从变换模型列表中进行选择确定的,可以保证选择的多样性,从而使得在预测的过程的可能性变高,提高了预测的多样性,最终可以提升编解码性能。
附图说明
图1为一种Intra TMP技术的预测过程示意图;
图2为一种Intra TMP技术的匹配块示意图;
图3为一种Intra TMP技术的模板类型示意图;
图4A为一种Intra TMP技术中模板匹配的粗搜索过程示意图;
图4B为一种Intra TMP技术中模板匹配的细搜索过程示意图;
图5为一种IntraTMP融合预测技术的加权融合示意图;
图6A为一种滤波器形状示意图;
图6B为一种滤波器系数推导方法示意图;
图7为一种编码块垂直和水平划分方式示意图;
图8为位置的示意图;
图9A为本申请实施例提供的一种编码器的组成框图示意图;
图9B为本申请实施例提供的一种解码器的组成框图示意图;
图10为本申请实施例提供的一种编解码系统的网络架构示意图;
图11为本申请实施例提供的一种解码方法的流程示意图;
图12为本申请实施例提供的一种编码方法的流程示意图;
图13为本申请实施例提供的一种解码器的组成结构示意图;
图14为本申请实施例提供的一种解码器的具体硬件结构示意图;
图15为本申请实施例提供的一种编码器的组成结构示意图;
图16为本申请实施例提供的一种编码器的具体硬件结构示意图。
具体实施方式
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。还需要指出,本申请实施例所涉及的术语“第一\第二\第三”仅是用于区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。
对本申请实施例进行进一步详细说明之前,先对本申请实施例中涉及的名词和术语进行说明,本申请实施例中涉及的名词和术语适用于如下的解释:
编码块(Coding Block,CB);
块匹配(Block Matching,BM);
编码单元(Coding Unit,CU);
编码树单元(Coding Tree Unit,CTU);
块矢量(Block Vector,BV);
绝对误差和(Sum of Absolute Difference,SAD);
绝对变换差和(Sum of Absolute Transformed Difference,SATD);
均方误差(Mean Square Error,MSE);
最可能模式(Most Probable Mode,MPM);
平均绝对差(Mean Absolute Deviation,MAD);
序列参数集(Sequence Parameter Set,SPS);
调色板(Palette,PLT);
率失真代价(Rate Distortion Optimization,RDO);
增强压缩的参考软件测试平台(Enhanced Compression Model,ECM);
联合视频专家组(Joint Video Experts Team,JVET);
帧内模板匹配预测(Intra Template Matching Prediction,Intra TMP);
块差分脉冲编码调制(Block Differential Pulse Coded Modulation,BDPCM);
帧内块复制(Intra Block Copy,IBC);
局部光照补偿(Local Illumination Compensation,LIC);
跨分量合并(Cross Component Merge,CCMerge)。
可以理解,在视频图像中,一般采用第一颜色分量、第二颜色分量和第三颜色分量来表征编码块。其中,这三个颜色分量分别为一个亮度分量、一个蓝色色度分量和一个红色色度分量,具体地,亮度分量通常使用符号Y表示,蓝色色度分量通常使用符号Cb或者U表示,红色色度分量通常使用符号Cr或者V表示;这样,视频图像可以用YCbCr格式表示,也可以用YUV格式表示。
1)IntraTMP)技术
Intra TMP技术是一种特殊的帧内预测技术,简称IntraTMP技术,是一种特殊的帧内预测编码工具,主要应用于屏幕内容编码。IntraTMP主要通过以下流程实现:选择当前编码块邻近的部分已重建像素作为模板,在给定的当前帧已重建区域中搜索最相似的模板,将最相似模板对应的重建块作为匹配块,用作当前编码块的预测块。其中编码块的模板通常选用当前编码块的相邻重建区域。
示例性地,以当前块的相邻重建区域为例,如图1所示,用网格填充的区域表示已重建区域,在已重建区域中R1、R2、R3和R4为搜索区域,R1至R4依次搜索寻找匹配块,当前块的相邻区域为第一模板(T);且匹配块(也可以称为“参考块”)的相邻区域为第二模板(即“参考块模板”或称为“匹配模板”,T_BEST)。如图2所示,编码器和解码器皆通过编码块的模板(T)在当前图像中预定义的搜索范围搜索,确定模板误差值最小的匹配模板(T_BEST),然后将匹配模板相应的重建块(Ref Block)作为当前编码块(Cur Block)的预测块。模板间的相似程度由模板误差值的大小表示,模板误差值越小则相似程度越高。在本申请实施例中,模板误差值可以是绝对误差和SAD、绝对变换差和SATD、均方误差MSE、误差平方和SSD、平均绝对差MAD、平均误差平方和MSD、归一化相关系数NCC等,这里不作具体限定。
示例性地,以绝对误差和SAD为例,这时候的模板误差值如下所示:
其中,Ti为搜索过程中的模板,M表示模板中的像素数。
需要说明的是,Intra TMP技术利用当前块的相邻已重建像素作为模板在预定义搜索区域内搜索匹配模板,其中相邻已重建像素可以是当前块的上侧参考像素、左上侧参考像素、右上侧参考像素、左侧参考像素和左下侧参考像素等等,因此,根据相邻已重建像素的可用与否能够对模板类型进行分类并确定对应的模板类型。
还需要说明的是,可以用refTemplateType表示模板类型,图3示出了一种Intra TMP技术的模板类型示意图。如图3所示,用网格填充的块为当前块,且当前块的相邻区域为模板T,这里示出了六种模板类型。
示例性地,这六种模板类型如下所示:
当左上侧参考像素、上侧参考像素和左侧参考像素均可用时,refTemplateType的值为1,模板形状如图3中的(a)所示;
当只有左侧参考像素可用时,refTemplateType的值为2,模板形状如图3中的(b)所示;
当只有上侧参考像素可用时,refTemplateType的值为3,模板形状如图3中的(c)所示;
当只有左侧参考像素和左上侧参考像素可用时,refTemplateType的值为4,模板形状如图3中的(d)所示;
当只有左侧参考像素和左下侧参考像素可用时,refTemplateType的值为5,模板形状如图3中的(e)所示;
当只有上侧参考像素和右上侧参考像素可用时,refTemplateType的值为6,模板形状如图3中的(f)所示。
Intra TMP技术中编解码器通过标志位intra_tmp_flag表示当前编码块是否使用IntraTMP模式编码。若是则在解码端进行同样的模板匹配过程以在解码端获得同样的预测块,不需要额外编码当前编码块到匹配块的块向量信息。下面对Intra TMP技术进行举例说明。
2)针对摄像机捕获内容的IntraTMP适应技术
针对摄像机捕获内容的IntraTMP适应(IntraTMP adaption for camera-captured content)技术在原有IntraTMP技术的基础上,提出以步长S(即水平、垂直方向每隔S点,S>1)进行模板匹配(如图4A),比如在搜索区域,不是按raster scan逐点寻找匹配块,而是在搜索区域水平、垂直方向隔点搜索。例如,当前进行模板匹配的块向量是(X0,Y0),则下一个进行模板匹配的块向量应为(X0+S,Y0),下行进行模板匹配的块向量纵坐标应为Y0+S。完成模板匹配后,在一定范围内对最佳的匹配块进行精炼(如图4B,以更小步长S’进行模板匹配),以优化匹配结果。该技术在保持较好编码效率的同时有效降低IntraTMP模式的复杂度。
3)IntraTMP多候选技术
IntraTMP多候选技术通过模板匹配过程在参考区域内获取N个候选匹配块,或者说构建一个长度为N的候选块列表,列表内候选匹配块可以根据与当前块之间的模板误差值大小排序。通过索引选中列表中某一候选块作为最终的预测块。对使用IntraTMP多候选技术的编码块,在解码IntraTMP标志位intra_tmp_flag为真后,继续解码intra_tmp_idx,该intra_tmp_idx语法元素可以表示选中候选块的索引。
intra_tmp_flag
if(intra_tmp_flag)
{
intra_tmp_idx
}
示例性的,一种用于构建候选块列表的模板匹配过程如下:
第一步,以一定步长进行第一遍搜索,例如水平步长、竖直步长均为4。得到N个有一定间距的最优匹配块(模板误差值最小的前N个);
第二步,在第一步得到的N个匹配块邻近区域进行第二遍搜索,这些邻近区域可以根据第一步中的步长设置为不重叠的多个区域。从这些区域中得到M个最优的匹配块(可以包含第一步中得到的匹配块)。
在编码端和解码端使用同样的构建过程,得到一致的候选块列表。
Intra_tmp_idx可以使用定长编码或变长编码,例如,使用截断二进制(truncated binary)编码。
一种变长编码方式为:
索引越小(intra_tmp_idx值越小),对应候选块的模板误差值越小,统计上被选中的概率越大。可以为越小的intra_tmp_idx设置越短的码字。例如表1所示:
表1
若intra_tmp_idx的最大值N较大,可以为较大的intra_tmp_idx分配相同长度的码字。例如,N为15。如表2所示:
表2
上表2中x可以用truncated binary得到。
4)IntraTMP融合预测技术,也称IntraTMP多匹配块融合技术
通过帧内模板匹配,可以得到不同位置下重建块与当前编码块的模板误差值,这些重建块可以由当前编码块指向重建块的块向量表示;构建候选块向量列表用于记录模板匹配过程中模板误差值更小的块向量;根据块向量间距、模板误差值等条件从候选块向量列表中选择一个或以上的块向量,其指向的重建块作为当前编码块的匹配块;为每一个匹配块确定权重值;将这些匹配块根据其权重值进行加权融合,得到最终的预测块,实现IntraTMP组合融合预测。过程如图5A和图5B所示。
待融合匹配块的数量可以为固定数值,也可以根据各匹配块模板误差值的大小关系确定。例如,对可用的N个匹配块,设置阈值Threshold=minSAD<<1,minSAD为这些匹配块的模板误差值中的最小值。只有模板误差值小于等于该阈值的匹配块才被用于融合过程。通过该方法可以确定用于融合的匹配块。
确定好用于融合的匹配块后,可以使用预设的固定值、根据模板误差值计算和根据模板推导等方式确定各匹配块的权重。
5)IntraTMP滤波
由帧内模板匹配得到的匹配块(也可以称作参考块),通常直接用作当前块的预测块。可以对预测块进行滤波以改善预测效果。可以用一个块级的标志位来指示当前块是否对预测块使用所述滤波处理。
滤波器的形式可以有多种,一种可能的滤波器形式如下公式(2):
PredC=c0C+c1N+c2S+c3E+c4W+c5B        (2)
其中C为待滤波像素,N为其上侧的像素,S为其下侧的像素,W为其左侧的像素,E为其右侧的像素,如图6A所示。B(Bias)是一个固定值,例如B是像素范围的中值。c0至c5是滤波器系数。
一种确定滤波器系数的方法是使用参考块模板和当前块模板训练滤波器的系数。例如,模板区域为当前块上侧4行及左侧4列的重建区域。对参考块,还需要模板区域上下左右侧额外一行的区域作为参考。如图6B所示,若部分的额外区域未完成编码,可以从模板区域中复制。
一种训练滤波器系数的方法是计算一组系数使得滤波后的参考块模板和当前块模板的模板误差值最小。
如果当前块使用IntraTMP滤波,对根据参考块直接得到的预测块进行滤波,一种方法是按从左到右从上到下的顺序依次对每一个像素进行滤波。将滤波后的值作为预测值。
6)模板推导的IntraTMP融合
IntraTMP融合预测可以通过帧内模板匹配过程得到多个参考块,并对这些参考块进行加权融合。权重值通常使用预定义的固定值或根据各参考块模板误差计算得到。例如,参考块的模板误差值分别为SAD1至SADn,一种权重的计算方式为公式(3)、(4)和(5):
SADi=(SADi==0)?1:SADi        (3)

Wi=(SUM-SADi)/((n-1)*SUM)          (5)
其中,n为参考块总数,Wi为模板误差值为SADi的参考块所对应的权重值。加权融合后预测块的形式可以如公式(6):
模板推导的IntraTMP融合方法使用类似滤波器系数训练的方法,根据各参考块模板和当前块模板训练得到用于融合预测的权重。例如,使用5个参考块进行加权融合,形式如公式(7)所示:
一种权重的方法是计算一组系数使得参考块模板融合后和当前块模板的模板误差值最小。
7)基于模板的帧内模式推导技术
基于模板的帧内模式推导(Template-Based Intra Mode Derivation,TIMD)技术,将当前编码块邻近的L型部分已重建像素作为模板,通过遍历MPM列表,计算不同帧内预测模式下模板区域的预测像素的方式,得到不同帧内预测模式下预测像素和重建像素的模板误差值,由绝对变换误差和(Sum of Absolute Transformed Difference,SATD)表示。根据模板误差值选出最优的帧内预测模式。在解码端,通过相同的推导方式得到帧内预测模式,从而降低模式信息的编码比特。
8)联合帧内帧间预测技术
联合帧内帧间预测(Combined Inter and Intra Prediction,CIIP)技术,通过联合帧内预测和帧间预测,利用帧内预测块和帧间预测块的加权组合得到当前编码块的预测块。ECM中CIIP与基于模板的预测技术相结合,同时对不同区域赋予不同权重值,进一步提升了预测的准确性。具体地,其帧内预测块pred_intra由TIMD模式得到,帧间预测块pred_inter由基于模板的Merge模式得到。根据推导的帧内预测模式以及待预测像素的位置,确定权重值wIntra、wInter。最终的预测块Pred计算如公式(8):
Pred=(wIntra*pred_intra+wInter*pred_inter+4)>>3      (8)
其中,wIntra和wInter根据TIMD推导得到的帧内预测模式intra_dir决定。ECM中有65种帧内角度预测模式(2≤intra_dir<=66),当2≤intra_dir<34时,将当前编码块垂直四等分;当34<=intra_dir<=66时,将当前编码块水平四等分。各区域的权重值wIntra和wInter为表3所示:
表3
垂直或水平四等分下,各区域的索引如图7所示。特别地,当intra_dir等于0或1时,不划分子区域,wIntra和wInter根据位于左侧和位于上侧的两个编码块的编码类型(帧内还是帧间),从(3,1),(2,2),(1,3)中选择。
9)帧内块复制技术
帧内块复制(Intra Block Copy,IBC)技术,是一种基于块匹配来获得预测像素的帧内预测技术。类似帧间预测,通过由当前块指向参考块的块向量实现预测,区别在于帧间预测的参考块来自于已编码的重建帧,而IBC的参考块来自于当前帧的已重建部分。块向量信息需要由码流传输,因而与帧内预测类似,存在IBC-AMVP模式和IBC-Merge模式。
IBC-AMVP模式通过构建的候选块向量列表得到预测块向量,基于预测块向量,通过哈希搜索、全搜索等过程得到当前块的参考块和对应的最终块向量。根据预测块向量对最终块向量编码,提升编码效率。
IBC-Merge模式通过构建的候选块向量列表进行预测,通过SATD、RDO等编码过程选择出列表中最佳的块向量作为最终块向量,其指向的重建块作为参考块,完成预测。编码该块向量在列表中的索引而非块向量本身,提升编码效率。
候选块向量列表可以由相邻编码块的块向量、历史编码的块向量、平均块向量等编码信息组成。
候选块向量列表可以包含局部光照补偿LIC标志位等信息,若某一候选的LIC标志位为真,则当前块选择该候选块向量时,将当前块的LIC标志位置为真。
10)局部光照补偿技术
局部光照补偿技术,是一种块级的线性变换技术。LIC方法认为当前编码块和参考块之前存在线性关系,可以表示为公式(9):
Pred=α·ref+β          (9)
其中,α和β可以由当前编码块相邻的已重建区域像素和参考块相邻的已重建区域像素推导,通过最小二乘法等方法得到。
此外,可以设定阈值threshold,根据参考块像素和阈值间的大小关系选择不同的线性参数,表示为公式(10):
11)Inter-Merge的非相邻候选
Merge模式的帧间编码块在构建Merge List时可以添加非相邻候选,根据当前块大小选择各个非相邻点并尝试构建merge候选。非相邻点和当前块的像素位置如图8所示,图8中标号1-5处称为相邻位置的候选,其余处称为非相邻位置的候选。
12)多模式的IBC-LIC技术:
多模式的IBC-LIC技术根据推导线性参数所使用的模板区域以及线性变换模型的个数,将IBC-LIC方法又分为多种子方法。一种示例是,将IBC-LIC分为以下四种方法:
1、使用L型模板区域、单个模型;
2、使用左侧模板区域、单个模型;
3、使用右侧模板区域、单个模型;
4、使用L型模板区域、两个模型(根据阈值选择不同模型进行线性变换)。
在本申请中,可以通过编码索引的方式选择特定的IBC-LIC子方法。
然而,IBC技术可以通过块补偿的方式,从当前帧内得到参考块。在这基础上,IBC技术可以结合LIC技术,对参考块进行线性变换,从而提升预测的准确性。LIC技术的一个局限是其线性变换参数由当前块、参考块相邻的重建像素推导得到,不能提供多样化的参数选择。
本申请提出基于已编码块所使用的变换模型,为当前编码块构建变换模型候选列表的方法,能够提升预测的多样性。通过编码端决策选择当前编码块最优的变换模型,从而提升编码效率。
参见图9A,其示出了本申请实施例提供的一种编码器的组成框图示意图。如图9A所示,编码器(具体为“视频编码器”)100可以包括变换与量化单元101、帧内估计单元102、帧内预测单元103、运动补偿单元104、运动估计单元105、反变换与反量化单元106、滤波器控制分析单元107、滤波单元108、编码单元109和解码图像缓存单元110等,其中,滤波单元108可以实现去方块滤波及样本自适应缩进(Sample Adaptive 0ffset,SAO)滤波,编码单元109可以实现头信息编码及基于上下文的自适应二进制算术编码(Context-based Adaptive Binary Arithmetic Coding,CABAC)。针对输入的原始视频信号,通过编码树单元(Coding Tree Unit,CTU)的划分可以得到一个视频编码块,然后对经过帧内或帧间预测后得到的残差像素信息通过变换与量化单元101对该视频编码块进行变换,包括将残差信息从像素域变换到变换域,并对所得的变换系数进行量化,用以进一步减少比特率;帧内估计单元102和帧内预测单元103是用于对该视频编码块进行帧内预测;明确地说,帧内估计单元102和帧内预测单元103用于确定待用以编码该视频编码块的帧内预测模式;运动补偿单元104和运动估计单元105用于执行所接收的视频编码块相对于一或多个参考帧中的一或多个块的帧间预测编码以提供时间预测信息;由运动估计单元105执行的运动估计为产生运动向量的过程,所述运动向量可以估计该视频编码块的运动,然后由运动补偿单元104基于由运动估计单元105所确定的运动向量执行运动补偿;在确定帧内预测模式之后,帧内预测单元103还用于将所选择的帧内预测数据提供到编码单元109,而且运动估计单元105将所计算确定的运动向量数据也发送到编码单元109;此外,反变换与反量化单元106是用于该视频编码块的重构建,在像素域中重构建残差块,该重构建残差块通过滤波器控制分析单元107和滤波单元108去除方块效应伪影,然后将该重构残差块添加到解码图像缓存单元110的帧中的一个预测性块,用以产生经重构建的视频编码块;编码单元109是用于编码各种编码参数及量化后的变换系数,在基于CABAC的编码算法中,上下文内容可基于相邻编码块,可用于编码指示所确定的帧内预测模式的信息,输出该视频信号的码流;而解码图像缓存单元110是用于存放重构建的视频编码块,用于预测参考。随着视频图像编码的进行,会不断生成新的重构建的视频编码块,这些重构建的视频编码块都会被存放在解码图像缓存单元110中。
参见图9B,其示出了本申请实施例提供的一种解码器的组成框图示意图。如图9B所示,解码器(具体为“视频解码器”)200包括解码单元201、反变换与反量化单元202、帧内预测单元203、运动补偿单元204、滤波单元205和解码图像缓存单元206等,其中,解码单元201可以实现头信息解码以及CABAC解码,滤波单元205可以实现去方块滤波以及SAO滤波。输入的视频信号经过图8A的编码处理之后,输出该视频信号的码流;该码流输入解码器200中,首先经过解码单元201,用于得到解码后的变换系数;针对该变换系数通过反变换与反量化单元202进行处理,以便在像素域中产生残差块;帧内预测单元203可用于基于所确定的帧内预测模式和来自当前帧或图片的先前经解码块的数据而产生当前视频解码块的预测数据;运动补偿单元204是通过剖析运动向量和其他关联语法元素来确定用于视频解码块的预测信息,并使用该预测信息以产生正被解码的视频解码块的预测性块;通过对来自反变换与反量化单元202的残差块与由帧内预测单元203或运动补偿单元204产生的对应预测性块进行求和,而形成解码的视频块;该解码的视频信号通过滤波单元205以便去除方块效应伪影,可以改善视频质量;然后将经解码的视频块存储于解码图像缓存单元206中,解码图像缓存单元206存储用于后续帧内预测或运动补偿的参考图像,同时也用于视频信号的输出,即得到了所恢复的原始视频信号。
进一步地,本申请实施例还提供了一种包含编码器和解码器的编解码系统的网络架构,其中,图10示出了本申请实施例提供的一种编解码系统的网络架构示意图。如图10所示,该网络架构包括一个或多个电子设备13至1N和通信网络01,其中,电子设备13至1N可以通过通信网络01进行视频交互。电子设备在实施的过程中可以为各种类型的具有视频编解码功能的设备,例如,所述电子设备可以包括智能手机、平板电脑、个人计算机、个人数字助理、导航仪、数字电话、视频电话、电视机、传感设备、服务器等,这里不作具体限定。另外,本申请实施例所述的解码器或编码器就可以为上述电子设备。
需要说明的是,本申请实施例的方法主要应用在如图9A所示的阵内估计单元102部分和帧内预测单元103部分和如图9B所示的帧内预测单元203部分。也就是说,本申请实施例既可以应用于编码器,也可以应用于解码器,甚至还可以同时应用于编码器和解码器,但是本申请实施例不作具体限定。
还需要说明的是,当应用于帧内预测单元103部分时,“当前块”具体是指当前待进行帧内预测的编码块;当应用于帧内预测单元203部分时,“当前块”具体是指当前待进行帧内预测的解码块。
在本申请的一实施例中,参见图11,其示出了本申请实施例提供的一种解码方法的流程示意图。如图11所示,该方法可以包括:
S101、获取当前块的相关语法元素;其中,相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测;
S102、确定当前块使用帧内块复制技术得到的参考块;
S103、根据相关语法元素,确定基于构建的变换模型列表得到的第一变换模型;构建的变换模型列表包括至少两种类型的变换模型;
S104、基于参考块和第一变换模型,确定当前块的预测块。
需要说明的是,在本申请实施例中,解码方法应用在针对帧内块复制技术的场景中。在本申请实施例的解码过程中,在确定了当前块的参考块之后,可以对参考块进行变换后,再进行当前块的预测块的确定,也可以不对参考块进行变换实现预测块的确定。本申请实施例提出了一种可以基于构建的变换模型列表的方式来实现的一种对参考块进行变换后再进行预测的方法。
在本申请实施例中,对参考块进行变换处理可以包括:基于变换模型列表中的变换模型的选择来实现。除此之外,也可以基于预设的LIC变换、多模型LIC变换或滤波器变换中的一种类型来实现对参考块的变换。其中,变换模型列表中包括至少两种类型的变换模型。
需要说明的是,在采用Inter、IBC和IntraTMP等方式编解码的编解码块,可以对参考块进行变换得到预测块。对参考块的变换可以为以下方式:
LIC变换:预测块像素Pred(x,y)和参考块像素ref(x,y)间的关系如公式(11)
Pred(x,y)=α·ref(x,y)+β         (11)
多模型LIC变换:预测块像素Pred(x,y)和参考块像素ref(x,y)间的关系如公式(12):
其中,threshold为参考像素阈值,对是否超过阈值的参考块像素使用不同参数进行线性变换。
Filter变换-滤波器变换:预测块像素Pred(x,y)和参考块像素间的关系如下公式(2):
Pred(x,y)=c0C+c1N+c2S+c3E+c4W+c5B      (2)
其中C为位于(x,y)的参考块像素,N为其上侧的像素,S为其下侧的像素,W为其左侧的像素,E为其右侧的像素,如下图所示。B(Bias)是一个固定值,例如B是像素范围的中值。c0至c5是滤波器系数。
需要说明的是,Filter变换,对于某一区域的参考像素作变换时,会使用部分该区域外的像素作为输入,可以使用区域内像素对区域外部分进行填充。或当区域外部分像素已完成重建时,直接使用该重建值。
在本申请实施例中,相应的,根据上述各种变换形式,可以保存所需的参数信息(例如αii,ci,threshold等),作为该编解码块位置所对应的参数信息和模型类型。用于后续IBC编解码块构建变换模型候选列表时使用。
在S101中,在本申请实施例中,在解码的过程中,可以获取或者解析码流,得到当前块的相关语法元素,相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测。相关语法元素信息可以包括多种语法元素。
在本申请的一些实施例中,相关语法元素至少包括:第二语法元素。第二语法元素用于指示当前块是否使用变换模型列表进行预测。
需要说明的是,在第二语法元素指示当前块不使用变换模型列表进行预测时,可以理解为解码器可以采用现有的预设的LIC变换、多模型LIC变换或滤波器变换中的一种类型来实现对参考块的变换,或者不对参考块进行变换的处理,本申请实施例不作限制。
示例性的,在本申请实施例中,第二语法元素可以采用cu_ibc_model_merge_flag来表示,表征IBC模式下的合并标志位。
在本申请的实施例中,相关语法元素还可以包括:第一语法元素;第一语法元素用于指示当前块使用帧内块复制技术的预测模式。
示例性的,在本申请实施例中,第一语法元素可以采用pu_merge_flag表示,表征当前块使用帧内块复制技术的预测模式标志位。其中,使用帧内块复制技术的预测模式可以包括:优化的运动矢量预测(IBC-AMVP)模式或合并模式(IBC-Merge)。
针对S102-S104,在解码器解码的过程中,基于IBC进行预测的过程中,解码器通过解析码流,获取块向量的编码信息,基于候选块构建的候选块向量列表,可以确定出当前块在使用使用帧内块复制技术时的参考块。
在解码器根据相关语法元素,确定本次解码使用基于变换模型列表进行预测的情况下,可以基于相关语法元素,从变换模型列表中确定出第一变换模型。最后,由解码器基于第一变换模型,对参考块进行变换,得到当前块的预测块,再确定预测块的预测值。解码器在码流中解析出编码残差时,根据预测值和编码残差,确定当前块的重建值,完成当前块的解码过程。
在本申请的一些实施例中,解码器解析码流,解码第一语法元素;根据第一语法元素,确定当前块使用帧内块复制技术的预测模式,并解码第二语法元素。
在本申请实施例中,解码第一语法元素的取值为第一值时,表征当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式,解码第一语法元素的取值为第二值时,表征当前块使用帧内块复制技术的预测模式为合并模式。
需要说明的是,在IBC技术的不同预测模式下,解码第二语法元素的方式可以不同。
在本申请实施例中,解码第二语法元素的取值为第一值时,表征当前块使用变换模型列表进行预测,解码第二语法元素的取值为第二值时,表征当前块不使用变换模型列表进行预测。
需要说明的是,在本申请实施例中,第一值与第二值不同,而且第一值和第二值可以是参数形式,也可以是数字形式。具体地,第一标识信息可以是写入在概述(profile)中的参数,也可以是一个标志(flag)的取值,这里对此不作具体限定。
示例性地,对于第一值和第二值而言,第一值可以设置为1,第二值可以设置为0;或者,第一值可以设置为0,第二值可以设置为1;或者,第一值可以设置为true,第二值可以设置为false;或者,第一值可以设置为false,第二值可以设置为true;但是这里并不作具体限定。
在本申请实施例中,以写入码流中的flag为例,假设第一值设置为0(false),第二值设置为1(true),这时候如果第一语法元素的取值为0(false),那么可以确定对当前块使用优化的运动矢量预测模式;如果第一标识信息的取值为1(true),那么可以确定对对当前块使用合并模式。如果第二语法元素的取值为0(false),那么可以确定对当前块不使用变换模型列表的预测方式,即不使用本申请提出的基于变换模型列表的解码方法;如果第一标识信息的取值为1(true),那么可以确定对对当前块使用变换模型列表的预测方式,即使用本申请提出的基于变换模型列表的解码方法。
需要说明的是,本申请实施例不限制第一值和第二值的表现形式。在本申请实施例中,是以第一值为0(false),第二值为1(true)为例进行说明的。
解码器根据解码的第二语法元素的取值,确定是否使用使用变换模型列表进行预测,进而可以判断出预测时第一变换模型是哪个,以及是不是要进行变换处理。
需要说明的是,变换模型列表中包含有多种变换模型,在针对每个块进行编码的过程中,可以每次选取的变换模型不同,这样可以增加预测的多样性,为每个块选择适合自己的方式进行变换,而不是采用统一的预设的变换模型进行相同的变换处理,提升了解码性能。
在本申请的一些实施例中,基本申请实施例提供的一种可选的解码方法的流程示意图。该方法可以包括:
S201、解码第一语法元素;
在本申请实施例中,S201的解码过程与前述实施例中的过程一致,此处不再赘述。
S202、在第一语法元素的取值为第一值时,确定当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式,并解码第三语法元素(cu_ibc_lic_flag),第三语法元素用于指示是否使用变换技术进行预测;第三语法元素属于相关语法元素;
需要说明的是,所述第一语法元素采用pu_merge_flag表示时,表征预测模式为合并模型,那么在解码器解码出的pu_merge_flag为第一值,即假时,解码器就可以确定出当前块采用的是优化的运动矢量预测模式。这时,解码器继续解析码流,就可以解码出第三语法元素,相关语法元素包括:第三语法元素。其中,第三语法元素用语指示是否使用变换技术进行预测。
示例性的,在本申请实施例中,可以采用cu_ibc_lic_flag表示第三语法元素。cu_ibc_lic_flag表征是否采用了变换处理参考块来进行预测,第三语法元素为真,则采用了变换处理;第三语法元素为假,则没有使用变换处理。但即使使用了变换来处理参考块,也需要进一步判断是否采用变换模型列表来进行变换的,因为还可以采用预设的同一个变换模型对所有块进行相同的变换处理的情况。
需要说明的是,第三语法元素的取值也可以为第一值和第二值等,与第一语法元素和第二语法元素的设定表示同理,此处不再赘述。
S203、在第三语法元素的取值为第二值时,解码第二语法元素;
S204、在第二语法元素的取值为第二值时,表征当前块使用变换模型列表进行预测,解码第四语法元素,确定变换模型的索引信息,并跳过当前块从合并候选块继承局部补偿标志位的过程;第四语法元素用于指示变换模型在变换模型列表中的模型索引;相关语法元素信息还包括:第四语法元素;
在本申请实施例中,解码器解码第三语法元素可以为第一值(假),也可以为第二值(真)。在解码第三语法元素的取值为第二值时,表征当前块采用了对参考块进行变换的方式进行预测,那么解码器需要继续解码第二语法元素,看是采用变换模型列表的方式选择合适当前块的变换模型进行变换,还是直接采用了预设好的单一的变换模型进行的变换。
在本申请实施例中,在解码第二语法元素的过程中,在解码器解码出第二语法元素的取值为第二值(真),表征当前块使用变换模型列表进行预测,那么解码器就可以继续进行码流的解析,对相关语法元素包括的第四语法元素进行解码,得到在变换模型列表中的变换模型的索引信息。其中,第四语法元素用于指示变换模型在变换模型列表中的模型索引。
示例性的,在本申请实施例中,解码器可以采用cu_ibc_model_merge_idx来表示第四语法元素。
S205、基于变换模型的索引信息,在构建的变换模型列表中,确定第一变换模型。
S206、基于参考块和第一变换模型,确定当前块的预测块。
在本申请实施例中,解码器在解码出第四语法元素时,就可以从已构建好的变换模型列表中,确定出与第四语法元素表征的变换模型的索引信息对应的第一变换模型了。也就是说,解码器在当前块的预测过程中,从变换模型列表中,确定出与当前块适应的第一变换模型。这样,解码器就可以基于第一变换模型,实现对参考块的变换处理,从而得到当前块的预测块,进而基于预测块进行后续的解码处理。
示例性的,在IBC-AMVP模式下,为当前块构建变换模型候选列表,通过写入码流的块级模式标志位(第一语法元素、第二语法元素、第三语法元素)以及候选索引(第四语法元素),确定当前块的预测模式以及变换模型。
语法元素如下:
其解码过程为:解码IBC预测模式相关元素。解码cu_ibc_lic_flag,若cu_ibc_lic_flag为真,表示该编码块的参考块需要进行变换。进一步解码cu_ibc_model_merge_flag,若cu_ibc_model_merge_flag为真,表示使用构建变换模型候选列表的方式确定变换模型。进一步解码cu_ibc_model_merge_idx确定使用列表中哪一变换模型。若cu_ibc_model_merge_flag为假,则表示该编码块使用IBC-LIC方法。若cu_ibc_lic_flag为假,表示使用其他基于IBC的预测方法。
在本申请的一些实施例中,cu_ibc_lic_flag、cu_ibc_model_merge_flag可以采用基于上下文模型的熵编码方法。cu_ibc_model_merge_idx的取值范围可以小于或等于最大的变换模型候选列表长度,可以使用变长编码,索引越小则对应的码字越短。例如,cu_ibc_model_merge_idx取值范围是n,使用截断二元码编码。例如,码字如下表4所示,表4中不同的码字下的各个比特位可以使用上下文模型编码(Intra_tmp_idx)或等概率编码。
表4
在本申请的一些实施例中,解码器基于变换模型的索引信息,在构建的变换模型列表中,确定第一变换模型的过程还可以包括:若变换模型的第四语法元素为第三值,则在变换模型列表指示至少一个其他变换模型,其中,其他变换模型为其他参考块对应的变换方式。
需要说明的是,可以将其余IBC的参考块变换方法也作为变换模型列表中的模型候选,通过统一的语法元素编码这些方法以及继承得到的可用变换模型。也就是说,用一个语法元素表示其他参考块对应的变换方式传输的索引,索引的值指示的可能是选择其他的LIC模型等,实现在语法元素上的复用。
在本申请的一些实施例中,解码方法还包括:
S207、在第三语法元素的取值为第一值时,解码第二语法元素。
在本申请实施例中,可以通过改变第三语法元素的含义,来确定是否解码第二语法元素,例如在第三语法元素为真时,表征不采用变换处理参考块。而在第三语法元素为假时,表征采用变换处理参考块的情况下,解码器就可以在第三语法元素的取值为第一值(假)时,解码第二语法元素。
S207为与S203为二选一的实现方式,本申请实施例不作限制。
示例性的,语法元素如下:
解码cu_ibc_lic_flag,若cu_ibc_lic_flag为真,表示该编码块使用IBC-LIC方法。若cu_ibc_lic_flag为假,进一步解码cu_ibc_model_merge_flag,若cu_ibc_model_merge_flag为真,表示使用构建变换模型候选列表的方式确定变换模型。进一步解码cu_ibc_model_merge_idx确定使用列表中哪一变换模型。若cu_ibc_model_merge_flag为假,表示使用其他基于IBC的预测方法。
S208、在第二语法元素的取值为第二值时,构建变换模型列表。
在本申请实施例中,解码器解码了第二语法元素为真时,表征当前块采用变换模型列表的方式进行预测,那么就需要构建该变换模型列表。
在本申请的一些实施例中,解码器构建变换模型列表的过程包括:依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到变换模型列表;
至少一种变换模型包括以下至少一种:
当前块的至少一个相邻位置的像素对应的第二变换模型;
当前块的至少一个非相邻位置的像素对应的第三变换模型;
历史解码过程中使用的第四变换模型;
时域的可用变换模型;
预设变换模型。
在本申请实施例中,依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到变换模型列表时,添加模型的顺序可以在第二变换模型、第三变换模型、第四变换模型、时域的可用变换模型和预设变换模型之间的任意顺序来添加。并且其中的任意一种类型的变换模型都可以包含多个。
需要说明的是,构建变换模型候选列表时的至少一种变换模型的添加顺序可以不同。例如,先添加历史的可用变换模型,再添加非相邻的可用变换模型等,本申请实施例不作限制。
需要说明的是,变换模型列表具有最大长度,本申请实施例不作限制。
示例性的,若cu_ibc_model_merge_flag为真,则为当前编码块构建变换模型候选列表,最大长度为N。该列表可以由以下候选顺序地组成:
相邻位置的可用变换模型(第二变换模型);
非相邻位置的可用变换模型(第三变换模型);
历史的可用变换模型(第四变换模型);
时域的可用变换模型;
默认变换模型(预设变换模型)。
其中,默认变换模型可以包括:参数为α00的LIC变换模型、由列表中已有变换模型调整后得到的变换模型。构建变换模型列表时,可以进行去冗余的判断,例如,对某一待添加的变换模型,只有与列表内已有的各个候选均不相同时,才添加入列表。
示例性的,在构建当前块的变换模型候选列表时,可以添加时域的可变模型候选。例如,按照以下顺序构建列表:
1)相邻位置的可用变换模型;
2)时域的可用变换模型;
3)非相邻位置的可用变换模型;
4)历史的可用变换模型;
5)默认变换模型。
在本申请实施例中,预设变换模型包括:预设模型参数对应的模型或对第二变换模型、第三变换模型和第四变换模型、预设模型参数对应的模型和时域的可用变换模型中的至少一种进行偏移得到的模型。
需要说明的是,这里的偏移指的是对任意一种变换模型中的任意一个参数进行的偏移。
需要说明的是,在最大长度未达到时,可以通过对已有的候选变换模型参数进行一些偏移得到新的变换模型添加至变换模型列表中。
其中,时域的变换模型通过检查参考帧列表中同位帧内的多个相邻点得到。此外,还可以添加平移后的时域的可变模型候选。示例性的,按照以下顺序构建列表:
1)相邻位置的可用变换模型;
2)时域的可用变换模型;
3)非相邻位置的可用变换模型;
4)平移后的时域的可用变换模型;
5)历史的可用变换模型;
6)默认变换模型。
在上述过程中,首先根据当前块相邻块获取用于平移的运动向量,再将该向量应用至时域候选的各个检查点上,作为新的检查点来得到平移后的时域的可用变换模型。上述时域候选的获取过程可以参考帧间预测中的时域候选获取过程。
在本申请的一些实施例中,变换模型列表中包含的第二变换模型、第三变换模型和第四变换模型对应的块的预测类型为帧内模拟匹配预测和帧内块复制技术中的任意一种。
也就是说,第二变换模型、第三变换模型和第四变换模型可以为来自IBC或IntraTMP帧内模拟匹配预测块,也可以只使用来自IBC的变换模型,或只使用来自IntraTMP的变换模型,本申请实施例不作限制。
在本申请实施例中,获取至少一种变换模型添加至变换模型列表中的过程可以在满足变换条件时才能够得到。
在本申请的一些实施例中,针对当前块的任一相邻位置的像素或者当前块的任一非相邻位置的像素,若该像素满足变换条件,则获取当前块的该相邻位置的第二变换模型,或者,获取当前块的任一非相邻位置的像素对应的第三变换模型;其中,变换条件包括以下至少一种:
该像素所在块使用帧内块复制技术、变换模型标志位为有效和该像素所在块的大小满足第一预设尺寸。
示例性的,以变换模型标志位为有效为例进行说明,上述至少一种变换模型是否可以获取的判断可以为:若该位置所在编解码单元由IBC模式或IntraTMP模式编解码,并且其预测块由参考块变换得到,是否有变换模型,有一个变换模型标志位(类似LIC标志位)标志位有效时,才去获取变换模型,变换类型保存为标志位,便于后面的块构建列表的时候来查标志位,但不是编码器传输的(编码器传输标志位也是可以的,不一样的语法元素),则该用于变换的模型属于至少一种变换模型。除此之外,判断该位置所在编解码单元是否满足预定义的大小限制来确定至少一种变换模型。
在本申请的一些实施例中,不同的至少一种变换模型包括以下至少一种:至少一种变换模型的变换类型不同、存在不同的模型参数,同一变换类型下使用不同模板区域。
示例性的,可以按以下至少一种方法判断变换模型是否相同:
若变换类型不同则不同,使用不同模板区域的LIC变换,当作不同类型;
若为LIC变换,α系数不同则不同;
若为多模型LIC变换,任意αi不同则不同;
若为Filter变换,任意ci不同则不同。
在本申请的一些实施例中,解码器依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到变换模型列表的过程可以为:
解码器依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到中间变换模型列表;对中间变换模型列表进行重排序,得到变换模型列表。
需要说明的是,依次添加的至少一种变换模型的添加顺序不作限制。重排序的过程是可选的,本申请实施例不作限制。
在本申请实施例中,解码器对中间变换模型列表进行重排序,得到变换模型列表的过程包括:
遍历中间变换模型列表中的各个变换模型,确定各个变换模型的偏移值;采用各个变换模型,分别对参考块模板进行预测,确定各个变换模型各自的参考块模板预测;确定每个变换模型的参考块模板预测和当前块模板之间的误差值;基于每个变换模型的误差值,以及其对应的偏移值,确定各个变换模型的模板误差值;根据各个变换模型的模板误差值,对各个变换模型进行重排序,得到变换模型列表。
其中,各个变换模型的模板误差值由小到大,对应变换模型列表的索引信息由小到大。在参考块模板不可用时,确定误差值为最大值。
需要说明的是,针对变换模型列表内的变换模型的所有模型,根据当前块模板和参考块模板计算偏移值offset,用于后续预测值的计算;这里需要对所有变换模型遍历,计算出各个变换模型的offset。需要注意的是不重排序的话,可以只计算选中的变换模型的offset,不一定需要对所有候选计算offset。对变换模型候选列表重排序时,以当前块上方N行、左侧M列为当前块模板,参考块相应的相邻区域为参考块模板。对变换模型列表内某一变换模型,将其应用于参考块模板得到参考块模板的预测,进而得到参考块模板预测和当前块模板之间的误差值,可以用SAD计算误差值,加上偏移值,得到模板误差值;最后根据各个变换模型对应的模板误差值对列表重排序。例如,模板误差值越小的变换模型,对应的模型索引越小;参考块模板不可用时,将SAD设置为最大值,例如整型的最大值等。
可以理解的是,重排序可以可能性好、模板误差值小的变换模型的索引小一点,一旦选择最优的变换模型时,编解码时的码字就可以少传输一些,节省码字。
在本申请的一些实施例中,不同变换类型的各个变换模型,对应不同的参考块模板区域;各个变换模型误差值为各自的参考块模板中的像素数的平均的模板误差值。
需要说明的是,计算各个变换模型的模板误差值时,不同变换类型可以使用不同的模板区域,可以按照模板的像素数计算平均的模板误差值来比较。也可以扩展到计算offest的场景,采用不同变换类型可以使用不同的模板区域。例如,若变换类型为使用左侧模板的LIC变换,则计算offset时可以使用左侧模板。
在本申请的一些实施例中,获取当前块所在的第一位置信息(左上角坐标)和当前块的当前尺寸;
基于第一位置信息和当前尺寸,确定当前块的至少一个相邻位置和当前块的至少一个非相邻位置。
需要说明的是,相邻位置、非相邻位置的确定可以与帧间编码块Merge列表构建方法及IBC Merge列表构建方法相同。
示例性的,相邻位置、非相邻位置可以根据当前块的位置以及大小确定。例如,当前块的左上角坐标为(X,Y),宽高为(W,H),则相邻位置可以是(X-1,Y+H-1)、(X+W-1,Y-1)、(X-1,Y+H)、(X-1,Y-1)。例如,非相邻位置可以是:
a0i=(X-W*i-1,Y+H*(i+1)-1),1<=i<=7         (13)
a1i=(X+W*(i+1)-1,Y-H*i-1),1<=i<=7        (14)


a4i=(X-W*i-1,Y-H*i-1),1<=i<=7         (17)
a5i=(X-1,Y+H*(i+1)-1),2<=i<=7         (18)
a6i=(X+W*(i+1)-1,Y-1),2<=i<=7         (19)

按照a01,a11,…,a41,a02,…a82,…,a87的顺序检查这些非相邻位置。
可以额外检查以下非相邻位置:


b0i=(X-W*i-1,Y+offsetY),1<=i<=7         (24)
b1i=(X+offsetX,Y-H*i-1),1<=i<=7         (25)

在本申请的一些实施例中,获取推导出的局部补偿模型,将局部补偿模型添加至变换模型列表。
需要说明的是,在构建变换模型列表的过程中,可以,从相邻等位置继承来的,但也可以把其余推导出来的LIC模型作为列表的第一个。
在本申请实施例中,历史的可用变换模型可能与相邻位置的可用变换模型和非相邻位置的可用变换模型重复,但是历史的可用变换模型对应的区域更多,历史的可用变换模型保存的是编解码顺序上最近编解码块的最近的历史变换模型。解码器维护了一个历史变换模型列表,从这个历史变换模型列表中依次进行去重后再添加至变换模型候选列表中。
在本申请的一些实施例中,获取将解码过程中的使用的历史变换模型;在历史变换模型与历史变换模型列表中存在相同模型时,则将历史变换模型列表中的相同模型移除,将历史变换模型添加至历史变换模型列表的第一顺序位;在历史变换模型与历史变换模型列表中不存在相同模型时,则将历史变换模型添加至历史变换模型列表的第一顺序位。
在本申请的一些实施例中,将历史变换模型添加至历史变换模型列表的第一顺序位的过程为:在历史变换模型列表满足第一预设列表长度时,将历史变换模型列表中的最后顺序位的变换模型移除后,将历史变换模型添加至历史变换模型列表的第一顺序位。
需要说明的是,第四变换模型是按照历史变换模型的由第一顺序位至最后顺序位的顺序,从历史变换模型中依次确定的。
需要说明的是,可以在编解码过程中维护一个由已编解码块的变换模型组成的列表,可以称为历史变换模型列表,用于后续编解码块构造变换模型列表时,添加历史的变换模型的候选(即第四变换模型)。该历史的编码模型列表有最大长度K,是先进先出列表。即最先添加的变换模型位于列表底端,最后添加的变换模型位于列表的顶端。当完成某一个IBC或IntraTMP块的编码后,若其存在可用的变换模型,可以将该变换模型添加至该历史列表中。添加时,判断该模型在列表内是否存在相同模型。若是,则先移除历史列表中重复的模型。之后,将该模型添加至历史列表的顶端。若添加时历史列表达到最大长度,则将位于底端的模型先移除再添加当前模型。后续构建候选变换模型列表,添加历史的变换模型时,按由顶端至底端的顺序依次尝试添加该历史变换模型列表中的各个变换模型。
在本申请的一些实施例中,待添加的历史变换模型对应的块的尺寸在满足第二预设尺寸的情况下,基于历史变换模型更新历史变换模型列表。
也就是说,只有待添加的历史变换模型对应的块的尺寸满足某种预定义的大小限制时,才添加至历史变换模型列表。
在本申请的一些实施例中,在第三语法元素的取值为第一值,解码第二语法元素之后,在第三语法元素的取值为第二值时,解码第五语法元素;第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引;
基于第五语法元素,确定第六变换模型;
基于参考块和第六变换模型,确定当前块的预测块。
或者,
在第三语法元素的取值为第二值,解码第二语法元素之后,在第三语法元素的取值为第一值时,解码第五语法元素;第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引;
基于第五语法元素,确定第六变换模型;
基于参考块和第六变换模型,确定当前块的预测块。
其中,第五语法元素可以采用cu_ibc_lic_idc表示。
示例性的,if(!pu_merge_flag)
其中,cu_ibc_lic_idc表示多模式IBC-LIC技术下,IBC-LIC子方法的索引。或者,
cu_ibc_lic_idc表示多模式的IBC-LIC下,LIC子方法的索引。
可以理解的是,变换模型列表中包含有多种变换模型,在针对每个块进行编码的过程中,可以每次选取的变换模型不同,这样可以增加预测的多样性,为每个块选择适合自己的方式进行变换,而不是采用统一的预设的变换模型进行相同的变换处理,提升了解码性能。而在不采用变换模型列表进行变换的时候,也可以采用LIC变换模型或者多模式的IBC-LIC来实现变换处理,保证解码效率。
在本申请的一些实施例中,本申请实施例提供了一种可选的解码方式的流程示意图,该方法可以包括:
S301、解码第一语法元素;
在本申请实施例中,S201的解码过程与前述实施例中的过程一致,此处不再赘述。
S302、在第一语法元素的取值为第二值时,确定当前块使用帧内块复制技术的预测模式为合并模式,并解码第二语法元素;
需要说明的是,所述第一语法元素采用pu_merge_flag表示时,表征预测模式为合并模型,那么在解码器解码出的pu_merge_flag为第二值,即真时,解码器就可以确定出当前块采用的是优化的合并模式。这时,解码器继续解析码流,就可以解码出第二语法元素。
S303、在第二语法元素的取值为第二值时,表征当前块使用变换模型列表进行预测,解码第四语法元素(cu_ibc_model_merge_idx),确定变换模型的索引信息,并跳过当前块从合并候选块继承局部补偿标志位的过程;第四语法元素用于指示变换模型在变换模型列表中的模型索引;相关语法元素信息还包括:第四语法元素;
S304、基于变换模型的索引信息,在构建的变换模型列表中,确定第一变换模型。
S305、基于参考块和第一变换模型,确定当前块的预测块。
在本申请实施例中,S303-S305的解码过程与前述实施例中S204-S206的过程一致,此处不再赘述。
示例性的,在IBC-Merge模式下,为当前编码块构建变换模型候选列表,通过写入码流的块级模式标志位(第一语法元素、第二语法元素)以及候选索引(第四语法元素),确定当前编码块的预测模式以及变换模型。
语法元素如下:
if(pu_merge_flag)
{cu_ibc_lic_flag
cu_ibc_model_merge_flag
if(cu_ibc_model_merge_flag){
cu_ibc_model_merge_idx
}
}
若cu_ibc_model_merge_flag为真,则根据cu_ibc_mdel_merge_idx所选中的变换模型为参考块作变换。解码过程同前述实施例。
在本申请的一些实施例中,解码器基于参考块和第一变换模型,确定当前块的预测块的过程为:
采用第一变换模型,对当前块的参考块模板进行预测,确定参考块模板的像素的预测值;
确定各个像素的预测值和当前块模板的像素之间的总误差值;
基于总误差值,对各个像素进行平均,得到第一偏移值;
采用第一变换模型对参考块进行变换,并在每个像素对应的变换结果补偿第一偏移值,得到当前块的预测块;或者,采用第一偏移值对第一变换模型中的参数进行补偿,得到更新的第一变换模型,再采用更新后的第一变换模型对参考块进行变换。
需要说明的是,假设第一变换模型为LIC模型或多模式的LIC,则采用第一偏移值对第一变换模型中的参数进行补偿是对变换模型中的β进行补偿的,得到更新了β的更新的第一变换模型。
需要说明的是,使用变换模型列表中第一变换模型前,可以根据当前块及参考块模板区域(匹配模板)的像素值,计算偏移值offset,对预测值进行调整,例如:
假设匹配模板包含N个像素,根据参考块模板计算得到各个像素的模板预测PredL型的部分,从而计算模板预测和当前块模板像素Rec间的总差值totalDiff以及偏移值offset,如公式(28)和(29)所示:
totalDiff=∑(Rec-Pred)         (28)
offset=totalDiff/N        (29)
最终的预测值可以是变换后预测值加上offset块内,例如使用LIC变换,则为公式(30):
Pred(x,y)=α·ref(x,y)+β+offset         (30)
在本申请实施例中,本申请实施例中的计算可以由基于整数的加法、乘法和移位操作(移位操作时可以进行四舍五入)实现,本申请实施例不作限制。
在本申请的一些实施例中,当第一变换模型为局部补偿模型时,获取当前编码块相邻的第一已重建区域像素值和参考块相邻的第二已重建区域像素值;基于第一已重建区域像素值和第二已重建区域像素值,推导局部补偿模型的第一参数(α),并由第一参数确定其第二参数(β);采用局部补偿模型的原始第一参数,和第二参数,确定第三变换模型;采用第三变换模型对参考块进行变换,得到当前块的预测块。(隐含了offest=0)
需要说明的是,计算offset的方法可以使用LIC技术的参数推导方法(根据模板区域推导出α、β,基于最小误差先推导出α,再基于α和区域内的像素值推导出β)。即,LIC技术可以推到得到α、β,用于计算offset时,a由选中的变换模型得到(继承α),β使用计算得到的β,这样的offest计算出来是没有偏差的,可以认为offest=0。
在本申请的一些实施例中,在当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测(即参考的cu_ibc_model_merge_flag为真)时,确定当前块的局部补偿标志位(LIC标志位)为第二值。
需要说明的是,IBC编码块构建Merge list时,参考某一位置PU来构建merge候选,若该PU的cu_ibc_model_merge_flag为真,则下一个块,例如右边的下一个块,可以设置该merge候选的LIC标志位为真,作为下一个块的Merge list的候选。
那么解码器基于参考块和第一变换模型,确定当前块的预测块的过程为采用第一变换模型和局部补偿标志位指示的局部补偿的变换模型,依次对参考块进行二次变换,确定当前块的预测块。或者,根据当前块模板和参考块模板推岛的局部补偿的变换模型,对参考块进行变换,确定所述当前块的预测块。
需要说明的是,若是LIC标志位为真且cu_ibc_model_merge_flag也为真的情况下,可以同时做两次变换,顺序执行,执行顺序不限。若IBC编码块选择该merge候选,则该编码块的LIC标志位为真,应对参考块进行LIC变换,线性参数由当前块模板和参考块模板推导得到。
在本申请的一些实施例中,在当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测(即参考的cu_ibc_model_merge_flag为真)时,确定当前块的局部补偿标志位(LIC标志位)为第一值。
需要说明的是,参考的cu_ibc_model_merge_flag为真的情况下,当前块的局部补偿标志位的设置的具体值的可能性不唯一,本申请实施例不作限制。
IBC编码块构建Merge list时,参考某一位置PU来构建merge候选,可以忽略该PU的cu_ibc_model_merge_flag,即不根据该PU的cu_ibc_model_merge_flag来判断该merge候选是否进行LIC变换。后面的块的编解码是否变换可以跟cu_ibc_model_merge_flag无关。即cu_ibc_model_merge_flag为真,可以设置该merge候选的LIC标志位为假。
基于上述实施例的描述,在本申请实施例中,解码器在解码第二语法元素的过程还可以根据已解码信息,解码第二语法元素,其中,已解码信息包括以下至少一种:
当前块的尺寸、当前块的CIIP标志位、GPM标志位、MBVD标志位、skip标志位和TM_merge标志位。
在本申请的一些实施例中,在已解码信息满足第一解码条件时,解码第二语法元素;
第一解码条件包括以下至少一个:
CIIP标志位的取值为第一值(假);
GPM标志位的取值为为第一值(假);
MBVD标志位为第一值(假);
skip标志位为第一值(假);
TM_merge标志位为第一值;
当前块的尺寸小于第三预设尺寸;
当前块的面积大于第一预设面积阈值。
示例性的,可以根据已有编解码信息例如,当前块的宽高,大小满足一定范围,有一些限定条件时,才判断是否解码标志位cu_ibc_model_merge_flag。若不满足条件条件,则cu_ibc_model_merge_flag为假,且不解码cu_ibc_model_merge_idx。例如,当前块的CIIP标志位、GPM标志位、MBVD标志位、TM_merge标志位和skip标志位等。
根据当前块的宽高及大小、当前块的解码方法标志位等。例如,解码可以过程为:
其中,IBC-AMVP模式和IBC-Merge模式下可以有不同的条件判断是否解码cu_ibc_model_merge_flag,本申请实施例不作限制。且在这两种模式下,其对应使用的变换模型列表大小、索引长度、索引编码方式等也可以不相同或相同,本申请实施例不作限制。
需要说明的是,是否解码cu_ibc_model_merge_flag可以依赖于已解码的其他模式标志位,本申请实施例不作限制。
在本申请的一些实施例中,在序列级的语法元素、帧级的语法元素、片级语法元素、当前块的尺寸中的至少一个满足第二解码条件时,解码第二语法元素。
需要说明的是,可以根据帧级、片级标志位、块大小等条件,判断是否解码cu_ibc_model_merge_flag和cu_ibc_model_merge_idx。
示例性的,例如,存在序列级标志位sps_ibc_model_merge_enable_flag,解码过程可以为:

在本申请的一些实施例中,确定对当前块的参考块,进行基于帧内块复制技术-帧内/帧间联合预测、帧内块复制技术-几何划分模式和帧内块复制技术-重建值重排序中的至少一种预测,得到参考块的参考预测块;采用参考预测块对参考块进行更新。
需要说明的是,前述参考块还可以是由IBC-CIIP、IBC-GPM,RRIBC等技术得到的预测块。
在本申请的一些实施例中,第一变换模型为使用多模式局部补偿技术时的局部补偿模型时,基于当前块模板和参考块模板重新计算多模式局部补偿模型的更新参数;基于更新参数,更新第一变换模型。
需要说明的是,当选中的变换模型候选为多模型候选时,可以根据当前块和参考块的模板重新计算threshold。变换模型列表中的threshold是有的,但也可以重新计算得到,用于进行对参考块的变换。
在本申请的一些实施例中,解码第二语法元素可以采用很多解码方式,不申请实施例不作限制。
根据相邻块的解码信息,从至少一个上下文模型中,确定第一上下文模型;基于第一上下文模型,解码第二语法元素;或者,采用等概率解码方式,解码第二语法元素。
需要说明的是,cu_ibc_model_merge_flag可以使用多个上下文模型共同编解码,根据相邻块的编解码信息选择上下文模型,或可以使用等概率编解码。
在本申请的一些实施例中,解码第四语法元素,确定变换模型的索引信息,包括以下至少一种:
采用等概率解码方式,解码第四语法元素,确定变换模型的索引信息;
采用第二上下文模型的解码方式,解码第四语法元素,确定变换模型的索引信息;
部分采用第二上下文模型的解码方式,结合部分采用等概率解码方式,解码第四语法元素,确定变换模型的索引信息。
需要说明的是,cu_ibc_model_merge_idx的各个比特可以使用上下文模型编解码,或是使用等概率编解码,或是部分使用上下文模型编解码部分使用等概率编解码。
在本申请的一些实施例中,当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,解码第二语法元素信息的第一上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,解码第二语法元素信息的第一上下文模型的关系包括:相同或不相同。
在本申请的一些实施例中,当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,解码第四语法元素信息的第二上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,解码第四语法元素信息的第二上下文模型的关系包括:相同或不相同。
需要说明的是,IBC-AMVP模式下及IBC-Merge模式下的cu_ibc_model_merge_flag及cu_ibc_model_merge_idx可以使用不同的上下文模型编解码,也可以使用相同的上下文模型编解码。例如,使用同一个上下文模型对cu_ibc_model_merge_flag或cu_ibc_model_merge_idx编解码。
IBC-AMVP或IBC-Merge模式下,cu_ibc_model_merge_flag可以使用多个上下文模型编解码,根据相邻块的已编解码信息选择使用哪个上下文模型。例如,使用3个上下文模型,若左侧块、上侧块的cu_ibc_model_merge_flag都是真,则使用上下文模型1;若左侧块、上侧块的cu_ibc_model_merge_flag只有一个为真,则使用上下文模型2;否则,使用上下文模型3等,本申请实施例不作限制。
需要说明的是,IBC-AMVP或IBC-Merge模式下使用的上下文模型可以相同,也可以不同。
在本申请的一些实施例中,本申请实施例提供了一种可选的解码方式的流程示意图,该方法可以包括:
S401、获取当前块的参考块的第六语法元素,第六语法元素用于指示参考块的索引信息;
S402、基于第六语法元素,确定当前块使用帧内块复制技术得到的参考块;
在解码过程中,确定参考块的时候,解码器还可以解码获取到当前块的参考块的第六语法元素,第六语法元素用于指示参考块的索引信息。这样解码器就可以根据第六语法元素,在Merge list中确定当前块使用帧内块复制技术得到的参考块了。
在本申请实施例中,解码器可以根据IBC-Merge相关元素确定IBC的参考块。例如,为当前块构建Merge list,根据Merge索引确定某一merge候选,得到当前块的块向量、块向量精度等信息,从而通过运动补偿得到当前块的参考块。
S403、获取当前块的合并候选的第二语法元素;
S404、在合并候选块的第二语法元素的取值为第二值时,确定当前块的第二语法元素为第二值;
S405、基于合并候选块对应的参考的变换模型,确定当前块的第一变换模型。
解码器获取参考块对应的参考信息来源的合并候选块的第二语法元素,即已解码过的合并候选块的cu_ibc_model_merge_flag,如果当前块的合并候选块的cu_ibc_model_merge_flag为真,那么可以直接当前块的cu_ibc_model_merge_flag为真,并根据合并候选块对应的参考的变换模型,来确定当前块的第一变换模型,而不同从码流中进行当前块的第二语法元素的解析,减少了传输码字。
需要说明的是,构建Merge list时,参考某一位置PU来构建merge候选,若该候选的PU的cu_ibc_model_merge_flag为真,则设置当前编码块的cu_ibc_model_merge_flag为真,同时将该PU的变换模型设置为该当前编码块的变换模型。
示例性的,在IBC-Merge模式下,为当前块构建变换模型候选列表,根据Merge候选的编解码信息,确定当前块的预测模式以及变换模型,不需要编码cu_ibc_model_merge_flag或cu_ibc_model_merge_idx,即不传cu_ibc_model_merge_flag。
在本申请的一些实施例中,基于合并候选块对应的参考的变换模型,确定当前块的第一变换模型,包括以下至少一种:
将参考的变换模型,作为第一变换模型。
确定参考的变换模型的第一变换模型类型;根据参考块模板和当前块模板,重新推导与第一变换类型一致的第一变换模型。
获取合并候选块的翻转参考块标志位;在翻转参考块标志位的取值为第二值时,基于参考块对应的参考的变换模型,确定当前块的第一变换模型。
需要说明的是,隐式地继承参考的变换模型时,可以只继承参考的变换模型的类型,实际预测时根据模板重新推导模型参数。或者,隐式地继承cu_ibc_model_merge_flag和参考的变换模型时,可以根据其他块级编码信息Merge候选的编码信息判断是否继承。例如,如果该PU的翻转参考块标志位不为0,则不继承cu_ibc_model_merge_flag和变换模型。反之,为0,就继承。
S406、基于参考块和第一变换模型,确定当前块的预测块。
在本申请实施例中,S406的解码过程与前述实施例中S206的过程一致,此处不再赘述。
需要说明的是,根据merge候选的cu_ibc_model_merge_flag标志位,确定当前块是否对参考块进行变换,若cu_ibc_model_merge_flag为真,则使用第一变换模型,根据当前块及参考块模板区域的参考像素计算偏移值offset,对当前块的参考块作变换,得到最终的预测块,完成当前块的编解码。
在本申请的一些实施例中,基于第一变换模型更新历史变换模型列表。
在本申请实施例中,保存当前块所使用的第一变换模型并添加该变换模型至历史变换模型列表中,用于后续块的变换模型列表构建。
在本申请的一些实施例中,在当前块的第二语法元素为第一值时,或者,在当前块的合并候选块的的第二语法元素为第一值时,基于参考块,确定当前块的预测块;
基于当前块的预测块,确定当前块的重建像素值;
基于当前块的重建像素值,在模板区域或在块内,构建当前块的第五变换模型,供后续解码过程使用。
需要说明的是,当前块的第二语法元素为第一值,表征不适用变换模型列表的预测方式,当前块的合并候选块的的第二语法元素为第一值表征第二语法元素为第一值。这时,有一种实现为表明不使用变换技术对参考块进行处理,那么解码器就基于参考块,确定当前块的预测块即可。
而针对所有(或使用非参考块变换的)已编码的IBC/IntraTMP块,根据编解码后的重建像素值(模板区域或块内)推导出一个变换模型,用于后续本申请方法的变换模型列表构建与继承。已编解码的IBC块没有进行变换时,也构建一个对应的变换模型,当已编解码的块作为参考块时,可以使得后续块可以继承。
基于上述实施例,在本申请的一些实施例中,解码方法还包括:
基于参考块和第一变换模型,确定当前块的预测块之后,方法还包括:
基于当前块的预测块,确定当前块的重建像素值;
基于当前块的重建像素值,在模板区域或在块内,构建当前块的第七变换模型;
采用第七变换模型代替第一变换模型,更新变换模型列表;或者,
采用第七变换模型和第一变换模型中误差值最小的变换模型,更新变换模型列表;或者,
采用第七变换模型,更新变换模型列表。
需要说明的是,对使用参考块变换的IBC/IntraTMP,在模板区域或块内推导出一个变换模型,用于后续本申请方法的变换模型列表构建与继承。可以根据当前码块的重建值(块内区域或模板区域),重新推导出一个变换模型(类型可以与原有的一致),直接替换预测过程中所使用的第一变换模型(更新变换模型列表中的模型)。或是根据SAD等误差值判断是否替换变换模型列表中原有变换模型,留下误差小的模型,或者两个模型都保存。
需要说明的是,本申请提供的解码方法可以基于帧间预测或IntraTMP预测实现,即将方案中的IBC编码块替换为Inter编码块或IntraTMP编码块,本申请实施例不作限制。
在本申请的一实施例中,参见图12,其示出了本申请实施例提供的一种编码方法的流程示意图。 如图12所示,该方法可以包括:
S501、确定当前块的候选块向量列表;
S502、基于所述候选块向量列表,确定参考块向量;
S503、基于所述参考块向量,确定参考块;
S504、在确定当前块的预测模式为帧内块复制技术结合变换模型列表进行预测时,从构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;
S505、基于所述参考块和所述第一变换模型,确定当前块的预测块;
S506、编码当前块的相关语法元素,将所得到的编码比特写入码流;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测。
所述相关语法元素至少包括:第二语法元素(cu_ibc_model_merge_flag);
其中,所述第二语法元素用于指示当前块是否使用变换模型列表进行预测;
所述相关语法元素还包括:第一语法元素(pu_merge_flag),所述第一语法元素用于指示当前块使用帧内块复制技术的预测模式。
在本申请的一实施例中,所述帧内块复制技术的预测模式包括:合并模式和优化的运动矢量预测模式;所述方法还包括:
当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,编码所述第一语法元素的取值为第一值,以及编码第三语法元素;所述第三语法元素用于指示是否使用变换技术进行预测;所述第三语法元素属于所述相关语法元素;
编码所述第三语法元素的取值为第二值(真)时,编码所述第二语法元素;或,
编码所述第三语法元素的取值为第一值(假),编码所述第二语法元素;或者,
编码所述第一语法元素的取值为第一值时,编码第二语法元素;
编码所述第二语法元素的取值为第一值时,编码所述第三语法元素。
在本申请的一实施例中,所述方法还包括:
当前块使用帧内块复制技术的预测模式为合并模式时,编码所述第一语法元素的取值为第二值,以及编码第二语法元素。
在本申请的一实施例中,所述方法还包括:
在当前块使用变换模型列表进行预测时,编码所述第二语法元素为第二值,并将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素;所述第四语法元素用于指示变换模型在所述变换模型列表中的模型索引;所述相关语法元素信息还包括:所述第四语法元素。
在本申请的一实施例中,所述方法还包括:
在当前块使用变换模型列表进行预测时,构建所述变换模型列表。
在本申请的一实施例中,所述构建所述变换模型列表,包括:
依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到所述变换模型列表;
所述至少一种变换模型包括以下至少一种:
当前块的至少一个相邻位置的像素对应的第二变换模型;
当前块的至少一个非相邻位置的像素对应的第三变换模型;
历史编码过程中使用的第四变换模型;
时域的可用变换模型;
所述预设变换模型。
在本申请的一实施例中,所述预设变换模型包括:预设模型参数对应的模型或对第二变换模型、第三变换模型和第四变换模型、预设模型参数对应的模型和时域的可用变换模型中的至少一种进行偏移得到的模型。
在本申请的一实施例中,所述方法还包括:
针对当前块的任一相邻位置的像素或者当前块的任一非相邻位置的像素,若该像素满足变换条件,则获取当前块的该相邻位置的第二变换模型,或者,获取当前块的任一非相邻位置的像素对应的第三变换模型;其中,所述变换条件包括以下至少一种:
该像素所在块使用帧内块复制技术、变换模型标志位为有效和该像素所在块的大小满足第一预设尺寸。
在本申请的一实施例中,不同的至少一种变换模型包括以下至少一种:至少一种变换模型的变换类型不同、存在不同的模型参数,同一变换类型下使用不同模板区域。
在本申请的一实施例中,所述依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到所述变换模型列表,包括:
依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到中间变换模型列表;
对所述中间变换模型列表进行重排序,得到所述变换模型列表。
在本申请的一实施例中,所述对所述中间变换模型列表进行重排序,得到所述变换模型列表,包括:
遍历所述中间变换模型列表中的各个变换模型,确定所述各个变换模型的偏移值(offset);
采用所述各个变换模型,分别对参考块模板进行预测,确定各个变换模型各自的参考块模板预测;
确定每个变换模型的参考块模板预测和当前块模板之间的误差值;
基于每个变换模型的误差值,以及其对应的偏移值,确定所述各个变换模型的模板误差值;
根据各个变换模型的模板误差值,对所述各个变换模型进行重排序,得到所述变换模型列表。
在本申请的一实施例中,所述各个变换模型的模板误差值由小到大,对应所述变换模型列表的索引信息由小到大。
在本申请的一实施例中,在参考块模板不可用时,确定所述误差值为最大值。
在本申请的一实施例中,获取当前块所在的第一位置信息(左上角坐标)和当前块的当前尺寸;
基于所述第一位置信息和所述当前尺寸,确定当前块的至少一个相邻位置和当前块的至少一个非相邻位置。
在本申请的一实施例中,获取将编码过程中的使用的历史变换模型;
在所述历史变换模型与历史变换模型列表中存在相同模型时,则将所述历史变换模型列表中的相同模型移除,将所述历史变换模型添加至所述历史变换模型列表的第一顺序位;
在所述历史变换模型与历史变换模型列表中不存在相同模型时,则将所述历史变换模型添加至所述历史变换模型列表的第一顺序位。
在本申请的一实施例中,所述将所述历史变换模型添加至所述历史变换模型列表的第一顺序位,包括:
在所述历史变换模型列表满足第一预设列表长度时,将所述历史变换模型列表中的最后顺序位的变换模型移除后,将所述历史变换模型添加至所述历史变换模型列表的第一顺序位。
在本申请的一实施例中,所述第四变换模型是按照所述历史变换模型的由第一顺序位至最后顺序位的顺序,从所述历史变换模型中依次确定的。
在本申请的一实施例中,待添加的所述历史变换模型对应的块的尺寸在满足第二预设尺寸的情况下,基于所述历史变换模型更新所述历史变换模型列表。
在本申请的一实施例中,所述基于所述参考块和所述第一变换模型,确定当前块的预测块,包括:
采用所述第一变换模型,对当前块的参考块模板进行预测,确定参考块模板的像素的预测值;
确定各个像素的预测值和当前块模板的像素之间的总误差值;
基于总误差值,对各个像素进行平均,得到第一偏移值;
采用所述第一变换模型对所述参考块进行变换,并在每个像素对应的变换结果补偿所述第一偏移值,得到所述当前块的预测块;或者,采用所述第一偏移值对所述第一变换模型中的参数进行补偿,得到更新的第一变换模型,再采用所述更新后的第一变换模型对所述参考块进行变换。
在本申请的一实施例中,在所述当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测(即参考的cu_ibc_model_merge_flag为真)时,确定当前块的局部补偿标志位(LIC标志位)为第二值;
所述基于所述参考块和所述第一变换模型,确定当前块的预测块,包括:
采用所述第一变换模型和所述局部补偿标志位指示的局部补偿的变换模型,依次对所述参考块进行二次变换,确定所述当前块的预测块。或者,根据当前块模板和参考块模板推岛的局部补偿的变换模型,对参考块进行变换,确定所述当前块的预测块。
在本申请的一实施例中,所述编码所述第二语法元素,包括:
根据已编码信息,编码所述第二语法元素,其中,所述编码信息包括以下至少一种:
当前块的尺寸、当前块的CIIP标志位、GPM标志位、MBVD标志位、skip标志位和TM_merge标志位。
在本申请的一实施例中,所述根据已编码信息,编码所述第二语法元素,包括:
在所述已编码信息满足第一编码条件时,编码所述第二语法元素;
所述第一编码条件包括以下至少一个:
所述CIIP标志位的取值为第一值(假);
所述GPM标志位的取值为为第一值(假);
所述MBVD标志位为第一值(假);
所述skip标志位为第一值(假);
所述TM_merge标志位为第一值;
所述当前块的尺寸小于第三预设尺寸;
所述当前块的面积大于第一预设面积阈值。
在本申请的一实施例中,不同变换类型的各个变换模型,对应不同的参考块模板区域;
各个变换模型所述误差值为各自的参考块模板中的像素数的平均的模板误差值。
在本申请的一实施例中,在当前块使用变换技术,非变换模型列表进行预测时,确定第六变换模型;
基于所述参考块和所述第六变换模型,确定当前块的预测块;
编码第三语法元素为第一值或第二值,并编码第五语法元素;所述第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引。
在本申请的一实施例中,在所述当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测(即参考的cu_ibc_model_merge_flag为真)时,确定当前块的局部补偿标志位(LIC标志位)为第一值。
在本申请的一实施例中,所述编码所述第二语法元素,包括:
在序列级的语法元素、帧级的语法元素、片级语法元素、当前块的尺寸中的至少一个满足第二编码条件时,编码所述第二语法元素。
在本申请的一实施例中,若所述第一变换模型为在所述变换模型列表指示的至少一个其他变换模型,则将第四语法元素编码为第三值,其中,其他变换模型为其他参考块对应的变换方式。
在本申请的一实施例中,所述构建所述变换模型列表,包括:
获取推导出的局部补偿模型,将所述局部补偿模型添加至所述变换模型列表。
在本申请的一实施例中,确定对当前块的参考块,进行基于帧内块复制技术-帧内/帧间联合预测、帧内块复制技术-几何划分模式和帧内块复制技术-重建值重排序中的至少一种预测,得到参考块的参考预测块;
采用所述参考预测块对所述参考块进行更新。
在本申请的一实施例中,所述第一变换模型为使用多模式局部补偿技术时的局部补偿模型时,基于当前块模板和参考块模板重新计算多模式局部补偿模型的更新参数;
基于所述更新参数,更新所述第一变换模型。
在本申请的一实施例中,所述编码所述第二语法元素,包括:
根据相邻块的编码信息,从至少一个上下文模型中,确定第一上下文模型;
基于所述第一上下文模型,编码所述第二语法元素;或者,
采用等概率编码方式,编码所述第二语法元素。
在本申请的一实施例中,所述将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素,包括以下至少一种:
采用等概率编码方式,将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素;
采用第二上下文模型的编码方式,将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素;
部分采用第二上下文模型的编码方式,结合部分采用等概率编码方式,将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素。
在本申请的一实施例中,当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,编码第二语法元素信息的第一上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,编码第二语法元素信息的第一上下文模型的关系包括:相同或不相同。
在本申请的一实施例中,当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,编码第四语法元素信息的第二上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,编码第四语法元素信息的第二上下文模型的关系包括:相同或不相同。
在本申请的一实施例中,确定参考块的索引信息,将所述参考块的索引信息编码为第六语法元素,所述第六语法元素用于指示参考块的索引信息。
在本申请的一实施例中,基于所述参考块向量,确定参考块之后,所述方法还包括:
获取所述参考块的第二语法元素;
在当前块的合并候选块的第二语法元素的取值为第二值时,确定所述当前块的第二语法元素为第二值;
基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型。
在本申请的一实施例中,所述基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型,包括:
将所述参考的变换模型,作为所述第一变换模型。
在本申请的一实施例中,所述基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型,包括:
确定所述参考的变换模型的第一变换模型类型;
根据参考块模板和当前块模板,重新推导与所述第一变换类型一致的所述第一变换模型。
在本申请的一实施例中,所述基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型,包括:
获取合并候选块的翻转参考块标志位;
在所述翻转参考块标志位的取值为第二值时,基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型。
在本申请的一实施例中,所述方法还包括:
在当前块的所述第二语法元素为第一值时,或者,在当前块的合并候选块的第二语法元素为第一值时,基于所述参考块,确定所述当前块的预测块;
基于当前块的预测块,确定当前块的重建像素值;
基于当前块的重建像素值和参考块的重建像素值,在模板区域或在块内,构建当前块的第五变换模型,供后续编码过程使用。
在本申请的一实施例中,所述基于所述参考块和所述第一变换模型,确定当前块的预测块之后,所述方法还包括:
基于当前块的预测块,确定当前块的重建像素值;
基于当前块的重建像素值和参考块的重建像素值,在模板区域或在块内,构建当前块的第七变换模型;
采用所述第七变换模型代替所述第一变换模型,更新变换模型列表;或者,
采用所述第七变换模型和所述第一变换模型中误差值最小的变换模型,更新变换模型列表;或者,
采用所述第七变换模型,更新变换模型列表。
在本申请的一实施例中,所述方法还包括:
当第一变换模型为局部补偿模型时,获取当前编码块相邻的第一已重建区域像素值和参考块相邻的第二已重建区域像素值;
基于所述第一已重建区域像素值和所述第二已重建区域像素值,推导所述局部补偿模型的第一参数(α),并由第一参数确定其第二参数(β);
采用局部补偿模型的原始第一参数,和所述第二参数,确定第三变换模型;
采用所述第三变换模型对所述参考块进行变换,得到所述当前块的预测块。(隐含了offest=0)
在本申请的一实施例中,所述变换模型列表中包含的第二变换模型、第三变换模型和第四变换模型对应的块的预测类型为帧内模板匹配预测和帧内块复制技术中的任意一种。
在本申请的一实施例中,基于所述第一变换模型更新历史变换模型列表。
在本申请的一实施例中,在确定当前块的预测模式为非帧内块复制技术进行预测时,编码所述第一语法元素为第一值。
可以理解的是,编码器可以从包括至少两种类型的变换模型的变换模型列表中,去选择第一变换模型;采用选中的第一变换模型来进行对参考块的变换,进而确定出预测块。因此,在编码实现的过程中,用于实现变换的第一变换模型是可以从变换模型列表中进行选择确定的,可以保证选择的多样性,从而使得在预测的过程的可能性变高,提高了预测的多样性,最终可以提升编码性能。
本申请实施例提供了一种码流,其中,所述码流是根据待编码信息进行比特编码生成的;其中,所述待编码信息包括下述至少一项:第一语法元素、第二语法元素、第三语法元素、第四语法元素、第五语法元素、第六语法元素、当前块的尺寸、当前块的CIIP标志位、GPM标志位、MBVD标志位、skip标志位、TM_merge标志位和上下文模型;其中,
所述第一语法元素用于用于指示当前块使用帧内块复制技术的预测模式;
所述第二语法元素用于指示当前块是否使用变换模型列表进行预测;
所述第三语法元素用于指示是否使用变换技术进行预测;
所述第四语法元素用于指示变换模型在所述变换模型列表中的模型索引;
所述第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引;
所述第六语法元素用于指示参考块的索引信息。
如图13所示,本申请实施例提供了一种解码器1,包括:
解码部分11,被配置为获取当前块的相关语法元素;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测;
第一确定部分12,被配置为确定当前块使用所述帧内块复制技术得到的参考块;
根据所述相关语法元素,确定基于构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;
第一预测部分13,被配置为基于所述参考块和所述第一变换模型,确定当前块的预测块。
在本申请的一些实施例中,所述相关语法元素至少包括:第二语法元素;
其中,所述第二语法元素用于指示当前块是否使用变换模型列表进行预测。
所述相关语法元素还包括:第一语法元素;所述第一语法元素用于指示当前块使用帧内块复制技术的预测模式。
在本申请的一些实施例中,所述解码部分11,还被配置为解码所述第一语法元素;
根据所述第一语法元素,确定当前块使用帧内块复制技术的预测模式,并解码所述第二语法元素。
在本申请的一些实施例中,所述第一确定部分12,还被配置为在所述第一语法元素的取值为第一值时,确定当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式;
所述解码部分11,还被配置为解码第三语法元素,所述第三语法元素用于指示是否使用变换技术进行预测;所述第三语法元素属于所述相关语法元素;
在所述第三语法元素的取值为第二值时,解码所述第二语法元素;或,
在所述第三语法元素的取值为第一值时,解码所述第二语法元素。
或者,所述第一确定部分12,还被配置为在所述第一语法元素的取值为第一值时,确定当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式,并所述解码部分11,还被配置为解码第二语法元素;
在所述第二语法元素的取值为第一值时,解码第三语法元素。
在本申请的一些实施例中,所述第一确定部分12,还被配置为在所述第一语法元素的取值为第二值时,确定当前块使用帧内块复制技术的预测模式为合并模式,并所述解码部分11,还被配置解码所述第二语法元素。
在本申请的一些实施例中,所述解码部分11,还被配置在所述第二语法元素的取值为第二值时,表征当前块使用变换模型列表进行预测,解码第四语法元素,确定变换模型的索引信息,并跳过当前块从合并候选块继承局部补偿标志位的过程;所述第四语法元素用于指示变换模型在所述变换模型列表中的模型索引;所述相关语法元素信息还包括:所述第四语法元素;
所述第一确定部分12,还被配置为基于所述变换模型的索引信息,在构建的所述变换模型列表中,确定所述第一变换模型。
在本申请的一些实施例中,所述第一确定部分12,还被配置为在所述第二语法元素的取值为第二值时,构建所述变换模型列表。
在本申请的一些实施例中,所述第一确定部分12,还被配置为依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到所述变换模型列表;
所述至少一种变换模型包括以下至少一种:
当前块的至少一个相邻位置的像素对应的第二变换模型;
当前块的至少一个非相邻位置的像素对应的第三变换模型;
历史解码过程中使用的第四变换模型;
时域的可用变换模型;
所述预设变换模型。
在本申请的一些实施例中,所述预设变换模型包括:预设模型参数对应的模型或对第二变换模型、第三变换模型和第四变换模型、预设模型参数对应的模型和时域的可用变换模型中的至少一种进行偏移得到的模型。
在本申请的一些实施例中,所述第一确定部分12,还被配置为针对当前块的任一相邻位置的像素或者当前块的任一非相邻位置的像素,若该像素满足变换条件,则获取当前块的该相邻位置的第二变换模型,或者,获取当前块的任一非相邻位置的像素对应的第三变换模型;其中,所述变换条件包括以下至少一种:
该像素所在块使用帧内块复制技术、变换模型标志位为有效和该像素所在块的大小满足第一预设尺寸。
在本申请的一些实施例中,不同的至少一种变换模型包括以下至少一种:至少一种变换模型的变换类型不同、存在不同的模型参数,同一变换类型下使用不同模板区域。
在本申请的一些实施例中,所述第一确定部分12,还被配置为依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到中间变换模型列表;
对所述中间变换模型列表进行重排序,得到所述变换模型列表。
在本申请的一些实施例中,所述第一确定部分12,还被配置为遍历所述中间变换模型列表中的各个变换模型,确定所述各个变换模型的偏移值;
采用所述各个变换模型,分别对参考块模板进行预测,确定各个变换模型各自的参考块模板预测;
确定每个变换模型的参考块模板预测和当前块模板之间的误差值;
基于每个变换模型的误差值,以及其对应的偏移值,确定所述各个变换模型的模板误差值;
根据各个变换模型的模板误差值,对所述各个变换模型进行重排序,得到所述变换模型列表。
在本申请的一些实施例中,所述各个变换模型的模板误差值由小到大,对应所述变换模型列表的索引信息由小到大。
在本申请的一些实施例中,在参考块模板不可用时,确定所述误差值为最大值。
在本申请的一些实施例中,所述第一确定部分12,还被配置为获取当前块所在的第一位置信息和当前块的当前尺寸;
基于所述第一位置信息和所述当前尺寸,确定当前块的至少一个相邻位置和当前块的至少一个非相邻位置。
在本申请的一些实施例中,所述第一确定部分12,还被配置为获取将解码过程中的使用的历史变换模型;
在所述历史变换模型与历史变换模型列表中存在相同模型时,则将所述历史变换模型列表中的相同模型移除,将所述历史变换模型添加至所述历史变换模型列表的第一顺序位;
在所述历史变换模型与历史变换模型列表中不存在相同模型时,则将所述历史变换模型添加至所述历史变换模型列表的第一顺序位。
在本申请的一些实施例中,所述第一确定部分12,还被配置为在所述历史变换模型列表满足第一预设列表长度时,将所述历史变换模型列表中的最后顺序位的变换模型移除后,将所述历史变换模型添加至所述历史变换模型列表的第一顺序位。
在本申请的一些实施例中,所述第四变换模型是按照所述历史变换模型的由第一顺序位至最后顺序位的顺序,从所述历史变换模型中依次确定的。
在本申请的一些实施例中,待添加的所述历史变换模型对应的块的尺寸在满足第二预设尺寸的情况下,基于所述历史变换模型更新所述历史变换模型列表。
在本申请的一些实施例中,所述第一预测部分13,还被配置为采用所述第一变换模型,对当前块的参考块模板进行预测,确定参考块模板的像素的预测值;确定各个像素的预测值和当前块模板的像素之间的总误差值;基于总误差值,对各个像素进行平均,得到第一偏移值;采用所述第一变换模型对所述参考块进行变换,并在每个像素对应的变换结果补偿所述第一偏移值,得到所述当前块的预测块;或者,采用所述第一偏移值对所述第一变换模型中的参数进行补偿,得到更新的第一变换模型,再采用所述更新后的第一变换模型对所述参考块进行变换。
在本申请的一些实施例中,所述第一确定部分12,还被配置为在所述当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测时,确定当前块的局部补偿标志位为第二值;
所述第一预测部分13,还被配置为采用所述第一变换模型和所述局部补偿标志位指示的局部补偿的变换模型,依次对所述参考块进行二次变换,确定所述当前块的预测块。
在本申请的一些实施例中,所述解码部分11,还被配置根据已解码信息,解码所述第二语法元素,其中,所述已解码信息包括以下至少一种:
当前块的尺寸、当前块的CIIP标志位、GPM标志位、MBVD标志位、skip标志位和TM_merge标志位。
在本申请的一些实施例中,所述解码部分11,还被配置在所述已解码信息满足第一解码条件时,解码所述第二语法元素;
所述第一解码条件包括以下至少一个:
所述CIIP标志位的取值为第一值;
所述GPM标志位的取值为为第一值;
所述MBVD标志位为第一值;
所述skip标志位为第一值;
所述TM_merge标志位为第一值;
所述当前块的尺寸小于第三预设尺寸;
所述当前块的面积大于第一预设面积阈值。
在本申请的一些实施例中,不同变换类型的各个变换模型,对应不同的参考块模板区域;
各个变换模型所述误差值为各自的参考块模板中的像素数的平均的模板误差值。
在本申请的一些实施例中,所述解码部分11,还被配置所述在所述第三语法元素的取值为第一值,解码所述第二语法元素之后,在所述第三语法元素的取值为第二值时,解码第五语法元素;所述第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引;
所述第一确定部分12,还被配置为基于所述第五语法元素,确定第六变换模型;
所述第一预测部分13,还被配置为基于所述参考块和所述第六变换模型,确定当前块的预测块。
在本申请的一些实施例中,所述第一确定部分12,还被配置为在所述当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测时,确定当前块的局部补偿标志位为第一值。
在本申请的一些实施例中,所述解码部分11,还被配置在序列级的语法元素、帧级的语法元素、片级语法元素、当前块的尺寸中的至少一个满足第二解码条件时,解码所述第二语法元素。
在本申请的一些实施例中,所述解码部分11,还被配置所述在所述第三语法元素的取值为第二值,解码所述第二语法元素之后,在所述第三语法元素的取值为第一值时,解码第五语法元素;所述第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引;
所述第一确定部分12,还被配置为基于所述第五语法元素,确定第六变换模型;
所述第一预测部分13,还被配置为基于所述参考块和所述第六变换模型,确定当前块的预测块。
在本申请的一些实施例中,所述第一确定部分12,还被配置为若变换模型的所述第四语法元素为第三值,则在所述变换模型列表指示至少一个其他变换模型,其中,其他变换模型为其他参考块对应的变换方式。
在本申请的一些实施例中,所述第一确定部分12,还被配置为获取推导出的局部补偿模型,将所述局部补偿模型添加至所述变换模型列表。
在本申请的一些实施例中,所述第一确定部分12,还被配置为确定对当前块的参考块,进行基于帧内块复制技术-帧内/帧间联合预测、帧内块复制技术-几何划分模式和帧内块复制技术-重建值重排序中的至少一种预测,得到参考块的参考预测块;
采用所述参考预测块对所述参考块进行更新。
在本申请的一些实施例中,所述第一确定部分12,还被配置为所述第一变换模型为使用多模式局部补偿技术时的局部补偿模型时,基于当前块模板和参考块模板重新计算多模式局部补偿模型的更新参数;
基于所述更新参数,更新所述第一变换模型。
在本申请的一些实施例中,所述解码部分11,还被配置根据相邻块的解码信息,从至少一个上下文模型中,确定第一上下文模型;
基于所述第一上下文模型,解码所述第二语法元素;或者,
采用等概率解码方式,解码所述第二语法元素。
在本申请的一些实施例中,所述解码部分11,还被配置包括以下至少一种:
采用等概率解码方式,解码所述第四语法元素,确定变换模型的所述索引信息;
采用第二上下文模型的解码方式,解码所述第四语法元素,确定变换模型的所述索引信息;
部分采用第二上下文模型的解码方式,结合部分采用等概率解码方式,解码所述第四语法元素,确定变换模型的所述索引信息。
在本申请的一些实施例中,当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,解码第二语法元素信息的第一上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,解码第二语法元素信息的第一上下文模型的关系包括:相同或不相同。
在本申请的一些实施例中,当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,解码第四语法元素信息的第二上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,解码第四语法元素信息的第二上下文模型的关系包括:相同或不相同。
在本申请的一些实施例中,所述解码部分11,还被配置获取当前块的参考块的第六语法元素,所述第六语法元素用于指示参考块的索引信息;
所述第一确定部分12,还被配置为基于所述第六语法元素,确定当前块使用所述帧内块复制技术得到的参考块。
在本申请的一些实施例中,所述第一确定部分12,还被配置为所述确定当前块使用所述帧内块复制技术得到的参考块之后,获取当前块的合并候选块的第二语法元素;
在所述合并候选块的第二语法元素的取值为第二值时,确定所述当前块的第二语法元素为第二值;
基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型。
在本申请的一些实施例中,所述第一确定部分12,还被配置为将所述参考的变换模型,作为所述第一变换模型。
在本申请的一些实施例中,所述第一确定部分12,还被配置为确定所述参考的变换模型的第一变换模型类型;
根据参考块模板和当前块模板,重新推导与所述第一变换类型一致的所述第一变换模型。
在本申请的一些实施例中,所述第一确定部分12,还被配置为获取合并候选块的翻转参考块标志位;
在所述翻转参考块标志位的取值为第二值时,基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型。
在本申请的一些实施例中,所述第一确定部分12,还被配置为在当前块的所述第二语法元素为第一值时,或者,在当前块的合并候选块的第二语法元素为第一值时,基于所述参考块,确定所述当前块的预测块;
基于当前块的预测块,确定当前块的重建像素值;
基于当前块的重建像素值和参考块的重建像素值,在模板区域或在块内,构建当前块的第五变换模型,供后续解码过程使用。
在本申请的一些实施例中,所述第一确定部分12,还被配置为所述基于所述参考块和所述第一变换模型,确定当前块的预测块之后,基于当前块的预测块,确定当前块的重建像素值;
基于当前块的重建像素值和参考块的重建像素值,在模板区域或在块内,构建当前块的第七变换模型;
采用所述第七变换模型代替所述第一变换模型,更新变换模型列表;或者,
采用所述第七变换模型和所述第一变换模型中误差值最小的变换模型,更新变换模型列表;或者,
采用所述第七变换模型,更新变换模型列表。
在本申请的一些实施例中,所述第一确定部分12,还被配置为当第一变换模型为局部补偿模型时,获取当前编码块相邻的第一已重建区域像素值和参考块相邻的第二已重建区域像素值;
基于所述第一已重建区域像素值和所述第二已重建区域像素值,推导所述局部补偿模型的第一参数,并由第一参数确定其第二参数;
采用局部补偿模型的原始第一参数,和所述第二参数,确定第三变换模型;
所述第一预测部分13,还被配置为采用所述第三变换模型对所述参考块进行变换,得到所述当前块的预测块。
在本申请的一些实施例中,所述变换模型列表中包含的第二变换模型、第三变换模型和第四变换模型对应的块的预测类型为帧内模板匹配预测和帧内块复制技术中的任意一种。
在本申请的一些实施例中,基于所述第一变换模型更新历史变换模型列表。
可以理解的是,解码器各个功能单元还执行前述实施例中任一项所述的解码方法。
可以理解地,在本申请实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
因此,本申请实施例提供了一种计算机可读存储介质,应用于解码器170,该计算机可读存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现前述实施例中任一项所述的解码方法。
基于解码器170的组成以及计算机可读存储介质,参见图14,其示出了本申请实施例提供的解码器170的具体硬件结构示意图。如图14所示,解码器170可以包括:第一通信接口1801、第一存储器1802和第一处理器1803;各个组件通过第一总线系统1804耦合在一起。可理解,第一总线系统1804用于实现这些组件之间的连接通信。第一总线系统1804除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图14中将各种总线都标为第一总线系统1804。其中,
第一通信接口1801,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第一存储器1802,用于存储能够在第一处理器1703上运行的计算机程序;
第一处理器1803,用于在运行所述计算机程序时,解码方法。
可以理解,本申请实施例中的第一存储器1802可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的第一存储器1802旨在包括但不限于这些和任意其它适合类型的存储器。
而第一处理器1803可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第一处理器1803中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第一处理器1803可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第一存储器1802,第一处理器1803读取第一存储器1802中的信息,结合其硬件完成上述方法的步骤。
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。
可选地,作为另一个实施例,第一处理器1803还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的解码方法。
本实施例提供了一种解码器,对于该解码器而言,解码器可以从包括至少两种类型的变换模型的变换模型列表中,去选择第一变换模型;采用选中的第一变换模型来进行对参考块的变换,进而确定出预测块。因此,在解码实现的过程中,用于实现变换的第一变换模型是可以从变换模型列表中进行选择确定的,可以保证选择的多样性,从而使得在预测的过程的可能性变高,提高了预测的多样性,最终可以提升解码性能。
在本申请的再一实施例中,基于前述实施例相同的发明构思,参见图15,其示出了本申请实施例提供的一种编码器2的组成结构示意图。包括:
第二确定部分20,被配置为确定当前块的候选块向量列表;基于所述候选块向量列表,确定参考块向量;基于所述参考块向量,确定参考块;在确定当前块的预测模式为帧内块复制技术结合变换模型列表进行预测时,从构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;
第二预测部分21,被配置为基于所述参考块和所述第一变换模型,确定当前块的预测块;
编码部分22,被配置为编码当前块的相关语法元素,通过写入部分23将所得到的编码比特写入码流;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测。
在本申请的一些实施例中,所述相关语法元素至少包括:第二语法元素;
其中,所述第二语法元素用于指示当前块是否使用变换模型列表进行预测;
所述相关语法元素还包括:第一语法元素,所述第一语法元素用于指示当前块使用帧内块复制技术的预测模式。
在本申请的一些实施例中,所述帧内块复制技术的预测模式包括:合并模式和优化的运动矢量预测模式;
所述编码部分22,还被配置为当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,编码所述第一语法元素的取值为第一值,以及编码第三语法元素;所述第三语法元素用于指示是否使用变换技术进行预测;所述第三语法元素属于所述相关语法元素;
编码所述第三语法元素的取值为第二值时,编码所述第二语法元素;或,
编码所述第三语法元素的取值为第一值,编码所述第二语法元素;或者,
编码所述第一语法元素的取值为第一值时,编码第二语法元素;
编码所述第二语法元素的取值为第一值时,编码所述第三语法元素。
在本申请的一些实施例中,所述编码部分22,还被配置为当前块使用帧内块复制技术的预测模式为合并模式时,编码所述第一语法元素的取值为第二值,以及编码第二语法元素。
在本申请的一些实施例中,所述编码部分22,还被配置为
在当前块使用变换模型列表进行预测时,编码所述第二语法元素为第二值,并将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素;所述第四语法元素用于指示变换模型在所述变换模型列表中的模型索引;所述相关语法元素信息还包括:所述第四语法元素。
在本申请的一些实施例中,所述第二确定部分20,还被配置为在当前块使用变换模型列表进行预测时,构建所述变换模型列表。
在本申请的一些实施例中,所述第二确定部分20,还被配置为依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到所述变换模型列表;
所述至少一种变换模型包括以下至少一种:
当前块的至少一个相邻位置的像素对应的第二变换模型;
当前块的至少一个非相邻位置的像素对应的第三变换模型;
历史编码过程中使用的第四变换模型;
时域的可用变换模型;
所述预设变换模型。
在本申请的一些实施例中,所述预设变换模型包括:预设模型参数对应的模型或对第二变换模型、第三变换模型和第四变换模型、预设模型参数对应的模型和时域的可用变换模型中的至少一种进行偏移得到的模型。
在本申请的一些实施例中,所述第二确定部分20,还被配置为针对当前块的任一相邻位置的像素或者当前块的任一非相邻位置的像素,若该像素满足变换条件,则获取当前块的该相邻位置的第二变换模型,或者,获取当前块的任一非相邻位置的像素对应的第三变换模型;其中,所述变换条件包括以下至少一种:
该像素所在块使用帧内块复制技术、变换模型标志位为有效和该像素所在块的大小满足第一预设尺寸。
在本申请的一些实施例中,不同的至少一种变换模型包括以下至少一种:至少一种变换模型的变换类型不同、存在不同的模型参数,同一变换类型下使用不同模板区域。
在本申请的一些实施例中,所述第二确定部分20,还被配置为依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到中间变换模型列表;
对所述中间变换模型列表进行重排序,得到所述变换模型列表。
在本申请的一些实施例中,所述第二确定部分20,还被配置为遍历所述中间变换模型列表中的各个变换模型,确定所述各个变换模型的偏移值;
采用所述各个变换模型,分别对参考块模板进行预测,确定各个变换模型各自的参考块模板预测;
确定每个变换模型的参考块模板预测和当前块模板之间的误差值;
基于每个变换模型的误差值,以及其对应的偏移值,确定所述各个变换模型的模板误差值;
根据各个变换模型的模板误差值,对所述各个变换模型进行重排序,得到所述变换模型列表。
在本申请的一些实施例中,所述各个变换模型的模板误差值由小到大,对应所述变换模型列表的索引信息由小到大。
在本申请的一些实施例中,在参考块模板不可用时,确定所述误差值为最大值。
在本申请的一些实施例中,所述第二确定部分20,还被配置为获取当前块所在的第一位置信息和当前块的当前尺寸;
基于所述第一位置信息和所述当前尺寸,确定当前块的至少一个相邻位置和当前块的至少一个非相邻位置。
在本申请的一些实施例中,所述第二确定部分20,还被配置为获取将编码过程中的使用的历史变换模型;
在所述历史变换模型与历史变换模型列表中存在相同模型时,则将所述历史变换模型列表中的相同模型移除,将所述历史变换模型添加至所述历史变换模型列表的第一顺序位;
在所述历史变换模型与历史变换模型列表中不存在相同模型时,则将所述历史变换模型添加至所述历史变换模型列表的第一顺序位。
在本申请的一些实施例中,所述第二确定部分20,还被配置为在所述历史变换模型列表满足第一预设列表长度时,将所述历史变换模型列表中的最后顺序位的变换模型移除后,将所述历史变换模型添加至所述历史变换模型列表的第一顺序位。
在本申请的一些实施例中,所述第四变换模型是按照所述历史变换模型的由第一顺序位至最后顺序位的顺序,从所述历史变换模型中依次确定的。
在本申请的一些实施例中,所述第二确定部分20,还被配置为待添加的所述历史变换模型对应的块的尺寸在满足第二预设尺寸的情况下,基于所述历史变换模型更新所述历史变换模型列表。
在本申请的一些实施例中,所述第二预测部分21,还被配置为采用所述第一变换模型,对当前块的参考块模板进行预测,确定参考块模板的像素的预测值;
确定各个像素的预测值和当前块模板的像素之间的总误差值;
基于总误差值,对各个像素进行平均,得到第一偏移值;
采用所述第一变换模型对所述参考块进行变换,并在每个像素对应的变换结果补偿所述第一偏移值,得到所述当前块的预测块;或者,采用所述第一偏移值对所述第一变换模型中的参数进行补偿,得到更新的第一变换模型,再采用所述更新后的第一变换模型对所述参考块进行变换。
在本申请的一些实施例中,所述第二确定部分20,还被配置为在所述当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测时,确定当前块的局部补偿标志位为第二值;
所述第二预测部分21,还被配置为采用所述第一变换模型和所述局部补偿标志位指示的局部补偿的变换模型,依次对所述参考块进行二次变换,确定所述当前块的预测块。
在本申请的一些实施例中,所述编码部分22,还被配置为根据已编码信息,编码所述第二语法元素,其中,所述编码信息包括以下至少一种:
当前块的尺寸、当前块的CIIP标志位、GPM标志位、MBVD标志位、skip标志位和TM_merge标志位。
在本申请的一些实施例中,所述根据已编码信息,编码所述第二语法元素,包括:
在所述已编码信息满足第一编码条件时,编码所述第二语法元素;
所述第一编码条件包括以下至少一个:
所述CIIP标志位的取值为第一值;
所述GPM标志位的取值为为第一值;
所述MBVD标志位为第一值;
所述skip标志位为第一值;
所述TM_merge标志位为第一值;
所述当前块的尺寸小于第三预设尺寸;
所述当前块的面积大于第一预设面积阈值。
在本申请的一些实施例中,不同变换类型的各个变换模型,对应不同的参考块模板区域;
各个变换模型所述误差值为各自的参考块模板中的像素数的平均的模板误差值。
在本申请的一些实施例中,所述编码部分22,还被配置为在当前块使用变换技术,非变换模型列表进行预测时,确定第六变换模型;
所述第二预测部分21,还被配置为基于所述参考块和所述第六变换模型,确定当前块的预测块;
所述编码部分22,还被配置编码第三语法元素为第一值或第二值,并编码第五语法元素;所述第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引。
在本申请的一些实施例中,在所述当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测时,确定当前块的局部补偿标志位为第一值。
在本申请的一些实施例中,所述编码部分22,还被配置为在序列级的语法元素、帧级的语法元素、片级语法元素、当前块的尺寸中的至少一个满足第二编码条件时,编码所述第二语法元素。
在本申请的一些实施例中,若所述第一变换模型为在所述变换模型列表指示的至少一个其他变换模型,则将第四语法元素编码为第三值,其中,其他变换模型为其他参考块对应的变换方式。
在本申请的一些实施例中,所述第二确定部分20,还被配置为获取推导出的局部补偿模型,将所述局部补偿模型添加至所述变换模型列表。
在本申请的一些实施例中,所述第二确定部分20,还被配置为确定对当前块的参考块,进行基于帧内块复制技术-帧内/帧间联合预测、帧内块复制技术-几何划分模式和帧内块复制技术-重建值重排序中的至少一种预测,得到参考块的参考预测块;
采用所述参考预测块对所述参考块进行更新。
在本申请的一些实施例中,所述第二确定部分20,还被配置为所述第一变换模型为使用多模式局部补偿技术时的局部补偿模型时,基于当前块模板和参考块模板重新计算多模式局部补偿模型的更新参数;
基于所述更新参数,更新所述第一变换模型。
在本申请的一些实施例中,所述编码部分22,还被配置为根据相邻块的编码信息,从至少一个上下文模型中,确定第一上下文模型;
基于所述第一上下文模型,编码所述第二语法元素;或者,
采用等概率编码方式,编码所述第二语法元素。
在本申请的一些实施例中,所述编码部分22,还被配置为包括以下至少一种:
采用等概率编码方式,将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素;
采用第二上下文模型的编码方式,将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素;
部分采用第二上下文模型的编码方式,结合部分采用等概率编码方式,将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素。
在本申请的一些实施例中,当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,编码第二语法元素信息的第一上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,编码第二语法元素信息的第一上下文模型的关系包括:相同或不相同。
在本申请的一些实施例中,当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,编码第四语法元素信息的第二上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,编码第四语法元素信息的第二上下文模型的关系包括:相同或不相同。
在本申请的一些实施例中,确定参考块的索引信息,将所述参考块的索引信息编码为第六语法元素,所述第六语法元素用于指示参考块的索引信息。
在本申请的一些实施例中,所述第二确定部分20,还被配置为基于所述参考块向量,确定参考块之后,获取所述参考块的第二语法元素;
在当前块的合并候选块的第二语法元素的取值为第二值时,确定所述当前块的第二语法元素为第二值;
基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型。
在本申请的一些实施例中,所述第二确定部分20,还被配置为将所述参考的变换模型,作为所述第一变换模型。
在本申请的一些实施例中,所述第二确定部分20,还被配置为确定所述参考的变换模型的第一变换模型类型;
根据参考块模板和当前块模板,重新推导与所述第一变换类型一致的所述第一变换模型。
在本申请的一些实施例中,所述第二确定部分20,还被配置为获取合并候选块的翻转参考块标志位;
在所述翻转参考块标志位的取值为第二值时,基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型。
在本申请的一些实施例中,所述第二确定部分20,还被配置为在当前块的所述第二语法元素为第一值时,或者,在当前块的合并候选块的第二语法元素为第一值时,基于所述参考块,确定所述当前块的预测块;
基于当前块的预测块,确定当前块的重建像素值;
基于当前块的重建像素值和参考块的重建像素值,在模板区域或在块内,构建当前块的第五变换模型,供后续编码过程使用。
在本申请的一些实施例中,所述第二确定部分20,还被配置为所述基于所述参考块和所述第一变换模型,确定当前块的预测块之后,基于当前块的预测块,确定当前块的重建像素值;
基于当前块的重建像素值和参考块的重建像素值,在模板区域或在块内,构建当前块的第七变换模型;
采用所述第七变换模型代替所述第一变换模型,更新变换模型列表;或者,
采用所述第七变换模型和所述第一变换模型中误差值最小的变换模型,更新变换模型列表;或者,
采用所述第七变换模型,更新变换模型列表。
在本申请的一些实施例中,所述第二确定部分20,还被配置为当第一变换模型为局部补偿模型时,获取当前编码块相邻的第一已重建区域像素值和参考块相邻的第二已重建区域像素值;
基于所述第一已重建区域像素值和所述第二已重建区域像素值,推导所述局部补偿模型的第一参数,并由第一参数确定其第二参数;
采用局部补偿模型的原始第一参数,和所述第二参数,确定第三变换模型;
采用所述第三变换模型对所述参考块进行变换,得到所述当前块的预测块。
在本申请的一些实施例中,所述变换模型列表中包含的第二变换模型、第三变换模型和第四变换模型对应的块的预测类型为帧内模板匹配预测和帧内块复制技术中的任意一种。
在本申请的一些实施例中,所述第二确定部分20,还被配置为基于所述第一变换模型更新历史变换模型列表。
在本申请的一些实施例中,所述编码部分22,还被配置为在确定当前块的预测模式为非帧内块复制技术进行预测时,编码所述第一语法元素为第一值。
可以理解的是,编码器各个功能单元还执行前述实施例中任一项所述的编码方法。
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本实施例提供了一种计算机可读存储介质,应用于编码器190,该计算机可读存储介质存储有计算机程序,所述计算机程序被第二处理器执行时实现前述实施例中任一项所述的编码方法。
基于编码器190的组成以及计算机可读存储介质,参见图16,其示出了本申请实施例提供的编码器190的具体硬件结构示意图。如图16所示,编码器190可以包括:第二通信接口2001、第二存储器2002和第二处理器2003;各个组件通过第二总线系统2004耦合在一起。可理解,第二总线系统2004用于实现这些组件之间的连接通信。第二总线系统2004除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图16中将各种总线都标为第二总线系统2004。其中,
第二通信接口2001,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第二存储器2002,用于存储能够在第二处理器2003上运行的计算机程序;
第二处理器2003,用于在运行所述计算机程序时,执行编码方法。
可选地,作为另一个实施例,第二处理器2003还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的编码方法。
可以理解,第二存储器2002与第一存储器1802的硬件功能类似,第二处理器2003与第一处理器1803的硬件功能类似;这里不再详述。
本实施例提供了一种编码器,对于该编码器而言,编码器可以从包括至少两种类型的变换模型的变换模型列表中,去选择第一变换模型;采用选中的第一变换模型来进行对参考块的变换,进而确定出预测块。因此,在编码实现的过程中,用于实现变换的第一变换模型是可以从变换模型列表中进行选择确定的,可以保证选择的多样性,从而使得在预测的过程的可能性变高,提高了预测的多样性,最终可以提升编码性能。
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
工业实用性
本申请实施例提供一种编解码方法、码流、编码器、解码器以及存储介质,解码器或编码器可以从包括至少两种类型的变换模型的变换模型列表中,去选择第一变换模型;采用选中的第一变换模型来进行对参考块的变换,进而确定出预测块。因此,在编解码实现的过程中,用于实现变换的第一变换模型是可以从变换模型列表中进行选择确定的,可以保证选择的多样性,从而使得在预测的过程的可能性变高,提高了预测的多样性,最终可以提升编解码性能。

Claims (99)

  1. 一种解码方法,应用于解码器,所述方法包括:
    获取当前块的相关语法元素;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测;
    确定当前块使用所述帧内块复制技术得到的参考块;
    根据所述相关语法元素,确定基于构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;
    基于所述参考块和所述第一变换模型,确定当前块的预测块。
  2. 根据权利要求1所述的方法,其中,所述相关语法元素至少包括:第二语法元素;
    其中,所述第二语法元素用于指示当前块是否使用变换模型列表进行预测。
    所述相关语法元素还包括:第一语法元素;所述第一语法元素用于指示当前块使用帧内块复制技术的预测模式。
  3. 根据权利要求2所述的方法,其中,所述获取当前块的相关语法元素,包括:
    解码所述第一语法元素;
    根据所述第一语法元素,确定当前块使用帧内块复制技术的预测模式,并解码所述第二语法元素。
  4. 根据权利要求3所述的方法,其中,所述根据所述第一语法元素,确定当前块使用帧内块复制技术的预测模式,并解码所述第二语法元素,包括:
    在所述第一语法元素的取值为第一值时,确定当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式,并解码第三语法元素,所述第三语法元素用于指示是否使用变换技术进行预测;所述第三语法元素属于所述相关语法元素;
    在所述第三语法元素的取值为第二值时,解码所述第二语法元素;或,
    在所述第三语法元素的取值为第一值时,解码所述第二语法元素。
    或者,在所述第一语法元素的取值为第一值时,确定当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式,并解码第二语法元素;
    在所述第二语法元素的取值为第一值时,解码第三语法元素。
  5. 根据权利要求3所述的方法,其中,所述根据所述第一语法元素,确定当前块使用帧内块复制技术的预测模式,并解码所述第二语法元素,包括:
    在所述第一语法元素的取值为第二值时,确定当前块使用帧内块复制技术的预测模式为合并模式,并解码所述第二语法元素。
  6. 根据权利要求3至5任一项所述的方法,其中,所述根据所述相关语法元素,确定基于构建的变换模型列表得到的第一变换模型,包括:
    在所述第二语法元素的取值为第二值时,表征当前块使用变换模型列表进行预测,解码第四语法元素,确定变换模型的索引信息,并跳过当前块从合并候选块继承局部补偿标志位的过程;所述第四语法元素用于指示变换模型在所述变换模型列表中的模型索引;所述相关语法元素信息还包括:所述第四语法元素;
    基于所述变换模型的索引信息,在构建的所述变换模型列表中,确定所述第一变换模型。
  7. 根据权利要求2至6任一项所述的方法,其中,所述方法还包括:
    在所述第二语法元素的取值为第二值时,构建所述变换模型列表。
  8. 根据权利要求7所述的方法,其中,所述构建所述变换模型列表,包括:
    依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到所述变换模型列表;
    所述至少一种变换模型包括以下至少一种:
    当前块的至少一个相邻位置的像素对应的第二变换模型;
    当前块的至少一个非相邻位置的像素对应的第三变换模型;
    历史解码过程中使用的第四变换模型;
    时域的可用变换模型;
    所述预设变换模型。
  9. 根据权利要求8所述的方法,其中,
    所述预设变换模型包括:预设模型参数对应的模型或对第二变换模型、第三变换模型和第四变换模型、预设模型参数对应的模型和时域的可用变换模型中的至少一种进行偏移得到的模型。
  10. 根据权利要求8或9所述的方法,其中,所述方法还包括:
    针对当前块的任一相邻位置的像素或者当前块的任一非相邻位置的像素,若该像素满足变换条件,则获取当前块的该相邻位置的第二变换模型,或者,获取当前块的任一非相邻位置的像素对应的第三变换模型;其中,所述变换条件包括以下至少一种:
    该像素所在块使用帧内块复制技术、变换模型标志位为有效和该像素所在块的大小满足第一预设尺寸。
  11. 根据权利要求8或9所述的方法,其中,
    不同的至少一种变换模型包括以下至少一种:至少一种变换模型的变换类型不同、存在不同的模型参数,同一变换类型下使用不同模板区域。
  12. 根据权利要求8至11任一项所述的方法,其中,所述依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到所述变换模型列表,包括:
    依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到中间变换模型列表;
    对所述中间变换模型列表进行重排序,得到所述变换模型列表。
  13. 根据权利要求12所述的方法,其中,所述对所述中间变换模型列表进行重排序,得到所述变换模型列表,包括:
    遍历所述中间变换模型列表中的各个变换模型,确定所述各个变换模型的偏移值;
    采用所述各个变换模型,分别对参考块模板进行预测,确定各个变换模型各自的参考块模板预测;
    确定每个变换模型的参考块模板预测和当前块模板之间的误差值;
    基于每个变换模型的误差值,以及其对应的偏移值,确定所述各个变换模型的模板误差值;
    根据各个变换模型的模板误差值,对所述各个变换模型进行重排序,得到所述变换模型列表。
  14. 根据权利要求13所述的方法,其中,
    所述各个变换模型的模板误差值由小到大,对应所述变换模型列表的索引信息由小到大。
  15. 根据权利要求13或14所述的方法,其中,所述方法还包括:
    在参考块模板不可用时,确定所述误差值为最大值。
  16. 根据权利要求8至15任一项所述的方法,其中,所述方法还包括:
    获取当前块所在的第一位置信息和当前块的当前尺寸;
    基于所述第一位置信息和所述当前尺寸,确定当前块的至少一个相邻位置和当前块的至少一个非相邻位置。
  17. 根据权利要求8至16任一项所述的方法,其中,所述方法还包括:
    获取将解码过程中的使用的历史变换模型;
    在所述历史变换模型与历史变换模型列表中存在相同模型时,则将所述历史变换模型列表中的相同模型移除,将所述历史变换模型添加至所述历史变换模型列表的第一顺序位;
    在所述历史变换模型与历史变换模型列表中不存在相同模型时,则将所述历史变换模型添加至所述历史变换模型列表的第一顺序位。
  18. 根据权利要求17所述的方法,其中,所述将所述历史变换模型添加至所述历史变换模型列表的第一顺序位,包括:
    在所述历史变换模型列表满足第一预设列表长度时,将所述历史变换模型列表中的最后顺序位的变换模型移除后,将所述历史变换模型添加至所述历史变换模型列表的第一顺序位。
  19. 根据权利要求17或18所述的方法,其中,
    所述第四变换模型是按照所述历史变换模型的由第一顺序位至最后顺序位的顺序,从所述历史变换模型中依次确定的。
  20. 根据权利要求17至19任一项所述的方法,其中,所述方法还包括:
    待添加的所述历史变换模型对应的块的尺寸在满足第二预设尺寸的情况下,基于所述历史变换模型更新所述历史变换模型列表。
  21. 根据权利要求1至20任一项所述的方法,其中,所述基于所述参考块和所述第一变换模型,确定当前块的预测块,包括:
    采用所述第一变换模型,对当前块的参考块模板进行预测,确定参考块模板的像素的预测值;
    确定各个像素的预测值和当前块模板的像素之间的总误差值;
    基于总误差值,对各个像素进行平均,得到第一偏移值;
    采用所述第一变换模型对所述参考块进行变换,并在每个像素对应的变换结果补偿所述第一偏移值,得到所述当前块的预测块;或者,采用所述第一偏移值对所述第一变换模型中的参数进行补偿,得到更新的第一变换模型,再采用所述更新后的第一变换模型对所述参考块进行变换。
  22. 根据权利要求3、5或6所述的方法,其中,所述方法还包括:
    在所述当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测时,确定当前块的局部补偿标志位为第二值;
    所述基于所述参考块和所述第一变换模型,确定当前块的预测块,包括:
    采用所述第一变换模型和所述局部补偿标志位指示的局部补偿的变换模型,依次对所述参考块进行二次变换,确定所述当前块的预测块;或者,根据当前块模板和参考块模板推岛的局部补偿的变换模型,对参考块进行变换,确定所述当前块的预测块。
  23. 根据权利要求3、5或6所述的方法,其中,所述解码所述第二语法元素,包括:
    根据已解码信息,解码所述第二语法元素,其中,所述已解码信息包括以下至少一种:
    当前块的尺寸、当前块的CIIP标志位、GPM标志位、MBVD标志位、skip标志位和TM_merge标志位。
  24. 根据权利要求23所述的方法,其中,所述根据已解码信息,解码所述第二语法元素,包括:
    在所述已解码信息满足第一解码条件时,解码所述第二语法元素;
    所述第一解码条件包括以下至少一个:
    所述CIIP标志位的取值为第一值;
    所述GPM标志位的取值为为第一值;
    所述MBVD标志位为第一值;
    所述skip标志位为第一值;
    所述TM_merge标志位为第一值;
    所述当前块的尺寸小于第三预设尺寸;
    所述当前块的面积大于第一预设面积阈值。
  25. 根据权利要求13至15任一项所述的方法,其中,
    不同变换类型的各个变换模型,对应不同的参考块模板区域;
    各个变换模型所述误差值为各自的参考块模板中的像素数的平均的模板误差值。
  26. 根据权利要求4所述的方法,其中,所述在所述第三语法元素的取值为第一值,解码所述第二语法元素之后,所述方法还包括:
    在所述第三语法元素的取值为第二值时,解码第五语法元素;所述第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引;
    基于所述第五语法元素,确定第六变换模型;
    基于所述参考块和所述第六变换模型,确定当前块的预测块。
  27. 根据权利要求3、5或6所述的方法,其中,所述方法还包括:
    在所述当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测时,确定当前块的局部补偿标志位为第一值。
  28. 根据权利要求3至5任一项所述的方法,其中,所述解码所述第二语法元素,包括:
    在序列级的语法元素、帧级的语法元素、片级语法元素、当前块的尺寸中的至少一个满足第二解码条件时,解码所述第二语法元素。
  29. 根据权利要求4所述的方法,其中,所述在所述第三语法元素的取值为第二值,解码所述第二语法元素之后,所述方法还包括:
    在所述第三语法元素的取值为第一值时,解码第五语法元素;所述第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引;
    基于所述第五语法元素,确定第六变换模型;
    基于所述参考块和所述第六变换模型,确定当前块的预测块。
  30. 根据权利要求6所述的方法,其中,所述基于所述变换模型的索引信息,在构建的所述变换模型列表中,确定所述第一变换模型,包括:
    若变换模型的所述第四语法元素为第三值,则在所述变换模型列表指示至少一个其他变换模型,其中,其他变换模型为其他参考块对应的变换方式。
  31. 根据权利要求7或8所述的方法,其中,所述构建所述变换模型列表,包括:
    获取推导出的局部补偿模型,将所述局部补偿模型添加至所述变换模型列表。
  32. 根据权利要求1所述的方法,其中,所述方法还包括:
    确定对当前块的参考块,进行基于帧内块复制技术-帧内/帧间联合预测、帧内块复制技术-几何划分模式和帧内块复制技术-重建值重排序中的至少一种预测,得到参考块的参考预测块;
    采用所述参考预测块对所述参考块进行更新。
  33. 根据权利要求1所述的方法,其中,所述方法还包括:
    所述第一变换模型为使用多模式局部补偿技术时的局部补偿模型时,基于当前块模板和参考块模板重新计算多模式局部补偿模型的更新参数;
    基于所述更新参数,更新所述第一变换模型。
  34. 根据权利要求3至7任一项所述的方法,其中,所述解码所述第二语法元素,包括:
    根据相邻块的解码信息,从至少一个上下文模型中,确定第一上下文模型;
    基于所述第一上下文模型,解码所述第二语法元素;或者,
    采用等概率解码方式,解码所述第二语法元素。
  35. 根据权利要求6所述的方法,其中,所述解码第四语法元素,确定变换模型的索引信息,包括以下至少一种:
    采用等概率解码方式,解码所述第四语法元素,确定变换模型的所述索引信息;
    采用第二上下文模型的解码方式,解码所述第四语法元素,确定变换模型的所述索引信息;
    部分采用第二上下文模型的解码方式,结合部分采用等概率解码方式,解码所述第四语法元素,确定变换模型的所述索引信息。
  36. 根据权利要求34所述的方法,其中,
    当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,解码第二语法元素信息的第一上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,解码第二语法元素信息的第一上下文模型的关系包括:相同或不相同。
  37. 根据权利要求35所述的方法,其中,
    当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,解码第四语法元素信息的第二上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,解码第四语法元素信息的第二上下文模型的关系包括:相同或不相同。
  38. 根据权利要求1所述的方法,其中,所述获取当前块的相关语法元素,包括:
    获取当前块的参考块的第六语法元素,所述第六语法元素用于指示参考块的索引信息;
    所述确定当前块使用所述帧内块复制技术得到的参考块,包括:
    基于所述第六语法元素,确定当前块使用所述帧内块复制技术得到的参考块。
  39. 根据权利要求38所述的方法,其中,所述确定当前块使用所述帧内块复制技术得到的参考块之后,所述方法还包括:
    获取当前块的合并候选块的第二语法元素;
    在所述合并候选块的第二语法元素的取值为第二值时,确定所述当前块的第二语法元素为第二值;
    基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型。
  40. 根据权利要求39所述的方法,其中,所述基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型,包括:
    将所述参考的变换模型,作为所述第一变换模型。
  41. 根据权利要求39所述的方法,其中,所述基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型,包括:
    确定所述参考的变换模型的第一变换模型类型;
    根据参考块模板和当前块模板,重新推导与所述第一变换类型一致的所述第一变换模型。
  42. 根据权利要求39所述的方法,其中,所述基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型,包括:
    获取合并候选块的翻转参考块标志位;
    在所述翻转参考块标志位的取值为第二值时,基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型。
  43. 根据权利要求2-42任一项所述的方法,其中,所述方法还包括:
    在当前块的所述第二语法元素为第一值时,或者,在当前块的合并候选块的第二语法元素为第一值时,基于所述参考块,确定所述当前块的预测块;
    基于当前块的预测块,确定当前块的重建像素值;
    基于当前块的重建像素值和参考块的重建像素值,在模板区域或在块内,构建当前块的第五变换模型,供后续解码过程使用。
  44. 根据权利要求2-42任一项所述的方法,其中,所述基于所述参考块和所述第一变换模型,确定当前块的预测块之后,所述方法还包括:
    基于当前块的预测块,确定当前块的重建像素值;
    基于当前块的重建像素值和参考块的重建像素值,在模板区域或在块内,构建当前块的第七变换模型;
    采用所述第七变换模型代替所述第一变换模型,更新变换模型列表;或者,
    采用所述第七变换模型和所述第一变换模型中误差值最小的变换模型,更新变换模型列表;或者,
    采用所述第七变换模型,更新变换模型列表。
  45. 根据权利要求1所述的方法,其中,所述方法还包括:
    当第一变换模型为局部补偿模型时,获取当前编码块相邻的第一已重建区域像素值和参考块相邻的第二已重建区域像素值;
    基于所述第一已重建区域像素值和所述第二已重建区域像素值,推导所述局部补偿模型的第一参数,并由第一参数确定其第二参数;
    采用局部补偿模型的原始第一参数,和所述第二参数,确定第三变换模型;
    采用所述第三变换模型对所述参考块进行变换,得到所述当前块的预测块。
  46. 根据权利要求8至11任一项所述的方法,其中,
    所述变换模型列表中包含的第二变换模型、第三变换模型和第四变换模型对应的块的预测类型为帧内模板匹配预测和帧内块复制技术中的任意一种。
  47. 根据权利要求1至44任一项所述的方法,其中,所述方法还包括:
    基于所述第一变换模型更新历史变换模型列表。
  48. 一种编码方法,应用于编码器,所述方法包括:
    确定当前块的候选块向量列表;
    基于所述候选块向量列表,确定参考块向量;
    基于所述参考块向量,确定参考块;
    在确定当前块的预测模式为帧内块复制技术结合变换模型列表进行预测时,从构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;
    基于所述参考块和所述第一变换模型,确定当前块的预测块;
    编码当前块的相关语法元素,将所得到的编码比特写入码流;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测。
  49. 根据权利要求48所述的方法,其中,所述相关语法元素至少包括:第二语法元素;
    其中,所述第二语法元素用于指示当前块是否使用变换模型列表进行预测;
    所述相关语法元素还包括:第一语法元素,所述第一语法元素用于指示当前块使用帧内块复制技术的预测模式。
  50. 根据权利要求49所述的方法,其中,所述帧内块复制技术的预测模式包括:合并模式和优化的运动矢量预测模式;所述方法还包括:
    当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,编码所述第一语法元素的取值为第一值,以及编码第三语法元素;所述第三语法元素用于指示是否使用变换技术进行预测;所述第三语法元素属于所述相关语法元素;
    编码所述第三语法元素的取值为第二值时,编码所述第二语法元素;或,
    编码所述第三语法元素的取值为第一值,编码所述第二语法元素;或者,
    编码所述第一语法元素的取值为第一值时,编码第二语法元素;
    编码所述第二语法元素的取值为第一值时,编码所述第三语法元素。
  51. 根据权利要求49所述的方法,其中,所述方法还包括:
    当前块使用帧内块复制技术的预测模式为合并模式时,编码所述第一语法元素的取值为第二值,以及编码第二语法元素。
  52. 根据权利要求49至51任一项所述的方法,其中,所述方法还包括:
    在当前块使用变换模型列表进行预测时,编码所述第二语法元素为第二值,并将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素;所述第四语法元素用于指示变换模型在所述变换模型列表中的模型索引;所述相关语法元素信息还包括:所述第四语法元素。
  53. 根据权利要求49至52任一项所述的方法,其中,所述方法还包括:
    在当前块使用变换模型列表进行预测时,构建所述变换模型列表。
  54. 根据权利要求49至53任一项所述的方法,其中,所述构建所述变换模型列表,包括:
    依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到所述变换模型列表;
    所述至少一种变换模型包括以下至少一种:
    当前块的至少一个相邻位置的像素对应的第二变换模型;
    当前块的至少一个非相邻位置的像素对应的第三变换模型;
    历史编码过程中使用的第四变换模型;
    时域的可用变换模型;
    所述预设变换模型。
  55. 根据权利要求54所述的方法,其中,
    所述预设变换模型包括:预设模型参数对应的模型或对第二变换模型、第三变换模型和第四变换模型、预设模型参数对应的模型和时域的可用变换模型中的至少一种进行偏移得到的模型。
  56. 根据权利要求54或55所述的方法,其中,所述方法还包括:
    针对当前块的任一相邻位置的像素或者当前块的任一非相邻位置的像素,若该像素满足变换条件,则获取当前块的该相邻位置的第二变换模型,或者,获取当前块的任一非相邻位置的像素对应的第三变换模型;其中,所述变换条件包括以下至少一种:
    该像素所在块使用帧内块复制技术、变换模型标志位为有效和该像素所在块的大小满足第一预设尺寸。
  57. 根据权利要求54或55所述的方法,其中,
    不同的至少一种变换模型包括以下至少一种:至少一种变换模型的变换类型不同、存在不同的模型参数,同一变换类型下使用不同模板区域。
  58. 根据权利要求54至58任一项所述的方法,其中,所述依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到所述变换模型列表,包括:
    依次将不同的至少一种变换模型,添加至初始变换模型列表中,得到中间变换模型列表;
    对所述中间变换模型列表进行重排序,得到所述变换模型列表。
  59. 根据权利要求58所述的方法,其中,所述对所述中间变换模型列表进行重排序,得到所述变换模型列表,包括:
    遍历所述中间变换模型列表中的各个变换模型,确定所述各个变换模型的偏移值;
    采用所述各个变换模型,分别对参考块模板进行预测,确定各个变换模型各自的参考块模板预测;
    确定每个变换模型的参考块模板预测和当前块模板之间的误差值;
    基于每个变换模型的误差值,以及其对应的偏移值,确定所述各个变换模型的模板误差值;
    根据各个变换模型的模板误差值,对所述各个变换模型进行重排序,得到所述变换模型列表。
  60. 根据权利要求59所述的方法,其中,
    所述各个变换模型的模板误差值由小到大,对应所述变换模型列表的索引信息由小到大。
  61. 根据权利要求59或60所述的方法,其中,
    在参考块模板不可用时,确定所述误差值为最大值。
  62. 根据权利要求54至61任一项所述的方法,其中,所述方法还包括:
    获取当前块所在的第一位置信息和当前块的当前尺寸;
    基于所述第一位置信息和所述当前尺寸,确定当前块的至少一个相邻位置和当前块的至少一个非相邻位置。
  63. 根据权利要求54至62任一项所述的方法,其中,所述方法还包括:
    获取将编码过程中的使用的历史变换模型;
    在所述历史变换模型与历史变换模型列表中存在相同模型时,则将所述历史变换模型列表中的相同模型移除,将所述历史变换模型添加至所述历史变换模型列表的第一顺序位;
    在所述历史变换模型与历史变换模型列表中不存在相同模型时,则将所述历史变换模型添加至所述历史变换模型列表的第一顺序位。
  64. 根据权利要求63所述的方法,其中,所述将所述历史变换模型添加至所述历史变换模型列表的第一顺序位,包括:
    在所述历史变换模型列表满足第一预设列表长度时,将所述历史变换模型列表中的最后顺序位的变换模型移除后,将所述历史变换模型添加至所述历史变换模型列表的第一顺序位。
  65. 根据权利要求63或64所述的方法,其中,
    所述第四变换模型是按照所述历史变换模型的由第一顺序位至最后顺序位的顺序,从所述历史变换模型中依次确定的。
  66. 根据权利要求63至65任一项所述的方法,其中,所述方法还包括:
    待添加的所述历史变换模型对应的块的尺寸在满足第二预设尺寸的情况下,基于所述历史变换模型更新所述历史变换模型列表。
  67. 根据权利要求48至66任一项所述的方法,其中,所述基于所述参考块和所述第一变换模型,确定当前块的预测块,包括:
    采用所述第一变换模型,对当前块的参考块模板进行预测,确定参考块模板的像素的预测值;
    确定各个像素的预测值和当前块模板的像素之间的总误差值;
    基于总误差值,对各个像素进行平均,得到第一偏移值;
    采用所述第一变换模型对所述参考块进行变换,并在每个像素对应的变换结果补偿所述第一偏移值,得到所述当前块的预测块;或者,采用所述第一偏移值对所述第一变换模型中的参数进行补偿,得到更新的第一变换模型,再采用所述更新后的第一变换模型对所述参考块进行变换。
  68. 根据权利要求51所述的方法,其中,所述方法还包括:
    在所述当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测时,确定当前块的局部补偿标志位为第二值;
    所述基于所述参考块和所述第一变换模型,确定当前块的预测块,包括:
    采用所述第一变换模型和所述局部补偿标志位指示的局部补偿的变换模型,依次对所述参考块进行二次变换,确定所述当前块的预测块,或者,;或者,根据当前块模板和参考块模板推岛的局部补偿的变换模型,对参考块进行变换,确定所述当前块的预测块。
  69. 根据权利要求50或51所述的方法,其中,所述编码所述第二语法元素,包括:
    根据已编码信息,编码所述第二语法元素,其中,所述编码信息包括以下至少一种:
    当前块的尺寸、当前块的CIIP标志位、GPM标志位、MBVD标志位、skip标志位和TM_merge标志位。
  70. 根据权利要求69所述的方法,其中,所述根据已编码信息,编码所述第二语法元素,包括:
    在所述已编码信息满足第一编码条件时,编码所述第二语法元素;
    所述第一编码条件包括以下至少一个:
    所述CIIP标志位的取值为第一值;
    所述GPM标志位的取值为为第一值;
    所述MBVD标志位为第一值;
    所述skip标志位为第一值;
    所述TM_merge标志位为第一值;
    所述当前块的尺寸小于第三预设尺寸;
    所述当前块的面积大于第一预设面积阈值。
  71. 根据权利要求59至61任一项所述的方法,其中,
    不同变换类型的各个变换模型,对应不同的参考块模板区域;
    各个变换模型所述误差值为各自的参考块模板中的像素数的平均的模板误差值。
  72. 根据权利要求50所述的方法,其中,所述方法还包括:
    在当前块使用变换技术,非变换模型列表进行预测时,确定第六变换模型;
    基于所述参考块和所述第六变换模型,确定当前块的预测块;
    编码第三语法元素为第一值或第二值,并编码第五语法元素;所述第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引。
  73. 根据权利要求50或51所述的方法,其中,所述方法还包括:
    在所述当前块的合并候选块对应的第二语法元素使用变换模型列表进行预测时,确定当前块的局部补偿标志位为第一值。
  74. 根据权利要求50或51所述的方法,其中,所述编码所述第二语法元素,包括:
    在序列级的语法元素、帧级的语法元素、片级语法元素、当前块的尺寸中的至少一个满足第二编码条件时,编码所述第二语法元素。
  75. 根据权利要求48所述的方法,其中,所述方法还包括:
    若所述第一变换模型为在所述变换模型列表指示的至少一个其他变换模型,则将第四语法元素编码为第三值,其中,其他变换模型为其他参考块对应的变换方式。
  76. 根据权利要求54或55所述的方法,其中,所述构建所述变换模型列表,包括:
    获取推导出的局部补偿模型,将所述局部补偿模型添加至所述变换模型列表。
  77. 根据权利要求48所述的方法,其中,所述方法还包括:
    确定对当前块的参考块,进行基于帧内块复制技术-帧内/帧间联合预测、帧内块复制技术-几何划分模式和帧内块复制技术-重建值重排序中的至少一种预测,得到参考块的参考预测块;
    采用所述参考预测块对所述参考块进行更新。
  78. 根据权利要求48所述的方法,其中,所述方法还包括:
    所述第一变换模型为使用多模式局部补偿技术时的局部补偿模型时,基于当前块模板和参考块模板重新计算多模式局部补偿模型的更新参数;
    基于所述更新参数,更新所述第一变换模型。
  79. 根据权利要求50或51所述的方法,其中,所述编码所述第二语法元素,包括:
    根据相邻块的编码信息,从至少一个上下文模型中,确定第一上下文模型;
    基于所述第一上下文模型,编码所述第二语法元素;或者,
    采用等概率编码方式,编码所述第二语法元素。
  80. 根据权利要求52所述的方法,其中,所述将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素,包括以下至少一种:
    采用等概率编码方式,将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素;
    采用第二上下文模型的编码方式,将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素;
    部分采用第二上下文模型的编码方式,结合部分采用等概率编码方式,将所述第一变换模型在所述变换模型列表中的索引信息,编码为第四语法元素。
  81. 根据权利要求79所述的方法,其中,
    当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,编码第二语法元素信息的第一上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,编码第二语法元素信息的第一上下文模型的关系包括:相同或不相同。
  82. 根据权利要求80所述的方法,其中,
    当前块使用帧内块复制技术的预测模式为优化的运动矢量预测模式时,编码第四语法元素信息的第二上下文模型,与当前块使用帧内块复制技术的预测模式为合并模式时,编码第四语法元素信息的第二上下文模型的关系包括:相同或不相同。
  83. 根据权利要求1所述的方法,其中,所述方法还包括:
    确定参考块的索引信息,将所述参考块的索引信息编码为第六语法元素,所述第六语法元素用于指示参考块的索引信息。
  84. 根据权利要求83所述的方法,其中,基于所述参考块向量,确定参考块之后,所述方法还包括:
    获取所述参考块的第二语法元素;
    在当前块的合并候选块的第二语法元素的取值为第二值时,确定所述当前块的第二语法元素为第二值;
    基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型。
  85. 根据权利要求84所述的方法,其中,所述基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型,包括:
    将所述参考的变换模型,作为所述第一变换模型。
  86. 根据权利要求84所述的方法,其中,所述基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型,包括:
    确定所述参考的变换模型的第一变换模型类型;
    根据参考块模板和当前块模板,重新推导与所述第一变换类型一致的所述第一变换模型。
  87. 根据权利要求84所述的方法,其中,所述基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型,包括:
    获取合并候选块的翻转参考块标志位;
    在所述翻转参考块标志位的取值为第二值时,基于所述合并候选块对应的参考的变换模型,确定当前块的第一变换模型。
  88. 根据权利要求49-87任一项所述的方法,其中,所述方法还包括:
    在当前块的所述第二语法元素为第一值时,或者,在当前块的合并候选块的第二语法元素为第一值时,基于所述参考块,确定所述当前块的预测块;
    基于当前块的预测块,确定当前块的重建像素值;
    基于当前块的重建像素值和参考块的重建像素值,在模板区域或在块内,构建当前块的第五变换模型,供后续编码过程使用。
  89. 根据权利要求49-87任一项所述的方法,其中,所述基于所述参考块和所述第一变换模型,确定当前块的预测块之后,所述方法还包括:
    基于当前块的预测块,确定当前块的重建像素值;
    基于当前块的重建像素值和参考块的重建像素值,在模板区域或在块内,构建当前块的第七变换模型;
    采用所述第七变换模型代替所述第一变换模型,更新变换模型列表;或者,
    采用所述第七变换模型和所述第一变换模型中误差值最小的变换模型,更新变换模型列表;或者,
    采用所述第七变换模型,更新变换模型列表。
  90. 根据权利要求48所述的方法,其中,所述方法还包括:
    当第一变换模型为局部补偿模型时,获取当前编码块相邻的第一已重建区域像素值和参考块相邻的第二已重建区域像素值;
    基于所述第一已重建区域像素值和所述第二已重建区域像素值,推导所述局部补偿模型的第一参数,并由第一参数确定其第二参数;
    采用局部补偿模型的原始第一参数,和所述第二参数,确定第三变换模型;
    采用所述第三变换模型对所述参考块进行变换,得到所述当前块的预测块。
  91. 根据权利要求54至57任一项所述的方法,其中,
    所述变换模型列表中包含的第二变换模型、第三变换模型和第四变换模型对应的块的预测类型为帧内模板匹配预测和帧内块复制技术中的任意一种。
  92. 根据权利要求48至88任一项所述的方法,其中,所述方法还包括:
    基于所述第一变换模型更新历史变换模型列表。
  93. 根据权利要求49所述的方法,其中,所述方法还包括:
    在确定当前块的预测模式为非帧内块复制技术进行预测时,编码所述第一语法元素为第一值。
  94. 一种码流,其中,所述码流是根据待编码信息进行比特编码生成的;其中,所述待编码信息包括下述至少一项:第一语法元素、第二语法元素、第三语法元素、第四语法元素、第五语法元素、第六语法元素、当前块的尺寸、当前块的CIIP标志位、GPM标志位、MBVD标志位、skip标志位、TM_merge标志位和上下文模型;其中,
    所述第一语法元素用于用于指示当前块使用帧内块复制技术的预测模式;
    所述第二语法元素用于指示当前块是否使用变换模型列表进行预测;
    所述第三语法元素用于指示是否使用变换技术进行预测;
    所述第四语法元素用于指示变换模型在所述变换模型列表中的模型索引;
    所述第五语法元素用于指示在使用多模式局部补偿技术时的局部补偿模型的索引;
    所述第六语法元素用于指示参考块的索引信息。
  95. 一种解码器,其中,包括:
    解码部分,被配置为获取当前块的相关语法元素;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测;
    第一确定部分,被配置为确定当前块使用所述帧内块复制技术得到的参考块;
    根据所述相关语法元素,确定基于构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;
    第一预测部分,被配置为基于所述参考块和所述第一变换模型,确定当前块的预测块。
  96. 一种解码器,包括第一存储器和第一处理器;其中:
    所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求1至47中任一项所述的方法。
  97. 一种编码器,其中,包括:
    第二确定部分,被配置为确定当前块的候选块向量列表;基于所述候选块向量列表,确定参考块向量;基于所述参考块向量,确定参考块;在确定当前块的预测模式为帧内块复制技术结合变换模型列表进行预测时,从构建的变换模型列表得到的第一变换模型;所述构建的变换模型列表包括至少两种类型的变换模型;
    第二预测部分,被配置为基于所述参考块和所述第一变换模型,确定当前块的预测块;
    编码部分,被配置为编码当前块的相关语法元素,通过写入部分将所得到的编码比特写入码流;其中,所述相关语法元素用于指示当前块是否使用基于帧内块复制技术结合变换模型列表进行预测。
  98. 一种编码器,包括第二存储器和第二处理器;其中,
    所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求48至93中任一项所述的方法。
  99. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现如权利要求1至47中任一项所述的方法、或者被第二处理器执行时实现如权利要求48至93中任一项所述的方法。
PCT/CN2023/105611 2023-07-03 2023-07-03 编解码方法、码流、编码器、解码器以及存储介质 Ceased WO2025007263A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/CN2023/105611 WO2025007263A1 (zh) 2023-07-03 2023-07-03 编解码方法、码流、编码器、解码器以及存储介质
CN202380099990.6A CN121488481A (zh) 2023-07-03 2023-07-03 编解码方法、码流、编码器、解码器以及存储介质
MX2025015516A MX2025015516A (es) 2023-07-03 2025-12-18 Metodo de codificacion, flujo de bits, codificador, decodificador y medio de almacenamiento

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2023/105611 WO2025007263A1 (zh) 2023-07-03 2023-07-03 编解码方法、码流、编码器、解码器以及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US19/434,575 Continuation US20260129181A1 (en) 2025-12-29 Coding method, decoder, and storage medium

Publications (1)

Publication Number Publication Date
WO2025007263A1 true WO2025007263A1 (zh) 2025-01-09

Family

ID=94171092

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/105611 Ceased WO2025007263A1 (zh) 2023-07-03 2023-07-03 编解码方法、码流、编码器、解码器以及存储介质

Country Status (3)

Country Link
CN (1) CN121488481A (zh)
MX (1) MX2025015516A (zh)
WO (1) WO2025007263A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN121691725A (zh) * 2026-02-12 2026-03-17 深圳传音控股股份有限公司 处理方法、处理设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112135134A (zh) * 2019-06-24 2020-12-25 腾讯美国有限责任公司 视频解码方法、装置、计算机设备和存储介质
CN112868238A (zh) * 2018-10-23 2021-05-28 北京字节跳动网络技术有限公司 局部照明补偿和帧间预测编解码之间的并置
US20210360232A1 (en) * 2019-02-01 2021-11-18 Beijing Bytedance Network Technology Co., Ltd. Harmonization between different video process mode
CN114402616A (zh) * 2019-09-27 2022-04-26 Oppo广东移动通信有限公司 当前块的预测方法及装置、设备、存储介质
WO2022167322A1 (en) * 2021-02-08 2022-08-11 Interdigital Vc Holdings France, Sas Spatial local illumination compensation
WO2023093863A1 (en) * 2021-11-26 2023-06-01 Mediatek Singapore Pte. Ltd. Local illumination compensation with coded parameters

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112868238A (zh) * 2018-10-23 2021-05-28 北京字节跳动网络技术有限公司 局部照明补偿和帧间预测编解码之间的并置
US20210360232A1 (en) * 2019-02-01 2021-11-18 Beijing Bytedance Network Technology Co., Ltd. Harmonization between different video process mode
CN112135134A (zh) * 2019-06-24 2020-12-25 腾讯美国有限责任公司 视频解码方法、装置、计算机设备和存储介质
CN114402616A (zh) * 2019-09-27 2022-04-26 Oppo广东移动通信有限公司 当前块的预测方法及装置、设备、存储介质
WO2022167322A1 (en) * 2021-02-08 2022-08-11 Interdigital Vc Holdings France, Sas Spatial local illumination compensation
WO2023093863A1 (en) * 2021-11-26 2023-06-01 Mediatek Singapore Pte. Ltd. Local illumination compensation with coded parameters

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN121691725A (zh) * 2026-02-12 2026-03-17 深圳传音控股股份有限公司 处理方法、处理设备及存储介质

Also Published As

Publication number Publication date
CN121488481A (zh) 2026-02-06
MX2025015516A (es) 2026-02-03

Similar Documents

Publication Publication Date Title
CN110933412B (zh) 用于帧内块复制的基于历史的运动矢量预测值
TWI887420B (zh) 幀間預測方法、編碼器、解碼器以及電腦儲存媒介
TWI888505B (zh) 編碼方法、解碼方法、編碼器、解碼器以及儲存媒介
TWI886282B (zh) 幀間預測方法、編碼器、解碼器以及電腦儲存媒介
WO2025007263A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2024197748A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
CN116711304A (zh) 预测方法、编码器、解码器以及存储介质
WO2024000768A1 (zh) 视频编、解码方法及装置、码流、解码器、编码器、存储介质
CN120548703A (zh) 编解码方法、码流、编码器、解码器以及存储介质
US20260025516A1 (en) Method for decoding, method for encoding, decoder, and storage medium
WO2024197752A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2025065610A1 (zh) 编解码方法、记录方法、编解码器以及存储介质
WO2025129626A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2025065590A1 (zh) 编解码方法、编解码器以及存储介质
WO2025213394A1 (zh) 编解码方法、编码器、解码器以及存储介质
WO2025138025A1 (zh) 编解码方法、码流、解码器、编码器以及存储介质
WO2025065420A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2025213371A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
TW202429888A (zh) 解碼方法、編碼方法、解碼器、編碼器、電子設備、儲存媒介、電腦程式產品和碼流
WO2025007272A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2024207136A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2025145426A1 (zh) 编解码方法、编码器、解码器以及存储介质
WO2025043408A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2024197744A9 (zh) 解码方法、编码方法、解码器和编码器
WO2024229745A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质

Legal Events

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

Ref document number: 23943997

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: MX/A/2025/015516

Country of ref document: MX

WWE Wipo information: entry into national phase

Ref document number: 202617008414

Country of ref document: IN

WWE Wipo information: entry into national phase

Ref document number: 2023943997

Country of ref document: EP

WWP Wipo information: published in national office

Ref document number: MX/A/2025/015516

Country of ref document: MX

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2023943997

Country of ref document: EP

Effective date: 20260203

WWP Wipo information: published in national office

Ref document number: 202617008414

Country of ref document: IN