WO2021036430A1 - Decoding method, encoding method, and apparatus - Google Patents

Decoding method, encoding method, and apparatus Download PDF

Info

Publication number
WO2021036430A1
WO2021036430A1 PCT/CN2020/096580 CN2020096580W WO2021036430A1 WO 2021036430 A1 WO2021036430 A1 WO 2021036430A1 CN 2020096580 W CN2020096580 W CN 2020096580W WO 2021036430 A1 WO2021036430 A1 WO 2021036430A1
Authority
WO
WIPO (PCT)
Prior art keywords
context model
coefficient
decoded
coordinate value
target
Prior art date
Application number
PCT/CN2020/096580
Other languages
French (fr)
Chinese (zh)
Inventor
曹小强
Original Assignee
杭州海康威视数字技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州海康威视数字技术股份有限公司 filed Critical 杭州海康威视数字技术股份有限公司
Publication of WO2021036430A1 publication Critical patent/WO2021036430A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression

Definitions

  • This application relates to the technical field of video coding and decoding, and in particular to a decoding method, coding method and device.
  • Video coding usually includes processes such as prediction, transformation, quantization, entropy coding, etc.
  • the quantized transform coefficients can be coded through entropy coding.
  • the encoding of transform coefficients can be realized by encoding syntax elements used to indicate transform coefficients. Some flag bits in the syntax elements can be encoded by context models, and the context models that can be selected for each flag bit usually include multiple types. In the implementation, how to determine the context model of each flag bit has become a hot research topic.
  • the embodiments of the present application provide a decoding method, encoding method, and device, which can be used to solve the problem of low encoding performance of related technologies.
  • the technical solution is as follows:
  • a decoding method includes:
  • the target position coordinate information is obtained from the code stream, and the target position coordinate information is composed of a first coordinate value and a second coordinate value.
  • the first coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block
  • the second coordinate value is the non-zero coefficient included in the transformation coefficient of the current block.
  • a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined at least according to the coordinate information of the target position;
  • the to-be-decoded flag bit is decoded.
  • a decoding method includes:
  • the target position coordinate information is obtained from the code stream.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current
  • a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined from at least three types of context model sets at least according to the coordinate value of the position where the coefficient to be decoded is located;
  • the to-be-decoded flag bit is decoded.
  • a decoding method includes:
  • the target position coordinate information is obtained from the code stream.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current
  • a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
  • the to-be-decoded flag bit is decoded.
  • a decoding method includes:
  • the target position coordinate information is obtained from the code stream.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current
  • a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined according to the determined selection method after the selection method is determined at least based on the preset conditions satisfied by the current block;
  • the to-be-decoded flag bit is decoded.
  • an encoding method includes:
  • the target position coordinate information is obtained.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
  • a context model of the flag to be coded of the coefficient to be coded is determined, and the target scan area is a scan area determined based on the target position coordinate information, and The context model is determined at least according to the coordinate information of the target position;
  • the to-be-encoded flag bit is encoded.
  • an encoding method includes:
  • the target position coordinate information is obtained.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
  • a context model of the flag to be coded of the coefficient to be coded is determined, and the target scan area is a scan area determined based on the target position coordinate information, and
  • the context model is determined from at least three types of context model sets at least according to the coordinate value of the position where the coefficient to be decoded is located;
  • the to-be-encoded flag bit is encoded.
  • an encoding method includes:
  • the target position coordinate information is obtained, the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
  • a context model of the flag to be coded of the coefficient to be coded is determined, and the target scan area is a scan area determined based on the target position coordinate information, and The context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
  • the to-be-encoded flag bit is encoded.
  • an encoding method includes:
  • the target position coordinate information is obtained.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
  • a context model of the flag to be coded of the coefficient to be coded is determined, and the target scan area is a scan area determined based on the target position coordinate information, and The context model is determined according to the determined selection method after the selection method is determined at least based on the preset conditions satisfied by the current block;
  • the to-be-encoded flag bit is encoded.
  • a decoding device in a ninth aspect, includes:
  • the code stream acquisition module is used to obtain the code stream of the current block
  • the information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value.
  • the first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient of the current block.
  • the ordinate of the non-zero coefficient with the largest absolute value of the ordinate is the abscissa of the non-zero coefficient of the current block.
  • the model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information
  • the scanning area of the target location, the context model is determined at least according to the coordinate information of the target position;
  • the decoding module is configured to decode the to-be-decoded flag bit according to the context model.
  • a decoding device in a tenth aspect, includes:
  • the code stream acquisition module is used to obtain the code stream of the current block
  • the information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value.
  • the first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient of the current block.
  • the ordinate of the non-zero coefficient with the largest absolute value of the ordinate is the abscissa of the non-zero coefficient of the current block.
  • the model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information
  • the context model is determined from at least three types of context model sets according to at least the coordinate values of the positions where the coefficients to be decoded are located;
  • the decoding module is configured to decode the to-be-decoded flag bit according to the context model.
  • a decoding device in an eleventh aspect, includes:
  • the code stream acquisition module is used to obtain the code stream of the current block
  • the information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value.
  • the first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient of the current block.
  • the ordinate of the non-zero coefficient with the largest absolute value of the ordinate is the abscissa of the non-zero coefficient of the current block.
  • the model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information
  • the scanning area of the, the context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
  • the decoding module is configured to decode the to-be-decoded flag bit according to the context model.
  • a decoding device in a twelfth aspect, includes:
  • the code stream acquisition module is used to obtain the code stream of the current block
  • the information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value.
  • the first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient of the current block.
  • the ordinate of the non-zero coefficient with the largest absolute value of the ordinate is the abscissa of the non-zero coefficient of the current block.
  • the model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information
  • the context model is determined according to the determined selection method after determining a selection method at least based on a preset condition satisfied by the current block;
  • the decoding module is configured to decode the to-be-decoded flag bit according to the context model.
  • an encoding device in a thirteenth aspect, includes:
  • the acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
  • the determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined according to at least the target position coordinate information;
  • the encoding module is used to encode the to-be-encoded flag bit according to the context model.
  • an encoding device in a fourteenth aspect, includes:
  • the acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
  • the determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined from at least three types of context model sets according to at least the coordinate value of the position where the coefficient to be decoded is located;
  • the encoding module is used to encode the to-be-encoded flag bit according to the context model.
  • an encoding device includes:
  • the acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
  • the determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined at least according to a linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
  • the encoding module is used to encode the to-be-encoded flag bit according to the context model.
  • an encoding device includes:
  • the acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
  • the determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined according to the determined selection method after a selection method is determined at least based on a preset condition satisfied by the current block;
  • the encoding module is used to encode the to-be-encoded flag bit according to the context model.
  • a computer device in a seventeenth aspect, includes a processor, a communication interface, a memory, and a communication bus.
  • the processor, the communication interface, and the memory complete mutual communication through the communication bus.
  • the memory is used to store a computer program
  • the processor is used to execute the program stored in the memory to implement the steps of the method described in any one of the first aspect to the eighth aspect.
  • a computer-readable storage medium in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the above-mentioned aspects from the first aspect to the eighth aspect .
  • a computer program product containing instructions which when run on a computer, causes the computer to execute the steps of any one of the methods described in the first aspect to the eighth aspect.
  • the code stream of the current block When it is determined that the current block adopts SRCC, obtain the target position coordinate information from the code stream, determine the target scanning area of the current block based on the target position coordinate information, and determine the coefficient to be decoded at least according to the target position coordinate information According to the context model of the flag to be decoded, the flag to be decoded is decoded. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
  • FIG. 1 is a schematic diagram of a coding and decoding method provided by an embodiment of the present application
  • FIG. 2 is a flowchart of a decoding method provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a scanning area provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of another scanning area provided by an embodiment of the present application.
  • FIG. 5 is a flowchart of a decoding method provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a scanning area provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of another scanning area provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of another scanning area provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of another scanning area provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of another scanning area provided by an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a decoding device provided by an embodiment of the present application.
  • Figure 12 is a schematic structural diagram of an encoding device provided by an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Residual error In the video encoding process, the spatial and temporal redundancy need to be removed through the prediction process.
  • the encoder obtains the predicted value after prediction, and the original pixel is subtracted from the predicted value to obtain the residual.
  • the residual block is transformed, quantized, and entropy coded Basic unit.
  • Transformation coefficient The function of transformation and quantization is to transform and quantize the residual data to remove the correlation in the frequency domain, and to perform lossy compression on the data.
  • Transform coding transforms an image from a time domain signal to a frequency domain signal, concentrating energy to the low frequency region. Since the image energy is mainly concentrated in the low-frequency region, zeroing the transform coefficients in the high-frequency region by quantization can reduce the dynamic range of image coding on the basis of the transform module. Remove the transform coefficients in the high-frequency region, reduce the overhead of the code rate, and will not cause great distortion. Among them, the coefficients of the residual block after being transformed and quantized are called transform coefficients.
  • Syntax element can be used to indicate a transform coefficient. Generally, a transform coefficient needs to be indicated by at least one syntax element.
  • Context Under normal circumstances, different grammatical elements are not completely independent, and the same grammatical element itself also has a certain degree of memorability. Therefore, according to the theory of conditional entropy, using other coded syntax elements for conditional coding can further improve coding performance compared to independent coding or memoryless coding.
  • the coded symbol information used as a condition is called context.
  • Context model In video coding and decoding, the process of updating symbol probability based on context is called context model, and according to specific application conditions, the same syntax element can use multiple context models to adaptively update the symbol probability under current conditions, thereby further Compression rate.
  • SRCC Scan Region-based Coefficient Coding, coefficient coding based on scanning area: Use (SRx, SRy) to determine the area of the transformation coefficient to be scanned in a transformation coefficient matrix, where SRx is the rightmost non-zero in the transformation coefficient matrix The abscissa of the coefficient, SRy is the ordinate of the lowest non-zero coefficient in the transformation coefficient matrix. Only the transform coefficients in the scan area determined by (SRx, SRy) need to be coded and decoded, while the transform coefficients outside the scan area are all 0, no coding and decoding are required. Using this technology can further reduce the bit rate overhead.
  • Video coding generally includes prediction, transformation, quantization, entropy coding and other processes. Further, the coding process can also be implemented in accordance with the framework of Figure 1 (b) .
  • Intra-frame prediction uses the surrounding coded blocks as a reference to predict the current uncoded block, effectively removing the redundancy in the spatial domain.
  • Inter-frame prediction uses adjacent coded images to predict the current image, effectively removing redundancy in the time domain.
  • Transformation refers to transforming an image from the spatial domain to the transform domain, and using transform coefficients to represent the image. Most images contain more flat areas and slowly changing areas. Appropriate transformation can transform the image from a scattered distribution in the spatial domain to a relatively concentrated distribution in the transform domain, removing the frequency domain correlation between signals, and matching The quantization process can effectively compress the code stream.
  • Entropy coding is a lossless coding method that can convert a series of element symbols into a binary code stream for transmission or storage.
  • the input symbols may include quantized transform coefficients, motion vector information, prediction mode information, transform and quantization related Grammar, etc. Entropy coding can effectively remove the redundancy of video element symbols.
  • video decoding usually includes entropy decoding, prediction, inverse quantization, inverse transformation, filtering, etc.
  • the implementation principle of each process is the same as or similar.
  • entropy coding can be realized by using SRCC technology.
  • SRCC technology can determine the abscissa SRx of the rightmost non-zero coefficient in the transformation coefficient matrix of the current block to be coded and the ordinate of the bottom non-zero coefficient in the transformation coefficient matrix.
  • SRy uses (SRx, SRy) to determine the scan area to be scanned in the variation coefficient matrix, and encodes the transformation coefficients in the scan area determined by (SRx, SRy).
  • the significant flagGT1flag and GT2flag context models can be determined according to the number of related flags of the partial transform coefficients that have been encoded or decoded in the scanning order, and according to the transform coefficients The relative position of the scanning area, the size of the current block, and the channels are grouped.
  • the significant flag, GT1flag, and GT2flag can all be divided into luminance channels and chrominance channels. For details, see Table 1 below.
  • the brightness channel of the significant flag can be divided into three types of context model sets according to the size of the current block. Each type of context model set includes 13 types of context models.
  • each type of context can be analyzed according to the relative position of the transformation coefficient in the scanning area.
  • the model set is further grouped, and then a context model can be determined according to the number of non-zero transform coefficients of the five transform coefficients that have been encoded or decoded in the scanning order, and used to encode or decode the significant flag luminance channel.
  • the context model set can be grouped according to the relative position of the transform coefficients in the scanning area, and then one can be determined according to the number of non-zero transform coefficients of the 5 transform coefficients that have been encoded or decoded in the scanning order
  • the context model is used to encode or decode the chrominance channel of the significant flag.
  • the transform coefficients can be grouped according to the relative position of the scan area, and then a context can be determined according to the number of non-zero transform coefficients of the 5 transform coefficients that have been encoded or decoded in the scan order Model, used to encode or decode the brightness channel of GT1flag or GT2flag.
  • a context model can be determined according to the number of non-zero transform coefficients of the 5 transform coefficients that have been encoded or decoded in the scan order, which is used to encode or decode the chroma channel of GT1flag or GT2flag .
  • the decoding method and encoding method provided in the embodiments of the present application may be executed by an electronic device, and the electronic device may have a function of compressing, encoding or decoding any image or video image.
  • the electronic device may be a notebook computer, a tablet computer, a desktop computer, a portable computer, etc., which is not limited in the embodiment of the present application.
  • the encoding process is introduced: the current block is predicted to obtain the predicted value, the original value of the current block is subtracted from the predicted value to obtain the residual of the current block, and the residual is transformed and quantized to obtain the transform coefficients. If the transform coefficients are all zero, the cbf flag position of the current block is zero, and there is no need to encode the transform coefficients of the current block. Otherwise, the cbf flag position of the current block is 1. If SRCC is enabled on the encoding end sequence header, the scan area of the current block is determined, and the coordinate values of SRx and SRy are encoded.
  • transform coefficients There are two transform coefficients, and the information required for each transform coefficient includes at least one of significant flag, GT1flag, GT2flag, remaining level, and sign.
  • Entropy encodes information such as the SRCC enable flag bit, the transform coefficient of the current block, and the cbf flag bit to obtain a binary code stream.
  • each transform coefficient is sequentially decoded, and the information to be decoded for each transform coefficient includes at least one of significant flag, GT1 flag, GT2 flag, remaining level, and sign.
  • Obtain the entropy-decoded transform coefficient of the current block obtain the residual of the current block through inverse quantization and inverse transformation, and add the predicted value to obtain the reconstruction value of the current block.
  • Figure 2 is a flowchart of a decoding method provided by an embodiment of the present application. The method can be executed by the above-mentioned electronic device. The method can include the following steps :
  • Step 201 Obtain the code stream of the current block.
  • the current block may be any image block in the image to be processed.
  • the image to be processed can be divided into different image blocks, and then each image block can be processed sequentially in a certain order.
  • the size and shape of each image block can be set according to a preset division rule.
  • the code stream is sent by the encoding end.
  • the code stream can be a binary code stream.
  • the code stream can carry some information that the decoding end needs to know for decoding.
  • the code stream can carry information for the encoding method adopted by the encoding end. , The size of the current block and other information.
  • Step 202 When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current block's coordinate information.
  • the abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. coordinate.
  • the encoding end may carry a flag bit in the code stream to indicate whether all transform coefficients of the current block are zero through the flag bit.
  • the flag bit can be a cbf flag bit.
  • the cbf flag bit carried by the bitstream is 0, it can indicate that all transform coefficients of the current block are zero. In this case, there is no need to decode the transform coefficients of the current block.
  • the cbf flag bit is 1, it indicates that there are non-zero transform coefficients in the current block. In this case, the transform coefficients of the current block need to be decoded.
  • the encoding method adopted by the encoding end can be determined before decoding.
  • the encoding end uses SRCC for entropy encoding, it can carry a flag bit for indicating the SRCC in the code stream. In this way, for the decoding end, it can be determined that the current block uses SRCC according to the flag bit in the code stream. .
  • the scan area corresponding to the transform coefficient can be determined.
  • the scan area is the abscissa SRx (first coordinate value) of the rightmost non-zero transform coefficient in the transform coefficients of the current block.
  • the ordinate SRy (second coordinate value) of the lowest non-zero transform coefficient among the transform coefficients.
  • the coordinate system can be established with a certain vertex of the current block as the origin. As shown in FIG. 3, in this embodiment, the coordinate system is established with the upper left vertex of the current block as the origin.
  • the decoder can determine the target scan area by obtaining the information of SRx and SRy in the code stream (the rectangular box in Figure 3, the target position coordinates composed of SRx and SRy can be obtained to determine the target scan area), such as As shown in Fig. 4, the coordinate values of the positions where all transform coefficients are located in the target scanning area are greater than zero.
  • the positions corresponding to the SRx and SRy are the target positions corresponding to the target scanning area.
  • the target scan area may be different according to the distribution of non-zero transform coefficients.
  • the target scan area may be a part of the current block or the entire area of the current block.
  • the transform coefficients in the current block except the target scanning area are all zero, and one or some transform coefficients in the target scanning area may be zero.
  • Step 203 For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined at least according to the coordinate information of the target location.
  • the coefficient to be decoded is the transform coefficient to be decoded obtained in the scanning order, that is, the target scanning area can be scanned in a certain order during the decoding process.
  • the scanning order can be from Reverse zigzag scan from lower right corner to upper left corner.
  • Each scanned transform coefficient is determined as the coefficient to be decoded, and then the to-be-decoded flag of the coefficient to be decoded can be decoded according to the method provided in the embodiment of the present application.
  • the to-be-decoded flag bit is at least one of the first flag bit, the second flag bit, and the third flag bit.
  • the first flag bit is used to indicate whether the transform coefficient is non-zero.
  • the second flag bit is used to indicate whether the absolute value of the transform coefficient is greater than one.
  • the third flag bit is used to indicate whether the absolute value of the transform coefficient is greater than 2.
  • the first flag bit is significant flag
  • the second flag bit is GT1 flag
  • the third flag bit is GT2 flag.
  • at least one flag bit is required to indicate the coefficient to be decoded, that is, the coefficient to be decoded can be indicated by one flag bit or multiple flag bits. For example, if the coefficient to be decoded is 1, a significant flag is required to indicate that the coefficient to be decoded is non-zero, and GT1flag is used to indicate that the amplitude of the coefficient to be decoded is less than or equal to 1. If the coefficient to be decoded is 0, then only a significant flag is needed to indicate that the coefficient to be decoded is zero.
  • At least the significant flag is required to indicate whether the coefficient to be decoded is zero.
  • the coefficient to be decoded is the last transform coefficient to be decoded in the current block, and the transform coefficients previously decoded in the scan order are all zero, since there are non-zero transform coefficients in the current block, it can be determined The coefficient to be decoded is non-zero, so the significant flag may not be decoded.
  • the syntax element used to indicate a transform coefficient may also include other flag bits and/or parameters.
  • it may also include a fourth flag bit and/or variable.
  • the fourth flag bit may be used to indicate The positive or negative of the non-zero transform coefficient.
  • This variable can be used to indicate the remaining part of the non-zero transform coefficient whose amplitude is greater than 2.
  • the fourth flag bit and the variable can be encoded and decoded in other ways. Therefore, this embodiment of the present application is Don't introduce too much.
  • the encoding and decoding of transform coefficients can be implemented by encoding and decoding the syntax element used to indicate the transform coefficient, wherein at least one flag bit in the syntax element can be encoded and decoded through the context model.
  • Each flag bit can support a variety of different context models for encoding and decoding. For example, the number of context models corresponding to the significant flag, GT1flag, and GT2flag is shown in Table 1 below.
  • the context model corresponding to each flag bit can be divided into the context model corresponding to the luminance component and the context model corresponding to the chrominance component.
  • the method of determining the context model corresponding to the luminance component and the chrominance component can be the same or different.
  • the method provided in the embodiment of the present application may be suitable for determining the context model corresponding to the luminance component, or may also be suitable for determining the context model corresponding to the chrominance component.
  • the context models corresponding to the flag bits can be divided into multiple types of context model sets according to certain rules. Taking the significant flag as an example, there are 39 context models corresponding to the brightness component, which can be divided into three types of context model sets, and each type of context model set includes 13 types of context models. As an example, for any type of context model set, it can be further divided into multiple context model subsets. For example, each type of context model set described above can be divided into two context model subsets, where each context model sub-set The set includes 6 context models. It should be noted that one transform coefficient in the lower right corner of the target scan area can use a separate context model.
  • the context model is determined at least according to the target position coordinate information, and its specific implementation manner may include one of the following possible implementation manners:
  • the context model of the to-be-decoded flag of the to-be-decoded coefficient is determined at least according to the area of the target scan area, and the area of the target scan area is determined according to the target position coordinate information.
  • the target position coordinate information includes a first coordinate value and a second coordinate value, and therefore, the area of the scanning area can be determined according to the first coordinate value and the second coordinate value.
  • the context model of the to-be-decoded flag of the coefficient to be decoded is determined according to at least the area of the target scan area.
  • the specific implementation may include: when the area of the target scan area is less than or equal to the first area threshold, the context The model is selected from the set of upper and lower models of the first type, and when the area of the scanning area is greater than the first area threshold, the context model is selected from the set of upper and lower models of the second type.
  • the first area threshold can be set according to actual conditions, for example, it can be set to any value between 1 and 1024, such as 2, 4, 8, 16, and so on.
  • the classification rules of the first type of context model and the second type of context model can be set according to actual conditions.
  • the flag to be decoded can be determined according to the relationship between the scan area area and the first area threshold. Whether the context model of the bit is selected from the first type of context model set or the second type of context model set.
  • the first area threshold is set to 4.
  • the context model for determining the flag to be decoded is selected from the first type of context model set.
  • ScanArea>4 the context model for determining the flag to be decoded is selected from the first type of context model set.
  • the context model for determining the flag to be decoded is selected from the second type of context model set.
  • the context model of the flag to be decoded can also be determined to be selected from the first type of context model set. For example, set the first area threshold to 4.
  • ScanArea ⁇ 4 determine the context model of the flag to be decoded from the first type of context model set.
  • ScanArea ⁇ 4 determine the context model of the flag to be decoded from the first type of context model set. Choose from a collection of two types of context models.
  • the context model when the area of the target scan area is less than or equal to the first area threshold, the context model is selected from the first type of context model set, and when the area of the target scan area is greater than the first area threshold and When it is less than or equal to the second area threshold, the context model is selected from the second type of context model set. When the area of the target scanning area is greater than the second area threshold, the context model is selected from the third type of context model set Selected.
  • the first area threshold and the second area threshold can be set according to actual conditions, for example, can be set to any value between 1 and 1024, such as 2, 4, 8, 16, and so on. It should be noted that the first area threshold should be smaller than the second area threshold.
  • the size relationship between the scan area area and the first area threshold can be used .
  • the size relationship between the scan area area and the second area threshold determines which type of context model set the context model of the flag bit to be decoded is selected from.
  • ScanArea ⁇ 4 it is determined that the context model of the flag to be decoded is selected from the first type of context model set.
  • ScanArea>4 and ScanArea
  • ScanArea>16 it is determined that the context model of the flag to be decoded is selected from the second type of context model set.
  • ScanArea>16 it is determined that the context model of the flag to be decoded is selected from the third type of context model set.
  • ScanArea ⁇ 4 it is determined that the context model of the flag to be decoded is selected from the first type of context model set
  • ScanArea ⁇ 16 it is determined that the context model of the flag to be decoded is selected from the second type of context model set.
  • ScanArea ⁇ 16 it is determined that the context model of the flag to be decoded is selected from the third type of context model set.
  • the context model of the flag to be decoded can also be divided into more than three types of context model sets, that is, the flag to be decoded can also correspond to four types of context model sets, five types of context model sets, and so on. At this time, more area thresholds can be set for grouping. The principle is similar to the above, and will not be described in detail here.
  • the context model is determined at least according to the size of the target scanning area, and the size of the target scanning area is determined according to the coordinate information of the target position.
  • the size of the target scanning area may be expressed by length and width, or the size of the target scanning area may also be expressed by length, or alternatively, the size of the target scanning area may also be expressed by width.
  • the size of the scan area may be determined by the first coordinate value SRx and the second coordinate value SRy. If the size of the target scan area is ScanSize, then according to the above, the ScanSize may be SRx*SRy, or, The ScanSize may also be SRx, or the ScanSize may also be SRy, or, the ScanSize may also be min(SRx, SRy).
  • the context model is selected from the first type of upper and lower model set, and when the size of the target scan area is greater than the first size threshold, the context model is selected from the second type of upper and lower model set.
  • the first size threshold can be set according to actual conditions, for example, it can be set to 2, 4, 8, and so on.
  • the context model of the flag to be decoded can be determined according to the relationship between the size of the scan area and the first size threshold Whether it is selected from the first type of context model set or the second type of context model set.
  • the first size threshold is 4, when ScanSize ⁇ 4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set. When ScanSize>4, it is determined that the context model of the flag to be decoded is selected from the second type of context model set.
  • the flag to be decoded can also be determined
  • the bit context model is selected from the second type of context model set.
  • the first size threshold is 4, when ScanSize ⁇ 4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set. When ScanSize ⁇ 4, the context model of the flag to be decoded is selected from the second type of context model set.
  • the context model when the size of the target scan area is less than or equal to the first size threshold, the context model is selected from the first type of context model set, and when the size of the target scan area is greater than the first size threshold and When the size is less than or equal to the second size threshold, the context model is selected from the second type of context model set. When the size of the target scan area is greater than the second size threshold, the context model is selected from the third type of context model set Selected.
  • the first size threshold and the second size threshold can be set according to actual conditions, for example, can be set to 2, 4, 8, etc., and the first size threshold should be smaller than the second size threshold.
  • the context model corresponding to the flag to be decoded is divided into the first type of context model set, the second type of context model set, and the third type of context model set according to the rules, it can be based on the size between the scan area and the first size threshold.
  • the relationship and the size relationship between the size of the scanning area and the second size threshold determine which type of context model set the context model of the flag bit to be decoded is selected.
  • the first size threshold is set to 2
  • the second size threshold is set to 8.
  • ScanSize ⁇ 2 the context model of the flag to be decoded is selected from the first type of context model set.
  • ScanSize>2 and ScanSize ⁇ 8 the context model of the flag to be decoded is selected in the second type of context model set.
  • ScanSize>8 the context model of the flag to be decoded is selected in the third type of context model set.
  • the context model of the flag to be decoded is selected in the first type of context model set.
  • the context model of the flag to be decoded is selected in the second type of context model set.
  • the context model of the flag to be decoded is selected in the third type of context model set.
  • the size of the target scan area can be represented by length and width
  • the length and width need to be compared with the first size threshold respectively. And compare the length and width with the second size threshold. For example, when the first size threshold is 2, it is necessary to compare whether the length of the target scan area is less than 2, and whether the width of the target scan area is less than 2, etc. Wait.
  • the context models of the flags to be decoded can also be divided into more than three types of context model sets, that is, the flags to be decoded can also correspond to four types of context model sets, five types of context model sets, and so on.
  • more size thresholds can be set for grouping, and the principle is similar to the above, and will not be described in detail here.
  • the context model is determined at least according to the short side of the target scanning area, and the short side of the target scanning area is determined according to the target position coordinate information.
  • the short side of the target scan area can be determined by the first coordinate value SRx and the second coordinate value SRy.
  • ScanM the short side of the target scan area
  • the length of the short side can be represented by coordinates
  • the context model is selected from the first type of upper and lower model set, and when the short side of the scan area is greater than the first short side When thresholding, the context model is selected from the second type of upper and lower model set.
  • the first short-side threshold can be set according to actual conditions, for example, it can be set to 2, 4, 8, and so on.
  • the flag to be decoded can be determined according to the size relationship between the short side of the target scan area and the first short side threshold Is the context model selected from the first type of context model set or the second type of context model set.
  • the first short-side threshold is set to 4, and when ScanM ⁇ 4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set.
  • ScanM>4 the context model of the flag to be decoded is selected from the second type of context model set.
  • set the first short-side threshold to 4, and when ScanM ⁇ 4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set.
  • the context model of the flag to be decoded is selected from the second type of context model set.
  • the context model is selected from the first type of context model set, and when the short side of the target scan area is greater than the first short side threshold, When the short side threshold is less than or equal to the second short side threshold, the context model is selected from the second type of context model set. When the short side of the target scan area is greater than the second short side threshold, the context model is selected from The third type is selected from the set of context models.
  • the first short-side threshold and the second short-side threshold can be set according to actual conditions, such as 2, 4, 8, etc., and the first short-side threshold should be smaller than the second short-side threshold.
  • the context model corresponding to the flag to be decoded is divided into the first type of context model set, the second type of context model set, and the third type of context model set according to the rules, it can be based on the difference between the short side of the target scan area and the first short side threshold.
  • the size relationship between the size relationship, the size relationship between the short side of the target scanning area and the second short side threshold determines which type of context model set the context model of the flag to be decoded is selected.
  • ScanM ⁇ 2 the context model of the flag to be decoded is selected from the first type of context model set.
  • ScanM>2 and ScanM ⁇ 8 the context model of the flag to be decoded is selected in the second type of context model set.
  • ScanM>8 the context model of the flag to be decoded is selected in the third type of context model set.
  • the context model of the flag to be decoded is selected in the first type of context model set.
  • the context model of the flag to be decoded is selected in the second type of context model set.
  • the context model of the flag to be decoded is selected in the third type of context model set.
  • the context models of the flags to be decoded can also be divided into more than three types of context model sets, that is, the flags to be decoded can also correspond to four types of context model sets, five types of context model sets, and so on.
  • more short-side thresholds can be set for grouping, and the principle is similar to the above, and will not be described in detail here.
  • the context model is determined at least according to the linear relationship that the coordinate value of the target position coordinate information satisfies.
  • the context model is selected from the first type of context model set, when the linear relationship that the coordinate value of the target position coordinate information satisfies is a*SRx+b*SRy+c>n1, the context model is selected from the second type of context model set, where a, b, and c are Constant, the SRx is the first coordinate value, and the SRy is the second coordinate value.
  • n1 can be 2, 4, 8, etc.
  • a can be 1
  • b can be 1
  • c can be 0 or 2.
  • n1 when n1 is 2, a is 1, b is 1, and c is 0, when SRx+SRy ⁇ 2, the context model of the flag to be decoded is selected in the first type of context model set.
  • SRx+ When SRy>2, the context model of the flag to be decoded is selected in the second type of context model set.
  • the context model for determining the flag to be decoded is selected from the first type of context model set as an example .
  • the context model of the flag to be decoded is from the second type of context Choose from the model collection.
  • the context model is selected from the first type of context model set, when the target position coordinate
  • the context model is selected from the second type of context model set, where a, b, and c are constants, and SRx is the first coordinate value, and SRy is the second coordinate value.
  • the sum and the second coordinate can be determined according to the linear combination of the first coordinate and the second coordinate of the target scan area.
  • the size relationship between n1 determines which type of context model set the context model of the flag to be decoded is selected from.
  • the context model is selected from the first type of context model set, when When the coordinate value of the target position coordinate information satisfies the linear relationship n1 ⁇ a*SRx+b*SRy+c ⁇ n2, the context model is selected from the second type of context model set, when the target position coordinate information When the linear relationship that satisfies the coordinate value of is a*SRx+b*SRy+c>n2, the context model is selected from the third type of context model set, where a, b, and c are constants, and the SRx Is the first coordinate value, and the SRy is the second coordinate value.
  • n1 and n2 can be set according to the actual situation, such as 2, 4, 8, etc. It should be noted that n1 should be less than n2. a can be 1, b can be 1, and c can be 0 or 2.
  • the context model corresponding to the flag to be decoded is divided into the first type of context model, the second type of context model and the third type of context model according to the rules, it can be determined according to the linear combination of the first coordinate and the second coordinate of the scanning area
  • n1 when n1 is 2, n2 is 4, a is 1, b is 1, and c is 0, when SRx+SRy ⁇ 2, the context model of the flag to be decoded is selected in the first type of context model set , When 2 ⁇ SRx+SRy ⁇ 4, the context model of the flag to be decoded is selected in the second type of context model set. When SRx+SRy>4, the context model of the flag to be decoded is selected in the third type of context model set.
  • the context model is selected from the first type of context model set.
  • it can also be determined that the context model is selected from the second type of context model set .
  • it can also be determined that the context model is selected from the third type of context model set.
  • the context model is selected from the first type of context model set, when the target position coordinate When the linear relationship that the coordinate value of the information satisfies is n1 ⁇ a*SRx+b*SRy+c ⁇ n2, the context model is selected from the second type of context model set, when the coordinate value of the target location coordinate information satisfies When the linear relationship is a*SRx+b*SRy+c ⁇ n2, the context model is selected from the third type of context model set, where a, b, and c are constants, and the SRx is the first The coordinate value, the SRy is the second coordinate value.
  • Step 204 According to the context model, decode the flag to be decoded.
  • the context model may be determined from the determined one type of context model set according to the number of non-zero coefficients in the five transform coefficients that have been decoded before the coefficients to be decoded after determining a type of context model set .
  • the to-be-decoded flag can be decoded according to the context model.
  • the significant flag corresponding to the transform coefficient of a certain special position in the target scanning area may be directly derived without decoding. For example, for the two points (SRx, 0) and (0, SRy), if the transform coefficients on the line segment between the two points (SRx, 0) and (SRx, SRy) are all zero, then for ( SRx, 0) The significant flag of the transform coefficient at this point may be directly derived without decoding. Similarly, if the transform coefficients on the line segment between the two points (0, SRy) and (SRx, SRy) are all zero, then the significant flag of the transform coefficient at the point (0, SRy) does not need to be decoded , Export directly.
  • the code stream of the current block is obtained.
  • the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position
  • the coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and decodes the to-be-decoded flag according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
  • first type of context model set second type of context model set, and third type of context model set are only used to distinguish groups.
  • the first type of context model set, the second type of context model set and the third type of context model set The type context model set is different from the first type context model set, the second type context model set, and the third type context model set in other embodiments.
  • FIG. 5 is a flowchart of a decoding method according to another exemplary embodiment.
  • the method may be executed by the above-mentioned electronic device.
  • the method may include the following implementation steps:
  • Step 501 Obtain the code stream of the current block.
  • step 201 in the embodiment of FIG. 2 described above, which will not be repeated here.
  • Step 502 When it is determined that the current block adopts SRCC, obtain the target position coordinate information from the code stream.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current block's coordinate information.
  • the abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. coordinate.
  • step 202 in the embodiment of FIG. 2 described above, which will not be repeated here.
  • Step 503 For the coefficient to be decoded in the target scanning area of the current block, determine the context model of the to-be-decoded flag of the coefficient to be decoded.
  • the target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined at least according to the coordinate information of the target location.
  • the context model is determined at least according to the target position coordinate information, and its specific implementation may be: the context model may also be determined at least according to the target position coordinate information and the coordinate value of the position where the coefficient to be decoded is located.
  • the context model may also be determined according to at least the target position coordinate information and the coordinate value of the position of the coefficient to be decoded.
  • the specific implementation may include: according to the target position coordinate information of the target scanning area, from multiple types of context One type of context model set is selected from the model set. Each type of context model set includes multiple context model subsets. According to the coordinate value of the position of the coefficient to be decoded, the selected one type of context model set includes multiple context model subsets. A subset of context models is selected, and the context model is determined from a selected subset of context models.
  • one type of context model set can be selected from multiple types of context model sets according to the target location coordinate information first, and its specific implementation manner may include any of the following (1)-(4) implementation manners:
  • the specific implementation of selecting one type of context model set from the multiple types of context model set according to the size can refer to the specific implementation in which the context model is determined at least according to the size of the target scanning area in the above-mentioned embodiment 2, which will not be repeated here.
  • the specific implementation of selecting one type of context model set from the multi-type context model set according to the short side can refer to the specific implementation in which the context model is determined at least according to the short side of the target scanning area in the above-mentioned embodiment 2, which will not be repeated here.
  • a type of context model set can be divided into multiple context model subsets according to certain rules, after selecting a type of context model set, you can use the coordinate value of the position of the coefficient to be decoded in the selected type of context model set Select a subset of the context model.
  • selecting a context model subset from a selected type of context model set according to the coordinate value of the position of the coefficient to be decoded may include the following possible implementation manners:
  • the coordinate value of the first target position is determined according to the target position coordinate information, and the coordinate value of the position where the coefficient to be decoded is located and the coordinate value of the first target position are selected from the selected context model set A subset of context models is selected, and the context model is determined from a selected subset of context models.
  • the first target position is located in the target scanning area and excludes the target position indicated by the target position coordinate information.
  • the first target position may be any position in the target scanning area except the position of the (SRx, SRy) point.
  • the first target position may also be based on the coordinate value of the target position (Ie, SRx, SRy) is determined.
  • the first target position may also be (SRx/2, SRy/2).
  • the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the first target position
  • the ordinate value of the position where the coefficient to be decoded is less than or equal to the ordinate value of the first target position
  • the abscissa value of the position of the coefficient to be decoded is greater than the abscissa value of the first target position, and the ordinate value of the position of the coefficient to be decoded is greater than the ordinate value of the first target position, select a type from The third context model subset is selected from the context model set; otherwise, the second context model subset is selected from the selected one type of context model set.
  • the rules for dividing a set of context models into a first context model subset, a second context model subset, and a third context model subset can be set according to actual conditions.
  • the selected context model set can be divided into the first context model subset, the second context model subset and the third context model subset according to the rules, it can be based on the abscissa value and the ordinate value of the position of the coefficient to be decoded.
  • the magnitude relationship between the abscissa value and the ordinate value of the first target position determines from which context model subset the context model of the flag to be decoded is selected.
  • the coefficient to be decoded is located in area 1
  • the context model for determining the flag to be decoded is selected from the first context model subset.
  • pos_x>4 and pos_y>8 the coefficient to be decoded is located in area 3 and it is determined that the context model of the flag to be decoded is selected from the third context model subset. Otherwise, the coefficient to be decoded is located in area 2, and it is determined that the context model of the flag to be decoded is selected from the second context model subset.
  • the coefficient to be decoded is located in area 1, and the context model for determining the flag to be decoded is selected from the first context model subset.
  • the coefficient to be decoded is located in area 1, and the context of the flag to be decoded is determined
  • the model is selected from the first context model subset as an example.
  • the coefficient to be decoded when pos_x ⁇ 4 and pos_y ⁇ 8, the coefficient to be decoded is located in area 1, and the context model for determining the flag to be decoded is selected from the first context model subset.
  • the coefficient to be decoded is located in area 3 and it is determined that the context model of the flag to be decoded is selected from the third context model subset. Otherwise, the coefficient to be decoded is located in area 2, and it is determined that the context model of the flag to be decoded is selected from the second context model subset.
  • the target scan area where the transform coefficients are located is divided into a low-frequency area and a non-low-frequency area according to the division method in Figure 6(a)
  • the non-low-frequency area includes the intermediate frequency area and the high-frequency area
  • the intermediate frequency area It often contains non-zero transform coefficients, and most of the transform coefficients in the high-frequency region are zero, which will result in poor context adaptation.
  • the target scan area where the transform coefficients are located can be divided into low-frequency, intermediate-frequency, and high-frequency areas more finely, thereby facilitating context adaptation and improving Understand code efficiency.
  • the coordinate values of the second target position and the third target position are determined according to the target position coordinate information, and the coordinate values of the position where the coefficient to be decoded is located, and the coordinates of the second target position and the third target position are determined.
  • the value selects a context model subset from the selected one type of context model set, and the context model is determined from the selected context model subset.
  • the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the second target position
  • the ordinate value of the position where the coefficient to be decoded is less than or equal to the ordinate value of the second target position
  • the abscissa value of the position of the coefficient to be decoded is greater than the abscissa value of the third target position, and the ordinate value of the position of the coefficient to be decoded is greater than the ordinate value of the third target position, select a type from the The third context model subset is selected from the context model set; otherwise, the second context model subset is selected from the selected one type of context model set.
  • the abscissa and ordinate of the second target position and the third target position can be set according to the actual situation, such as 4, 8, 16, etc. It should be noted that the abscissa value of the second target position should be less than The abscissa value of the third target position, and the ordinate value of the second target position should be smaller than the ordinate value of the third target position.
  • the selected context model set can be divided into the first context model subset, the second context model subset and the third context model subset according to the rules, it can be based on the abscissa of the position of the coefficient to be decoded and the second target position.
  • the relationship between the size of the abscissa, the size relationship between the ordinate of the position of the coefficient to be decoded and the ordinate of the second target position, the relationship between the abscissa of the position of the coefficient to be decoded and the abscissa of the third target position The size relationship and the size relationship between the ordinate of the position where the coefficient to be decoded is located and the ordinate of the third target position determine which context model subset the context model of the flag bit to be decoded is selected from.
  • pos_x be the abscissa of the position of the coefficient to be decoded
  • pos_y be the ordinate of the position of the coefficient to be decoded
  • the abscissa of the second target position is 4
  • the ordinate of the second target position is 8
  • the abscissa of the third target position is 16, and the ordinate of the third target position is 16.
  • the coefficient to be decoded is located in area 1, and the context model for determining the flag to be decoded is selected from the first context model subset.
  • the coefficient to be decoded is located in area 1, and the context of the flag to be decoded is determined
  • the model is selected from the first context model subset as an example.
  • the context model of the flag to be decoded can be determined from the first Take the three-context model subset selection as an example.
  • pos_x ⁇ 4 and pos_y ⁇ 8 when pos_x ⁇ 4 and pos_y ⁇ 8, and the coefficient to be decoded is located in area 1, it is determined that the context model of the flag to be decoded is selected from the first context model subset.
  • pos_x ⁇ 16 and pos_y ⁇ 16 when the coefficient to be decoded is located in area 3, it is determined that the context model of the flag to be decoded is selected from the third context model subset. Otherwise, when the coefficient to be decoded is located in area 2, it is determined that the context model of the flag to be decoded is selected from the second context model subset.
  • the selected type of context model set can also be divided into more than three context model subsets, that is, the selected type of context model set can also correspond to four context model subsets and five context models. Model subsets and so on.
  • the context model is determined at least according to the target position coordinate information.
  • the specific implementation may be: the context model may also be a linear relationship satisfied at least according to the target position coordinate information and the coordinate value of the position where the coefficient to be decoded is located. The formula is determined.
  • the selected one type of context model set includes One context model subset is selected from the multiple context model subsets as an example for description.
  • one type of context model set may be selected from the multiple types of context model sets according to the coordinate values of the positions of the coefficients to be decoded.
  • the context model may also be determined according to at least the target position coordinate information and the linear relationship that the coordinate value of the position where the coefficient to be decoded satisfies.
  • the specific realization may include: according to the target position coordinate information of the target scanning area , Select a type of context model set from a set of multiple types of context models, each type of context model set includes multiple context model subsets, according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, from the selected type of context
  • a context model subset is selected from a plurality of context model subsets included in the model set, and the context model is determined from the selected context model subset.
  • the specific implementation manner of selecting a context model subset from the multiple context model subsets included in the selected one type of context model set may include but It is not limited to the following possible implementation methods:
  • the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x ⁇ c
  • select a subset of multiple context models included in the selected context model set The first subset of context models.
  • the second context model subset is selected from the multiple context model subsets included in the selected one type of context model set ,
  • a and b are constants
  • the pos_x is the abscissa value of the position of the coefficient to be decoded
  • the pos_y is the ordinate value of the position of the coefficient to be decoded.
  • a may be the first coordinate value
  • b may be the second coordinate value
  • the context of the flag to be decoded can be determined according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded Which context model subset the model is selected from.
  • the first context is selected from the multiple context model subsets included in the selected context model set Take the model subset as an example.
  • multiple context models may be included from the selected context model set. Select the second context model subset from the subset.
  • the first context model is selected from the multiple context model subsets included in the selected context model set Subset.
  • the second context model subset is selected from the multiple context model subsets included in the selected one type of context model set ,
  • a and b are constants
  • the pos_x is the abscissa value of the position of the coefficient to be decoded
  • the pos_y is the ordinate value of the position of the coefficient to be decoded.
  • the first context model subset is selected from the selected one type of context model set.
  • the coordinate value of the position of the coefficient to be decoded satisfies the linear relationship a1*pos_y+b1*pos_x>c1, and a2*pos_y+b2*pos_x ⁇ c2
  • Context model subset when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a2*pos_y+b2*pos_x ⁇ c2
  • select the third context model subset from the selected one type of context model set where ,
  • the a1, b1, a2, b2, c1, and c2 are constants, the c1 is smaller than the c2, the pos_x is the abscissa value of the position of the coefficient to
  • both a1 and a2 may be the first coordinate value
  • both b1 and b2 may be the second coordinate value
  • the c1 may be half of the product of the first coordinate value and the second coordinate value
  • the linear relationship can be satisfied according to the coordinate value of the position of the coefficient to be decoded. Determine from which context model subset the context model of the flag to be decoded is selected.
  • the second context model can also be selected from the set of selected context models. set.
  • the second context model subset can also be selected from the selected one type of context model set.
  • the first context model subset is selected from the selected context model set.
  • the coordinate value of the position of the coefficient to be decoded satisfies the linear relationship a1*pos_y+b1*pos_x ⁇ c1, and a2*pos_y+b2*pos_x ⁇ c2
  • Context model subset when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a2*pos_y+b2*pos_x>c2
  • select the third context model subset from the selected one type of context model set where ,
  • the a1, b1, a2, b2, c1, and c2 are constants, the c1 is smaller than the c2, the pos_x is the abscissa value of the position of the coefficient to be decoded,
  • the selected type of context model set can also be divided into more than three context model subsets, that is, the selected type of context model set can also correspond to four context model subsets and five context model subsets. and many more.
  • One context model subset is selected from the multiple context model subsets included in the class context model set as an example for description.
  • One type of context model set is selected from the context model set, and then a context model subset is selected from the multiple context model subsets included in the selected one type of context model set according to the target location coordinate information. The order is not limited.
  • the context model is determined based on at least the target position coordinate information.
  • the specific implementation may be: the context model is based on at least the target position coordinate information, the coordinate value of the position where the coefficient to be decoded is located, and the position where the coefficient to be decoded is located. The linear relationship that the coordinate value satisfies is determined.
  • the context model is determined according to at least the target position coordinate information, the coordinate value of the position of the coefficient to be decoded, and the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies.
  • the specific implementation may include: Target position coordinate information of the target scanning area, select one type of context model set from multiple types of context model sets, each type of context model set includes multiple context model subsets, according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded Formula, the coordinate value of the position of the coefficient to be decoded and the coordinate information of the target position, a context model subset is selected from a plurality of context model subsets included in the selected one type of context model set, and the context model is selected from a context model subset The model subset is determined.
  • multiple contexts included in the selected context model set may be: when the abscissa value of the position where the coefficient to be decoded is less than or equal to the first coordinate threshold, and the ordinate value of the position where the coefficient to be decoded is less than or equal to the second coordinate
  • the first context model subset is selected from the multiple context model subsets included in the selected one type of context model set.
  • the first coordinate threshold and the second coordinate threshold can be set according to actual conditions, such as 2, 4, 8 and so on.
  • a can be SRx
  • b can be SRy
  • c can be SRx*SRy.
  • the linear relationship can be satisfied according to the coordinate value of the position of the coefficient to be decoded.
  • the coordinate value of the position where the coefficient to be decoded is located and the target position coordinate information determine from which context model subset the context model of the flag bit to be decoded is selected.
  • first coordinate threshold For example, set the first coordinate threshold to 2 and the second coordinate threshold to 4.
  • pos_x ⁇ 2 and pos_y ⁇ 4 it indicates that the coordinates of the position of the coefficient to be decoded are located in area 1, and the decoding is determined
  • the context model of the flag bit is selected from the first context model subset.
  • SRx*pos_y+SRy*pos_x>SRx*SRy it means that the coordinates of the position where the coefficient to be decoded is located in area 3
  • the context model of the flag bit to be decoded is determined from The third context model subset is selected. Otherwise, it is explained that the coordinates of the position where the coefficient to be decoded is located in area 2, and the context model for determining the flag bit to be decoded is selected from the second context model subset.
  • the context model of the flag to be decoded is determined to be selected from the first context model subset, and when SRx*pos_y+SRy*pos_x ⁇ SRx*SRy, the flag to be decoded is determined
  • the context model of bits is selected from the third subset of context models. Otherwise, the context model for determining the flag to be decoded is selected from the second subset of context models.
  • One context model subset is selected from multiple context model subsets as an example for illustration.
  • the context model may be based on at least one of the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the coordinate information of the target position, from One context model subset is selected from a plurality of context model subsets included in the selected one type of context model set.
  • the above is to select a type of context model set from multiple types of context model sets according to the target position coordinate information of the target scan area, and then according to the target position coordinate information, the coordinate value of the position where the coefficient to be decoded is located, and The linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is described by selecting a context model subset from the selected one type of context model set as an example.
  • the target position coordinate information, the coordinate value of the position of the coefficient to be decoded, and the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies may be selected from a set of multiple types of context models.
  • the specific implementation of the context model being determined at least according to the target position coordinate information may be: the context model is determined at least according to the target position coordinate information and the preset condition satisfied by the current block.
  • the preset condition can be set according to actual needs.
  • the preset condition can include but is not limited to any of the following conditions:
  • the first coordinate value or the second coordinate value is zero. Or, the product of the first coordinate value and the second coordinate value is less than the first coordinate threshold. Or, the first coordinate value is greater than or equal to the second coordinate threshold and the second coordinate value is greater than or equal to the third coordinate threshold. Alternatively, the first coordinate value is less than or equal to the second coordinate threshold or the second coordinate value is less than the third coordinate threshold.
  • the first coordinate threshold, the second coordinate threshold, and the third coordinate threshold can be set according to actual conditions.
  • the context model is determined according to at least the target position coordinate information and the preset conditions satisfied by the current block.
  • the specific implementation may include: according to the target position coordinate information of the target scanning area, from a collection of multiple types of context models Select a type of context model set. Each type of context model set includes multiple context model subsets.
  • the selection method is determined according to the preset conditions that the current block meets. According to the determined selection method, the selected one type of context model set includes A context model subset is selected from a plurality of context model subsets, and the context model is determined from the selected context model subset.
  • the selection method is determined according to the preset conditions satisfied by the current block, and the specific implementation method of selecting a context model subset from the multiple context model subsets included in the selected one type of context model set according to the determined selection method It can be: when the current block satisfies a preset condition, according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, a context model sub-set is selected from a plurality of context model subsets included in the selected context model set. set.
  • a context model sub-set is selected from a plurality of context model subsets included in the selected context model set. set.
  • the flag to be decoded determines the context model based on the linear combination of pos_x and pos_y.
  • the specific implementation can be See the above example. Otherwise, the to-be-decoded flag bit determines the context model based on the positions of pos_x and pos_y, and the specific implementation manner can refer to the foregoing embodiment.
  • one type of context model set is selected from the multi-type context model set according to the target position coordinate information of the target scanning area, and then the selection method is determined according to the preset conditions satisfied by the current block, and the selection method is selected according to the determined selection method.
  • the selection of a subset of context models from the selected one type of context model set is taken as an example for illustration.
  • the selection method may be determined first according to the preset conditions satisfied by the current block, a type of context model set is selected from the multi-type context model set according to the determined selection method, and then the target scanning area Select a context model subset from the selected one type of context model set.
  • the selection method may be selected based on the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, or selected based on the coordinate value of the position of the coefficient to be decoded and the coordinate information of the target position.
  • Step 504 According to the context model, decode the flag to be decoded.
  • step 204 in the embodiment of FIG. 2 described above, which will not be repeated here.
  • the code stream of the current block is obtained.
  • the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position
  • the coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and decodes the to-be-decoded flag according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
  • a type of context model set may be selected from a set of multiple types of context models according to the target scanning area to ensure that the grouping method matches the SRCC scanning method. Then, according to the position of the coefficient to be decoded in the target scanning area, a context model subset is selected from the selected context model set, and then the to-be-decoded flag of the coefficient to be decoded is determined from the selected context model subset.
  • the bit context model makes the region where the transform coefficients are located more finely divided into low-frequency, intermediate-frequency and high-frequency regions, which improves decoding efficiency.
  • first type of context model set second type of context model set, and third type of context model set are only used to distinguish groups.
  • the first type of context model set, the second type of context model set and the third type of context model set The type context model set is different from the first type context model set, the second type context model set, and the third type context model set in other embodiments.
  • an embodiment of the present application also provides a decoding method, which may be executed by the above electronic device, and the method may include the following steps.
  • Step A1 Obtain the code stream of the current block.
  • step 201 in the embodiment of FIG. 2, and details are not repeated here.
  • Step A2 When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the current block's coordinate information.
  • the abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. coordinate.
  • step 202 in the embodiment of FIG. 2, and details are not repeated here.
  • Step A3 For the coefficient to be decoded in the target scanning area of the current block, determine the context model of the to-be-decoded flag of the coefficient to be decoded.
  • the target scanning area is the scanning area determined based on the target position coordinate information.
  • the context model It is determined from at least three types of context model sets at least according to the coordinate value of the position of the coefficient to be decoded.
  • the context model is determined from at least three types of context model sets at least according to the coordinate value of the position of the coefficient to be decoded. There may be multiple specific implementations.
  • the context model is determined from at least three types of context model sets based on at least the coordinate value of the position where the coefficient to be decoded is located, including: determining the coordinate value of the first target position according to the target position coordinate information, and the context The model is determined at least according to the coordinate value of the position of the coefficient to be decoded and the coordinate value of the first target position, the first target position is located in the target scanning area and the target position indicated by the target position coordinate information is excluded.
  • the first target position can be any position in the target scanning area except the position where the (SRx, SRy) point is located.
  • the first target position can also be based on the target position, which is ( The position of the point (SRx, SRy) is determined.
  • the first target position may also be (SRx/2, SRy/2).
  • the context model is selected from the first type of context model set; when the abscissa value of the position where the coefficient to be decoded is greater than the abscissa value of the first target position, and the ordinate value of the position where the coefficient to be decoded is When the ordinate value is greater than the first target position, the context model is selected from the third type of context model set; otherwise, the context model is selected from the second type of context model set.
  • the context models corresponding to the to-be-decoded flag bits of the coefficients to be decoded can be divided into the first-type context model set, the second-type context model set, and the third-type context model set according to the rules, it can be based on the abscissa of the position of the coefficient to be decoded.
  • the magnitude relationship between the value and the abscissa value of the first target position, and the magnitude relationship between the ordinate value of the position where the coefficient to be decoded and the ordinate value of the first target position determine the context model of the flag to be decoded Choose from a collection of context models.
  • the context model is determined from at least three types of context model sets based on at least the coordinate value of the position where the coefficient to be decoded is located, including: determining the second target position and the third target position according to the target position coordinate information The coordinate value, the context model is determined at least according to the coordinate value of the position where the coefficient to be decoded is located, the coordinate value of the second target position and the third target position.
  • the context model is selected from the first type of context model set; when the abscissa value of the position where the coefficient to be decoded is greater than the abscissa value of the third target position, and the ordinate value of the position where the coefficient to be decoded is When the ordinate value is greater than the third target position, the context model is selected from the third type of context model set; otherwise, the context model is selected from the second type of context model set.
  • the abscissa and ordinate of the second target position and the third target position can be set according to the actual situation, such as 4, 8, 16, etc. It should be noted that the abscissa value of the second target position should be less than The abscissa value of the third target position, and the ordinate value of the second target position should be smaller than the ordinate value of the third target position.
  • the context models corresponding to the to-be-decoded flag bits of the coefficients to be decoded can be divided into the first-type context model set, the second-type context model set, and the third-type context model set according to the rules, it can be based on the abscissa of the position of the coefficient to be decoded.
  • the size relationship between the abscissa and the second target position, the size relationship between the ordinate of the position of the coefficient to be decoded and the ordinate of the second target position, the relationship between the abscissa of the position of the coefficient to be decoded and the third target position determines which type of context model set the context model of the flag to be decoded is selected from.
  • step 203 in the embodiment of FIG. 2, and details are not repeated here.
  • Step A4 According to the context model, decode the flag to be decoded.
  • step 204 in the embodiment in FIG. 2, and details are not repeated here.
  • the code stream of the current block is obtained.
  • the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position
  • the coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and decodes the to-be-decoded flag according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
  • first type of context model set second type of context model set, and third type of context model set are only used to distinguish groups.
  • the first type of context model set, the second type of context model set and the third type of context model set The type context model set is different from the first type context model set, the second type context model set, and the third type context model set in other embodiments.
  • an embodiment of the present application also provides a decoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
  • Step B1 Obtain the code stream of the current block.
  • step 201 in the embodiment of FIG. 2, and details are not repeated here.
  • Step B2 When it is determined that the current block adopts the coefficient coding SRCC based on the scanning area, obtain the target position coordinate information from the code stream.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value.
  • the first coordinate The value is the abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient.
  • step 202 in the embodiment of FIG. 2, and details are not repeated here.
  • Step B3 For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined at least according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded.
  • the context model when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x ⁇ c, the context model is selected from the first type of context model set; when the When the coordinate value of the position of the coefficient to be decoded satisfies the linear relationship a*pos_y+b*pos_x>c, the context model is selected from the second type of context model set; where a and b are constants, and pos_x is the abscissa value of the position of the coefficient to be decoded, and pos_y is the ordinate value of the position of the coefficient to be decoded.
  • the a is the first coordinate value
  • the b is the second coordinate value
  • the first value is the product of the first coordinate value and the second coordinate value.
  • the to-be-decoded coefficients can be determined according to the linear relationship satisfied by the coordinate values of the positions of the coefficients to be decoded.
  • the context model of the decoding flag is selected from the set of context models.
  • the context model is selected from the first type of context model set; when the When the coordinate value of the position of the coefficient to be decoded satisfies the linear relationship a1*pos_y+b1*pos_x>c1, and a2*pos_y+b2*pos_x ⁇ c2, the context model is selected from the second type of context model set ; When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a2*pos_y+b2*pos_x>c2, the context model is selected from the third type of context model set; among them, the a1, b1, a2, b2, c1, and c2 are constants, the c1 is smaller than the c2, the pos_x is the abscissa value of the position of the coefficient to be decoded
  • the a1 and a2 are both the first coordinate value
  • the b1 and b2 are both the second coordinate value
  • the c1 is half of the product between the first coordinate value and the second coordinate value
  • the c2 is The product of the first coordinate value and the second coordinate value.
  • the context models corresponding to the to-be-decoded flag bits of the coefficients to be decoded can be divided into the first-type context model set, the second-type context model set, and the third-type context model set according to the rules, it can be based on the coordinate value of the position of the coefficient to be decoded.
  • the satisfied linear relationship determines which type of context model set the context model of the flag to be decoded is selected from.
  • the context model is at least determined according to the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded, and the introduction is complete.
  • the above-mentioned context model is determined at least according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the coordinate information of the target position.
  • the specific implementation process includes: When the abscissa value of the position of the decoding coefficient is less than or equal to the first coordinate threshold, and the ordinate value of the position of the coefficient to be decoded is less than or equal to the second coordinate threshold, the context model is selected from the first type of context model set; otherwise , When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x>c, the context model is selected from the third type of context model set; otherwise, the context model is from The second type of context model set is selected; wherein, the first coordinate threshold is smaller than the first coordinate value, and the second coordinate threshold is smaller than the second coordinate value.
  • the context models corresponding to the to-be-decoded flag bits of the coefficients to be decoded can be divided into the first-type context model set, the second-type context model set, and the third-type context model set according to the rules, it can be based on the coordinate value of the position of the coefficient to be decoded.
  • the satisfied linear relationship, the coordinate value of the position where the coefficient to be decoded is located, and the target position coordinate information determine which type of context model set the context model of the flag bit to be decoded is selected from.
  • step 203 in the embodiment of FIG. 2, and details are not repeated here.
  • the selected type of context model set may also be divided into more than three context model sets, that is, the selected type of context model set may also correspond to four context model sets, five context model sets, and so on.
  • Step B4 According to the context model, decode the flag to be decoded.
  • step 204 in the embodiment in FIG. 2, and details are not repeated here.
  • the code stream of the current block is obtained.
  • the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position
  • the coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and decodes the to-be-decoded flag according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
  • first type of context model set second type of context model set, and third type of context model set are only used to distinguish groups.
  • the first type of context model set, the second type of context model set and the third type of context model set The type context model set is different from the first type context model set, the second type context model set, and the third type context model set in other embodiments.
  • an embodiment of the present application also provides a decoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
  • Step C1 Obtain the code stream of the current block.
  • step 201 in the embodiment of FIG. 2, and details are not repeated here.
  • Step C2 When it is determined that the current block adopts the coefficient coding SRCC based on the scanning area, the target position coordinate information is obtained from the code stream.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value.
  • the first coordinate The value is the abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient.
  • step 202 in the embodiment of FIG. 2, and details are not repeated here.
  • Step C3 For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined according to the determined selection method after the selection method is determined at least based on the preset condition met by the current block.
  • the selection method includes: selecting according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, or selecting according to the coordinate value of the position of the coefficient to be decoded and the coordinate information of the target position.
  • the context model is determined based on at least the preset conditions met by the current block and the specific implementation manner determined according to the determined selection manner may be: when the current block meets the preset conditions, the context model is at least based on the pending conditions.
  • the linear relationship that the coordinate value of the position of the decoding coefficient satisfies is determined; when the current block does not meet the preset condition, the context model is determined at least according to the coordinate value of the position of the coefficient to be decoded and the target position coordinate information.
  • the preset condition includes one of the following conditions: the first coordinate value or the second coordinate value is zero; the product of the first coordinate value and the second coordinate value is less than the first coordinate threshold; The coordinate value is greater than or equal to the second coordinate threshold and the second coordinate value is greater than or equal to the third coordinate threshold; the first coordinate value is less than or equal to the second coordinate threshold or the second coordinate value is less than the third coordinate threshold.
  • the first coordinate threshold, the second coordinate threshold, and the third coordinate threshold can be set according to actual conditions.
  • step 203 in the embodiment of FIG. 2, and details are not repeated here.
  • Step C4 According to the context model, decode the flag to be decoded.
  • step 204 in the embodiment in FIG. 2, and details are not repeated here.
  • the code stream of the current block is obtained.
  • the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position
  • the coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and the to-be-decoded flag is decoded according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
  • the embodiment of the present application also provides an encoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
  • Step D1 When the current block adopts the coefficient coding SRCC based on the scanning area, obtain the target position coordinate information, the target position coordinate information is composed of the first coordinate value and the second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block .
  • the scan area corresponding to the transform coefficient can be determined.
  • the scan area is the abscissa SRx (first coordinate value) of the rightmost non-zero transform coefficient in the transform coefficient of the current block and the transform coefficient.
  • the ordinate SRy (second coordinate value) of the bottom non-zero transformation coefficient is determined.
  • a coordinate system can be established with a certain vertex of the current block as the origin. Based on this, the encoder can determine the target scanning area through the information of SRx and SRy, and the position corresponding to the SRx and SRy is the target position corresponding to the target scanning area.
  • step 202 in the embodiment of FIG. 2, and details are not repeated here.
  • Step D2 For the coefficient to be coded in the target scanning area of the current block, a context model of the to-be-coded flag of the coefficient to be coded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined at least according to the coordinate information of the target position.
  • the coefficient to be coded is the coefficient to be coded obtained in the scanning order, that is, the target scanning area can be scanned in a certain order during the coding process, as shown in Figure 3, the scanning order can be from the lower right corner Reverse zigzag scan to the upper left corner.
  • Each scan of a transform coefficient is determined as the coefficient to be coded, and then the flag bit to be coded of the coefficient to be coded can be determined according to the method provided in the embodiment of the present application.
  • the flag bit to be encoded is at least one of the first flag bit, the second flag bit, and the third flag bit.
  • the first flag bit is used to indicate whether the transform coefficient is non-zero.
  • the second flag bit is used to indicate whether the absolute value of the transform coefficient is greater than one.
  • the third flag bit is used to indicate whether the absolute value of the transform coefficient is greater than 2.
  • the first flag bit is significant flag
  • the second flag bit is GT1 flag
  • the third flag bit is GT2 flag.
  • at least one flag bit is required to indicate the coefficient to be coded, that is, the coefficient to be coded can be indicated by one flag bit or multiple flag bits. For example, if the coefficient to be coded is 1, a significant flag is required to indicate that the coefficient to be coded is non-zero, and GT1flag is used to indicate that the magnitude of the coefficient to be coded is less than or equal to 1. If the coefficient to be coded is 0, then only a significant flag is needed to indicate that the coefficient to be coded is zero.
  • the encoding of transform coefficients can be realized by encoding the syntax element used to indicate the transform coefficient, wherein at least one flag bit in the syntax element can be encoded by the context model.
  • each flag Bits can be coded through a variety of different context models. As shown in Table 1 in the embodiment of FIG. 2, it can be known that each flag bit corresponds to multiple context models. Therefore, it is necessary to determine which context model is used to encode the coefficients to be encoded during the encoding process.
  • the context model is determined at least according to the coordinate information of the target position.
  • the context model is determined at least according to the coordinate information of the target position.
  • Step D3 encoding the flag to be encoded according to the context model.
  • the context model may be determined in this type of context model set according to the number of non-zero coefficients in the five transformation coefficients that have been encoded before the coefficients to be encoded after a type of context model set is determined.
  • the to-be-coded flag can be coded according to the context model.
  • step 204 in the embodiment in FIG. 2, and details are not repeated here.
  • the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information
  • the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
  • the embodiment of the present application also provides an encoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
  • Step E1 When the current block adopts the coefficient coding SRCC based on the scanning area, obtain the target position coordinate information, the target position coordinate information is composed of the first coordinate value and the second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block .
  • step 202 in the embodiment of FIG. 2, and details are not repeated here.
  • Step E2 For the coefficient to be coded in the target scan area of the current block, determine the context model of the flag to be coded of the coefficient to be coded, the target scan area is a scan area determined based on the target position coordinate information, and the context model It is determined from at least three types of context model sets at least according to the coordinate value of the position of the coefficient to be decoded.
  • step A3 For a specific implementation manner, refer to step A3 in the above-mentioned embodiment, which will not be repeated here.
  • Step E3 According to the context model, the flag bit to be encoded is encoded.
  • step 204 in the embodiment in FIG. 2, and details are not repeated here.
  • the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-coded flag of the coefficient to be encoded is determined at least according to the target position coordinate information
  • the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
  • the embodiment of the present application also provides an encoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
  • Step F1 When the current block adopts the coefficient coding SRCC based on the scanning area, obtain the target position coordinate information, the target position coordinate information is composed of the first coordinate value and the second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block .
  • step 202 in the embodiment of FIG. 2, and details are not repeated here.
  • Step F2 For the coefficient to be coded in the target scanning area of the current block, a context model of the to-be-coded flag of the coefficient to be coded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined at least according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded.
  • step B3 For a specific implementation manner, refer to step B3 in the above-mentioned embodiment, which will not be repeated here.
  • Step F3 According to the context model, the flag bit to be encoded is encoded.
  • step 204 in the embodiment in FIG. 2, and details are not repeated here.
  • the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information
  • the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
  • the embodiment of the present application also provides an encoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
  • Step G1 When the current block adopts the coefficient coding SRCC based on the scanning area, obtain the target position coordinate information, the target position coordinate information is composed of the first coordinate value and the second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block .
  • step 202 in the embodiment of FIG. 2, and details are not repeated here.
  • Step G2 For the coefficient to be coded in the target scan area of the current block, determine the context model of the flag to be coded of the coefficient to be coded.
  • the target scan area is a scan area determined based on the target position coordinate information, and the context model It is determined according to the determined selection method at least after the selection method is determined based on the preset condition met by the current block.
  • step C3 For a specific implementation manner, refer to step C3 in the foregoing embodiment, and details are not repeated here.
  • Step G3 According to the context model, encode the flag to be encoded.
  • step 204 in the embodiment in FIG. 2, and details are not repeated here.
  • the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information
  • the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
  • FIG. 11 is a schematic structural diagram of a decoding device provided by an embodiment of the present application.
  • the device may include:
  • the code stream obtaining module 1110 is used to obtain the code stream of the current block
  • the information obtaining module 1120 is configured to obtain target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate.
  • the first coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block
  • the second coordinate value is the transformation coefficient of the current block Among the included non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
  • the model determination module 1130 is configured to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, where the target scan area is based on the target position coordinate information For the determined scanning area, the context model is determined at least according to the coordinate information of the target position;
  • the decoding module 1140 is configured to decode the to-be-decoded flag bit according to the context model.
  • the context model is determined at least according to the area of the target scan area, and the area of the target scan area is determined according to the target position coordinate information.
  • the context model when the area of the target scan area is less than or equal to the first area threshold, the context model is selected from the first type of upper and lower model set; when the area of the scan area When it is greater than the first area threshold, the context model is selected from the second type of upper and lower model set.
  • the context model when the area of the target scan area is less than or equal to the first area threshold, the context model is selected from the first type of context model set; when the area of the target scan area is When the area is greater than the first area threshold and less than or equal to the second area threshold, the context model is selected from the second type of context model set; when the area of the target scan area is greater than the second area threshold, The context model is selected from the third type of context model set.
  • the context model is determined at least according to the size of the target scanning area, and the size of the target scanning area is determined according to the target position coordinate information.
  • the context model when the size of the target scan area is less than or equal to the first size threshold, the context model is selected from the first type of upper and lower model set; when the size of the scan area When it is greater than the first size threshold, the context model is selected from the second type of upper and lower model set.
  • the context model when the size of the target scan area is less than or equal to the first size threshold, the context model is selected from the first type of context model set; when the size of the target scan area is When the size is greater than the first size threshold and less than or equal to the second size threshold, the context model is selected from the second type of context model set; when the size of the target scanning area is greater than the second size threshold, The context model is selected from the third type of context model set.
  • the context model is determined at least according to the short side of the target scanning area, and the short side of the target scanning area is determined according to the target position coordinate information.
  • the context model when the short side of the target scan area is less than or equal to the first short side threshold, the context model is selected from the first type of upper and lower model set; when the scan area When the short side of is greater than the first short side threshold, the context model is selected from the set of upper and lower models of the second type.
  • the context model when the short side of the target scan area is less than or equal to the first short side threshold, the context model is selected from the first type of context model set; when the target scan When the short side of the region is greater than the first short side threshold and less than or equal to the second short side threshold, the context model is selected from the second type of context model set; when the short side of the target scanning area is greater than the When the second short-side threshold is used, the context model is selected from the third type of context model set.
  • the context model is determined at least according to the linear relationship that the coordinate value of the target position coordinate information satisfies.
  • the context model when the coordinate value of the target position coordinate information satisfies the linear relationship a*SRx+b*SRy+c ⁇ n1, the context model is from the first type of context Selected from the model set; when the coordinate value of the target position coordinate information satisfies the linear relationship a*SRx+b*SRy+c>n1, the context model is selected from the second type of context model set
  • the a, b, and c are constants
  • the SRx is the first coordinate value
  • the SRy is the second coordinate value.
  • the context model when the coordinate value of the target position coordinate information satisfies the linear relationship a*SRx+b*SRy+c ⁇ n1, the context model is from the first type of context Selected from the model set; when the coordinate value of the target position coordinate information satisfies the linear relationship n1 ⁇ a*SRx+b*SRy+c ⁇ n2, the context model is from the second type of context model set Selected; when the linear relational expression satisfied by the coordinate value of the target position coordinate information is a*SRx+b*SRy+c>n2, the context model is selected from the third type of context model set; wherein, The a, b, and c are constants, the SRx is the first coordinate value, and the SRy is the second coordinate value.
  • the flag to be decoded is at least one of a first flag, a second flag, and a third flag; the first flag is used to indicate whether the transform coefficient is non- Zero; the second flag bit is used to indicate whether the absolute value of the transform coefficient is greater than 1; the third flag bit is used to indicate whether the absolute value of the transform coefficient is greater than 2.
  • the context model is determined at least according to the coordinate information of the target location and the coordinate value of the location where the coefficient to be decoded is located.
  • one type of context model set is selected from multiple types of context model sets, and each type of context model set includes multiple context model subsets;
  • a context model subset is selected from a plurality of context model subsets included in the selected one type of context model set, and the context model is determined from the selected context model subset .
  • the context model is determined at least according to a linear relationship that is satisfied by the target position coordinate information and the coordinate value of the position where the coefficient to be decoded is located.
  • the model determination module 1130 is configured to: select a set of context models from a set of multiple types of context models according to the target position coordinate information of the target scan area, and each type of context model The set includes multiple context model subsets; according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, a context model subset is selected from the multiple context model subsets included in the selected context model set, so The context model is determined from a selected subset of context models.
  • the context model when the linear relationship that the coordinate value of the position where the coefficient to be decoded satisfies is a*pos_y+b*pos_x ⁇ c, the context model is derived from the first context model Centrally selected; when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x>c, the context model is selected from the second context model subset; where, The a and b are constants, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the ordinate value of the position of the coefficient to be decoded.
  • said a is the first coordinate value
  • said b is the second coordinate value
  • the first value is the first coordinate value and the second coordinate value.
  • the context model when the linear relationship that the coordinate value of the position where the coefficient to be decoded satisfies is a1*pos_y+b1*pos_x ⁇ c1, the context model is derived from the first context model Centralized selection; when the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a1*pos_y+b1*pos_x>c1, and a2*pos_y+b2*pos_x ⁇ c2, the context model is from The second context model is selected from the subset; when the coordinate value of the position where the coefficient to be decoded satisfies the linear relationship a2*pos_y+b2*pos_x ⁇ c2, the context model is selected from the third context model subset Wherein, the a1, b1, a2, b2, c1, and c2 are constants, the c1 is less than the c2, the pos_x is the abscissa value of the position of the coefficient to be decode
  • the a1 and a2 are both the first coordinate value
  • the b1 and b2 are both the second coordinate value
  • the c1 is the first coordinate value and Half of the product between the second coordinate values
  • the c2 is the product between the first coordinate value and the second coordinate value.
  • the context model is based on at least a linear relationship satisfied by the target position coordinate information, the coordinate value of the position where the coefficient to be decoded is located, and the coordinate value of the position where the coefficient to be decoded is located.
  • the formula is determined.
  • the model determination module 1130 is configured to: select a set of context models from a set of multiple types of context models according to the target position coordinate information of the target scan area, and each type of context model The set includes a plurality of context model subsets; according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the target position coordinate information, select a type of context A context model subset is selected from a plurality of context model subsets included in the model set, and the context model is determined from the selected context model subset.
  • the context model is determined at least according to the target position coordinate information and the preset condition satisfied by the current block.
  • the model determination module 1130 is further configured to: select a set of context models from a set of multiple types of context models according to the target position coordinate information of the target scan area, and each type of context
  • the model set includes multiple context model subsets; the selection method is determined according to the preset conditions satisfied by the current block, and a context is selected from the multiple context model subsets included in the selected context model set according to the determined selection method A subset of models, and the context model is determined from a selected subset of context models.
  • the model determination module 1130 is configured to determine the area of the target scanning area according to the target position coordinate information of the target scanning area, and according to the area, from multiple types of contexts Select a type of context model set from the model set; or, determine the size of the target scan area according to the target position coordinate information of the target scan area, and select a type of context model from a set of multiple types of context models according to the size Or, determine the short side of the target scan area according to the target position coordinate information of the target scan area, and select a type of context model set from a set of multiple types of context models according to the short side; or, according to all According to the target position coordinate information of the target scanning area, a linear relationship expression satisfied by the coordinate value of the target position coordinate information is determined, and a type of context model set is selected from a plurality of types of context model sets according to the linear relationship expression.
  • the code stream of the current block is obtained.
  • the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position
  • the coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and the to-be-decoded flag is decoded according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
  • an embodiment of the present application further provides a decoding device, which may include:
  • the code stream acquisition module is used to obtain the code stream of the current block
  • the information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value.
  • the first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient of the current block.
  • the ordinate of the non-zero coefficient with the largest absolute value of the ordinate is the abscissa of the non-zero coefficient of the current block.
  • the model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information
  • the context model is determined from at least three types of context model sets according to at least the coordinate values of the positions where the coefficients to be decoded are located;
  • the decoding module is configured to decode the to-be-decoded flag bit according to the context model.
  • the coordinate value of the first target position is determined according to the target position coordinate information, and the context model is based on at least the coordinate value of the position where the coefficient to be decoded is located and the first target The coordinate value of the position is determined, the first target position is located in the target scanning area and the target position indicated by the target position coordinate information is excluded.
  • the context model when the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the first target position, and the ordinate value of the position where the coefficient to be decoded is less than or equal to
  • the context model is selected from the first type of context model set; when the abscissa value of the position where the coefficient to be decoded is located is greater than the abscissa value of the first target position Value, and the ordinate value of the position where the coefficient to be decoded is located is greater than the ordinate value of the first target position, the context model is selected from the third type of context model set; otherwise, the context model is Selected from the second type of context model collection.
  • the coordinate values of the second target position and the third target position are determined according to the target position coordinate information, and the context model is at least based on the coordinate values of the positions where the coefficients to be decoded are located, The coordinate values of the second target position and the third target position are determined.
  • the context model when the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the second target position, and the ordinate value of the position where the coefficient to be decoded is less than or equal to
  • the context model is selected from the first type of context model set; when the abscissa value of the position where the coefficient to be decoded is located is greater than the abscissa value of the third target position Value, and the ordinate value of the position where the coefficient to be decoded is greater than the ordinate value of the third target position, the context model is selected from the third type of context model set; otherwise, the context model is Selected from the second type of context model collection.
  • the code stream of the current block is obtained.
  • the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position
  • the coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and the to-be-decoded flag is decoded according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
  • an embodiment of the present application further provides a decoding device, which may include:
  • the code stream acquisition module is used to obtain the code stream of the current block
  • the information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value.
  • the first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient of the current block.
  • the ordinate of the non-zero coefficient with the largest absolute value of the ordinate is the abscissa of the non-zero coefficient of the current block.
  • the model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information
  • the scanning area of the, the context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
  • the decoding module is configured to decode the to-be-decoded flag bit according to the context model.
  • the context model when the linear relationship that the coordinate value of the position where the coefficient to be decoded satisfies is a*pos_y+b*pos_x ⁇ c, the context model is from the first type of context model Selected from the set; when the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a*pos_y+b*pos_x>c, the context model is selected from the second type of context model set; wherein
  • the a and b are constants, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the ordinate value of the position of the coefficient to be decoded.
  • said a is the first coordinate value
  • said b is the second coordinate value
  • the first value is the first coordinate value and the second coordinate value.
  • the context model when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a1*pos_y+b1*pos_x ⁇ c1, the context model is from the first type of context model Selected from the set; when the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a1*pos_y+b1*pos_x>c1, and a2*pos_y+b2*pos_x ⁇ c2, the context model is from Selected from the second type of context model set; when the coordinate value of the position where the coefficient to be decoded satisfies the linear relationship a2*pos_y+b2*pos_x ⁇ c2, the context model is from the third type of context model set Where the a1, b1, a2, b2, c1, and c2 are constants, the c1 is less than the c2, the pos_x is the abscissa value of the position of the coefficient to be decode
  • the a1 and a2 are both the first coordinate value
  • the b1 and b2 are both the second coordinate value
  • the c1 is the first coordinate value and Half of the product between the second coordinate values
  • the c2 is the product between the first coordinate value and the second coordinate value.
  • the context model is based on at least a linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the coordinates of the target position.
  • the information is OK.
  • the The context model is selected from the first type of context model set; otherwise, when the coordinate value of the position where the coefficient to be decoded satisfies the linear relationship a*pos_y+b*pos_x>c, the context model is from The third type of context model set is selected; otherwise, the context model is selected from the second type of context model set; wherein, the first threshold is less than the first coordinate value, and the second threshold is less than the first Two coordinate values.
  • the code stream of the current block is obtained.
  • the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position
  • the coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and the to-be-decoded flag is decoded according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
  • an embodiment of the present application further provides a decoding device, which may include:
  • the code stream acquisition module is used to obtain the code stream of the current block
  • the information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information consists of a first coordinate value and a second coordinate value.
  • the first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block
  • the second coordinate value is the abscissa of the non-zero coefficient of the current block.
  • the ordinate of the non-zero coefficient with the largest absolute value of the ordinate is the abscissa of the non-zero coefficient of the current block.
  • the model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information
  • the context model is determined according to the determined selection method after determining a selection method at least based on a preset condition satisfied by the current block;
  • the decoding module is configured to decode the to-be-decoded flag bit according to the context model.
  • the selection is made according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located; or, according to the coordinate value of the position where the coefficient to be decoded is located and the target position coordinate information Make a selection.
  • the context model when the current block satisfies a preset condition, the context model is determined at least according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded; when the current block When the block does not satisfy the preset condition, the context model is determined at least according to the coordinate value of the position where the coefficient to be decoded is located and the target position coordinate information.
  • the preset condition includes one of the following conditions: the first coordinate value or the second coordinate value is zero; the first coordinate value and the first coordinate value The product of the two coordinate values is less than the first coordinate threshold; the first coordinate value is greater than or equal to the second coordinate threshold and the second coordinate value is greater than or equal to the third coordinate threshold; the first coordinate value is less than or equal to the second coordinate threshold or The second coordinate value is less than the third coordinate threshold.
  • the code stream of the current block is obtained.
  • the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position
  • the coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and the to-be-decoded flag is decoded according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
  • the decoding device provided in the above embodiment implements the decoding method
  • only the division of the above functional modules is used as an example for illustration.
  • the above functions can be allocated by different functional modules according to needs, i.e.
  • the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the decoding device provided in the foregoing embodiment and the decoding method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
  • FIG. 12 is a schematic structural diagram of an encoding device provided by an embodiment of the present application.
  • the device may include:
  • the obtaining module 1210 is configured to obtain target position coordinate information when the current block adopts the scanning area-based coefficient coding SRCC, the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the absolute value of the ordinate of the non-zero coefficient included in the transformation coefficient of the current block The ordinate of the largest non-zero coefficient;
  • the determining module 1220 is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information
  • the scanning area of the, the context model is determined according to at least the target position coordinate information
  • the encoding module 1230 is configured to encode the flag bit to be encoded according to the context model.
  • the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information
  • the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
  • an embodiment of the present application further provides an encoding device, which may include:
  • the acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
  • the determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined from at least three types of context model sets according to at least the coordinate value of the position where the coefficient to be decoded is located;
  • the encoding module is used to encode the to-be-encoded flag bit according to the context model.
  • the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information
  • the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
  • an embodiment of the present application further provides an encoding device, which may include:
  • the acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
  • the determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined at least according to a linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
  • the encoding module is used to encode the to-be-encoded flag bit according to the context model.
  • the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information
  • the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
  • an embodiment of the present application further provides an encoding device, which may include:
  • the acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area.
  • the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
  • the determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined according to the determined selection method after a selection method is determined at least based on a preset condition satisfied by the current block;
  • the encoding module is used to encode the to-be-encoded flag bit according to the context model.
  • the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information
  • the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
  • the encoding device provided in the above embodiment implements the encoding method
  • only the division of the above functional modules is used as an example for illustration.
  • the above functions can be allocated by different functional modules according to needs, i.e.
  • the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the encoding device provided in the foregoing embodiment and the encoding method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
  • FIG. 13 is a structural block diagram of an electronic device 1300 provided by an embodiment of the present application.
  • the electronic device can be used for encoding and decoding.
  • the electronic device 1300 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image expert compression standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, The dynamic image expert compresses the standard audio level 4) Player, laptop or desktop computer.
  • the electronic device 1300 may also be called user equipment, portable terminal, laptop terminal, desktop terminal and other names.
  • the electronic device 1300 includes a processor 1301 and a memory 1302.
  • the processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on.
  • the processor 1301 may adopt at least one hardware form among DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array, Programmable Logic Array). achieve.
  • the processor 1301 may also include a main processor and a coprocessor.
  • the main processor is a processor used to process data in the awake state, also called a CPU (Central Processing Unit, central processing unit); the coprocessor is A low-power processor used to process data in the standby state.
  • the processor 1301 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing content that needs to be displayed on the display screen.
  • the processor 1301 may further include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
  • AI Artificial Intelligence
  • the memory 1302 may include one or more computer-readable storage media, which may be non-transitory.
  • the memory 1302 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.
  • the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 1301 to implement the decoding method provided in the method embodiment of the present application , Coding method.
  • the electronic device 1300 may optionally further include: a peripheral device interface 1303 and at least one peripheral device.
  • the processor 1301, the memory 1302, and the peripheral device interface 1303 may be connected by a bus or a signal line.
  • Each peripheral device can be connected to the peripheral device interface 1303 through a bus, a signal line, or a circuit board.
  • the peripheral device includes: at least one of a radio frequency circuit 1304, a touch display screen 1305, a camera 1306, an audio circuit 1307, a positioning component 1308, and a power supply 1309.
  • the peripheral device interface 1303 can be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 1301 and the memory 1302.
  • the processor 1301, the memory 1302, and the peripheral device interface 1303 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 1301, the memory 1302, and the peripheral device interface 1303 or The two can be implemented on a separate chip or circuit board, which is not limited in this embodiment.
  • the radio frequency circuit 1304 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals.
  • the radio frequency circuit 1304 communicates with a communication network and other communication devices through electromagnetic signals.
  • the radio frequency circuit 1304 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals.
  • the radio frequency circuit 1304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and so on.
  • the radio frequency circuit 1304 can communicate with other terminals through at least one wireless communication protocol.
  • the wireless communication protocol includes but is not limited to: World Wide Web, Metropolitan Area Network, Intranet, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area network and/or WiFi (Wireless Fidelity, wireless fidelity) network.
  • the radio frequency circuit 1304 may also include a circuit related to NFC (Near Field Communication), which is not limited in this application.
  • the display screen 1305 is used to display UI (User Interface).
  • the UI can include graphics, text, icons, videos, and any combination thereof.
  • the display screen 1305 also has the ability to collect touch signals on or above the surface of the display screen 1305.
  • the touch signal may be input to the processor 1301 as a control signal for processing.
  • the display screen 1305 may also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards.
  • the display screen 1305 may be a flexible display screen, which is arranged on the curved surface or the folding surface of the electronic device 1300. Even the display screen 1305 can also be set as a non-rectangular irregular pattern, that is, a special-shaped screen.
  • the display screen 1305 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
  • the camera assembly 1306 is used to capture images or videos.
  • the camera assembly 1306 includes a front camera and a rear camera.
  • the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal.
  • the camera assembly 1306 may also include a flashlight.
  • the flash can be a single-color flash or a dual-color flash. Dual color temperature flash refers to a combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.
  • the audio circuit 1307 may include a microphone and a speaker.
  • the microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals and input them to the processor 1301 for processing, or input to the radio frequency circuit 1304 to implement voice communication.
  • the microphone can also be an array microphone or an omnidirectional collection microphone.
  • the speaker is used to convert the electrical signal from the processor 1301 or the radio frequency circuit 1304 into sound waves.
  • the speaker can be a traditional thin-film speaker or a piezoelectric ceramic speaker.
  • the speaker When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into human audible sound waves, but also convert the electrical signal into human inaudible sound waves for distance measurement and other purposes.
  • the audio circuit 1307 may also include a headphone jack.
  • the positioning component 1308 is used to locate the current geographic location of the electronic device 1300 to implement navigation or LBS (Location Based Service, location-based service).
  • the positioning component 1308 may be a positioning component based on the GPS (Global Positioning System, Global Positioning System) of the United States, the Beidou system of China, or the Galileo system of Russia.
  • the power supply 1309 is used to supply power to various components in the electronic device 1300.
  • the power supply 1309 may be alternating current, direct current, disposable batteries, or rechargeable batteries.
  • the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery.
  • a wired rechargeable battery is a battery charged through a wired line
  • a wireless rechargeable battery is a battery charged through a wireless coil.
  • the rechargeable battery can also be used to support fast charging technology.
  • the electronic device 1300 further includes one or more sensors 1310.
  • the one or more sensors 1310 include, but are not limited to: an acceleration sensor 1311, a gyroscope sensor 1312, a pressure sensor 1313, a fingerprint sensor 1314, an optical sensor 1315, and a proximity sensor 1316.
  • the acceleration sensor 1311 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the electronic device 1300.
  • the acceleration sensor 1311 can be used to detect the components of gravitational acceleration on three coordinate axes.
  • the processor 1301 can control the touch screen 1305 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 1311.
  • the acceleration sensor 1311 may also be used for the collection of game or user motion data.
  • the gyroscope sensor 1312 can detect the body direction and rotation angle of the electronic device 1300, and the gyroscope sensor 1312 can cooperate with the acceleration sensor 1311 to collect the user's 3D actions on the electronic device 1300.
  • the processor 1301 can implement the following functions according to the data collected by the gyroscope sensor 1312: motion sensing (for example, changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
  • the pressure sensor 1313 may be disposed on the side frame of the electronic device 1300 and/or the lower layer of the touch display screen 1305.
  • the processor 1301 performs left and right hand recognition or quick operation according to the holding signal collected by the pressure sensor 1313.
  • the processor 1301 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 1305.
  • the operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
  • the fingerprint sensor 1314 is used to collect the user's fingerprint.
  • the processor 1301 identifies the user's identity according to the fingerprint collected by the fingerprint sensor 1314, or the fingerprint sensor 1314 identifies the user's identity according to the collected fingerprint.
  • the processor 1301 authorizes the user to perform related sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings.
  • the fingerprint sensor 1314 may be provided on the front, back or side of the electronic device 1300. When the electronic device 1300 is provided with a physical button or a manufacturer logo, the fingerprint sensor 1314 may be integrated with the physical button or the manufacturer logo.
  • the optical sensor 1315 is used to collect the ambient light intensity.
  • the processor 1301 may control the display brightness of the touch screen 1305 according to the intensity of the ambient light collected by the optical sensor 1315. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 1305 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 1305 is decreased.
  • the processor 1301 may also dynamically adjust the shooting parameters of the camera assembly 1306 according to the ambient light intensity collected by the optical sensor 1315.
  • the proximity sensor 1316 also called a distance sensor, is usually arranged on the front panel of the electronic device 1300.
  • the proximity sensor 1316 is used to collect the distance between the user and the front of the electronic device 1300.
  • the processor 1301 controls the touch screen 1305 to switch from the on-screen state to the off-screen state; when the proximity sensor 1316 When it is detected that the distance between the user and the front of the electronic device 1300 is gradually increasing, the processor 1301 controls the touch display screen 1305 to switch from the on-screen state to the on-screen state.
  • FIG. 13 does not constitute a limitation on the electronic device 1300, and may include more or fewer components than shown, or combine certain components, or adopt different component arrangements.
  • a computer-readable storage medium stores a computer program, and the computer program implements the steps of the method in the above-mentioned embodiments when the computer program is executed by a processor.
  • the computer-readable storage medium may be ROM (Read Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disk-ROM, optical disk read-only memory), magnetic tape , Floppy disks and optical data storage devices.
  • the computer-readable storage medium mentioned in this application may be a non-volatile storage medium, in other words, it may be a non-transitory storage medium.
  • a computer program product containing instructions is also provided, which when running on a computer, causes the computer to execute the steps of the decoding method and encoding method described above.

Abstract

Disclosed in the present invention are a decoding method, an encoding method, and an apparatus, relating to the technical field of video encoding-decoding. The method comprises: acquiring a code stream of a current block; when the current block is determined to use scan region-based coefficient coding (SRCC), acquiring target position coordinate information from the code stream, the target position coordinate information consisting of a first coordinate value and a second coordinate value; for a coefficient that is to be decoded in a target scanning region of the current block, determining a context model for a flag bit to be decoded of the coefficient to be decoded, the target scanning region being a scanning region determined on the basis of the target position coordinate information, and the context model being determined at least on the basis of the target position coordinate information; and on the basis of the context model, decoding the flag bit to be decoded. In the present application, a context model for a flag bit to be decoded is determined by means of a target scanning region, causing such a grouping mode to be compatible with an SRCC-technology scanning mode, thus improving decoding performance.

Description

解码方法、编码方法及装置Decoding method, encoding method and device
本申请要求于2019年08月27日提交的申请号为201910798693.6、发明名称为“解码方法、编码方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 201910798693.6 and the invention title "Decoding method, encoding method and device" filed on August 27, 2019, the entire content of which is incorporated into this application by reference.
技术领域Technical field
本申请涉及视频编解码技术领域,特别涉及一种解码方法、编码方法及装置。This application relates to the technical field of video coding and decoding, and in particular to a decoding method, coding method and device.
背景技术Background technique
随着信息技术的高速发展,视频信息量与日俱增,为了有效的存储和传输视频,通常要通过视频编码来对视频进行压缩。视频编码通常包括预测、变换、量化、熵编码等过程,通过熵编码可以对量化后的变换系数进行编码。变换系数的编码可以通过对用于指示变换系数的语法元素进行编码来实现,语法元素中的一些标志位可以通过上下文模型进行编码,且每种标志位能够选择的上下文模型通常包括多种,在实施中,如何确定每种标志位的上下文模型成为研究的热点。With the rapid development of information technology, the amount of video information is increasing day by day. In order to effectively store and transmit the video, it is usually necessary to compress the video through video coding. Video coding usually includes processes such as prediction, transformation, quantization, entropy coding, etc. The quantized transform coefficients can be coded through entropy coding. The encoding of transform coefficients can be realized by encoding syntax elements used to indicate transform coefficients. Some flag bits in the syntax elements can be encoded by context models, and the context models that can be selected for each flag bit usually include multiple types. In the implementation, how to determine the context model of each flag bit has become a hot research topic.
发明内容Summary of the invention
本申请实施例提供了一种解码方法、编码方法及装置,可以用于解决相关技术的编码性能较低的问题。所述技术方案如下:The embodiments of the present application provide a decoding method, encoding method, and device, which can be used to solve the problem of low encoding performance of related technologies. The technical solution is as follows:
第一方面,提供了一种解码方法,所述方法包括:In the first aspect, a decoding method is provided, and the method includes:
获取当前块的码流;Get the code stream of the current block;
当确定所述当前块采用SRCC(基于扫描区域的系数编码)时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When it is determined that the current block adopts SRCC (coefficient coding based on scanning area), the target position coordinate information is obtained from the code stream, and the target position coordinate information is composed of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the non-zero coefficient included in the transformation coefficient of the current block. The ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的 待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述目标位置坐标信息确定;For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined at least according to the coordinate information of the target position;
根据所述上下文模型,对所述待解码标志位进行解码。According to the context model, the to-be-decoded flag bit is decoded.
第二方面,提供了一种解码方法,所述方法包括:In a second aspect, a decoding method is provided, and the method includes:
获取当前块的码流;Get the code stream of the current block;
当确定所述当前块采用SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream. The target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the block, and the second coordinate value is the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. The ordinate of the zero coefficient;
针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定;For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined from at least three types of context model sets at least according to the coordinate value of the position where the coefficient to be decoded is located;
根据所述上下文模型,对所述待解码标志位进行解码。According to the context model, the to-be-decoded flag bit is decoded.
第三方面,提供了一种解码方法,所述方法包括:In a third aspect, a decoding method is provided, and the method includes:
获取当前块的码流;Get the code stream of the current block;
当确定所述当前块采用SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream. The target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the block, and the second coordinate value is the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. The ordinate of the zero coefficient;
针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
根据所述上下文模型,对所述待解码标志位进行解码。According to the context model, the to-be-decoded flag bit is decoded.
第四方面,提供了一种解码方法,所述方法包括:In a fourth aspect, a decoding method is provided, and the method includes:
获取当前块的码流;Get the code stream of the current block;
当确定所述当前块采用SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所 述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream. The target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the block, and the second coordinate value is the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. The ordinate of the zero coefficient;
针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少基于所述当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的;For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined according to the determined selection method after the selection method is determined at least based on the preset conditions satisfied by the current block;
根据所述上下文模型,对所述待解码标志位进行解码。According to the context model, the to-be-decoded flag bit is decoded.
第五方面,提供了一种编码方法,所述方法包括:In a fifth aspect, an encoding method is provided, and the method includes:
当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When the current block adopts the coefficient coding SRCC based on the scanning area, the target position coordinate information is obtained. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficients, and the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述目标位置坐标信息确定;For the coefficient to be coded in the target scan area of the current block, a context model of the flag to be coded of the coefficient to be coded is determined, and the target scan area is a scan area determined based on the target position coordinate information, and The context model is determined at least according to the coordinate information of the target position;
根据所述上下文模型,对所述待编码标志位进行编码。According to the context model, the to-be-encoded flag bit is encoded.
第六方面,提供了一种编码方法,所述方法包括:In a sixth aspect, an encoding method is provided, and the method includes:
当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When the current block adopts the coefficient coding SRCC based on the scanning area, the target position coordinate information is obtained. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficients, and the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定;For the coefficient to be coded in the target scan area of the current block, a context model of the flag to be coded of the coefficient to be coded is determined, and the target scan area is a scan area determined based on the target position coordinate information, and The context model is determined from at least three types of context model sets at least according to the coordinate value of the position where the coefficient to be decoded is located;
根据所述上下文模型,对所述待编码标志位进行编码。According to the context model, the to-be-encoded flag bit is encoded.
第七方面,提供了一种编码方法,所述方法包括:In a seventh aspect, an encoding method is provided, and the method includes:
当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息, 所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When the current block adopts the coefficient coding SRCC based on the scanning area, the target position coordinate information is obtained, the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficients, and the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;For the coefficient to be coded in the target scan area of the current block, a context model of the flag to be coded of the coefficient to be coded is determined, and the target scan area is a scan area determined based on the target position coordinate information, and The context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
根据所述上下文模型,对所述待编码标志位进行编码。According to the context model, the to-be-encoded flag bit is encoded.
第八方面,提供了一种编码方法,所述方法包括:In an eighth aspect, an encoding method is provided, and the method includes:
当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When the current block adopts the coefficient coding SRCC based on the scanning area, the target position coordinate information is obtained. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficients, and the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少基于所述当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的;For the coefficient to be coded in the target scan area of the current block, a context model of the flag to be coded of the coefficient to be coded is determined, and the target scan area is a scan area determined based on the target position coordinate information, and The context model is determined according to the determined selection method after the selection method is determined at least based on the preset conditions satisfied by the current block;
根据所述上下文模型,对所述待编码标志位进行编码。According to the context model, the to-be-encoded flag bit is encoded.
第九方面,提供了一种解码装置,所述装置包括:In a ninth aspect, a decoding device is provided, and the device includes:
码流获取模块,用于获取当前块的码流;The code stream acquisition module is used to obtain the code stream of the current block;
信息获取模块,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information consists of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient of the current block. Among the non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
模型确定模块,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述目标位置坐标信息确定;The model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The scanning area of the target location, the context model is determined at least according to the coordinate information of the target position;
解码模块,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module is configured to decode the to-be-decoded flag bit according to the context model.
第十方面,提供了一种解码装置,所述装置包括:In a tenth aspect, a decoding device is provided, and the device includes:
码流获取模块,用于获取当前块的码流;The code stream acquisition module is used to obtain the code stream of the current block;
信息获取模块,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information consists of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient of the current block. Among the non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
模型确定模块,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定;The model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The context model is determined from at least three types of context model sets according to at least the coordinate values of the positions where the coefficients to be decoded are located;
解码模块,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module is configured to decode the to-be-decoded flag bit according to the context model.
第十一方面,提供了一种解码装置,所述装置包括:In an eleventh aspect, a decoding device is provided, and the device includes:
码流获取模块,用于获取当前块的码流;The code stream acquisition module is used to obtain the code stream of the current block;
信息获取模块,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information consists of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient of the current block. Among the non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
模型确定模块,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;The model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The scanning area of the, the context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
解码模块,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module is configured to decode the to-be-decoded flag bit according to the context model.
第十二方面,提供了一种解码装置,所述装置包括:In a twelfth aspect, a decoding device is provided, and the device includes:
码流获取模块,用于获取当前块的码流;The code stream acquisition module is used to obtain the code stream of the current block;
信息获取模块,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的 变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information consists of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient of the current block. Among the non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
模型确定模块,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少基于所述当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的;The model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The context model is determined according to the determined selection method after determining a selection method at least based on a preset condition satisfied by the current block;
解码模块,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module is configured to decode the to-be-decoded flag bit according to the context model.
第十三方面,提供了一种编码装置,所述装置包括:In a thirteenth aspect, an encoding device is provided, and the device includes:
获取模块,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
确定模块,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述目标位置坐标信息确定;The determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined according to at least the target position coordinate information;
编码模块,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module is used to encode the to-be-encoded flag bit according to the context model.
第十四方面,提供了一种编码装置,所述装置包括:In a fourteenth aspect, an encoding device is provided, and the device includes:
获取模块,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
确定模块,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定;The determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined from at least three types of context model sets according to at least the coordinate value of the position where the coefficient to be decoded is located;
编码模块,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module is used to encode the to-be-encoded flag bit according to the context model.
第十五方面,提供了一种编码装置,所述装置包括:In a fifteenth aspect, an encoding device is provided, and the device includes:
获取模块,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所 述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
确定模块,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;The determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined at least according to a linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
编码模块,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module is used to encode the to-be-encoded flag bit according to the context model.
第十六方面,提供了一种编码装置,所述装置包括:In a sixteenth aspect, an encoding device is provided, and the device includes:
获取模块,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
确定模块,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少基于所述当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的;The determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined according to the determined selection method after a selection method is determined at least based on a preset condition satisfied by the current block;
编码模块,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module is used to encode the to-be-encoded flag bit according to the context model.
第十七方面,提供了一种计算机设备,所述计算机设备包括处理器、通信接口、存储器和通信总线,所述处理器、所述通信接口和所述存储器通过所述通信总线完成相互间的通信,所述存储器用于存放计算机程序,所述处理器用于执行所述存储器上所存放的程序,以实现上述第一方面至第八方面任一所述方法的步骤。In a seventeenth aspect, a computer device is provided. The computer device includes a processor, a communication interface, a memory, and a communication bus. The processor, the communication interface, and the memory complete mutual communication through the communication bus. In communication, the memory is used to store a computer program, and the processor is used to execute the program stored in the memory to implement the steps of the method described in any one of the first aspect to the eighth aspect.
第十八方面,提供了一种计算机可读存储介质,所述存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面至第八方面任一所述方法的步骤。In an eighteenth aspect, there is provided a computer-readable storage medium in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the above-mentioned aspects from the first aspect to the eighth aspect .
第十九方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面至第八方面任一所述方法的步骤。In a nineteenth aspect, a computer program product containing instructions is provided, which when run on a computer, causes the computer to execute the steps of any one of the methods described in the first aspect to the eighth aspect.
本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought about by the technical solutions provided by the embodiments of the present application include at least:
获取当前块的码流,当确定当前块采用SRCC时,从码流中获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待解码系数的待解码标志位的上下文模型,根据该上下文模型,对待解码标志位进行解码。也即是,根据目标扫描区域确定待解码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了解码性能。Obtain the code stream of the current block. When it is determined that the current block adopts SRCC, obtain the target position coordinate information from the code stream, determine the target scanning area of the current block based on the target position coordinate information, and determine the coefficient to be decoded at least according to the target position coordinate information According to the context model of the flag to be decoded, the flag to be decoded is decoded. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained from these drawings without creative work.
图1是本申请实施例提供的一种编解码方法的示意图;FIG. 1 is a schematic diagram of a coding and decoding method provided by an embodiment of the present application;
图2是本申请实施例提供的一种解码方法的流程图;FIG. 2 is a flowchart of a decoding method provided by an embodiment of the present application;
图3是本申请实施例提供的一种扫描区域的示意图;FIG. 3 is a schematic diagram of a scanning area provided by an embodiment of the present application;
图4是本申请实施例提供的另一种扫描区域的示意图;FIG. 4 is a schematic diagram of another scanning area provided by an embodiment of the present application;
图5是本申请实施例提供的一种解码方法的流程图;FIG. 5 is a flowchart of a decoding method provided by an embodiment of the present application;
图6是本申请实施例提供的一种扫描区域的示意图;FIG. 6 is a schematic diagram of a scanning area provided by an embodiment of the present application;
图7是本申请实施例提供的另一种扫描区域的示意图;FIG. 7 is a schematic diagram of another scanning area provided by an embodiment of the present application;
图8是本申请实施例提供的另一种扫描区域的示意图;FIG. 8 is a schematic diagram of another scanning area provided by an embodiment of the present application;
图9是本申请实施例提供的另一种扫描区域的示意图;FIG. 9 is a schematic diagram of another scanning area provided by an embodiment of the present application;
图10是本申请实施例提供的另一种扫描区域的示意图;FIG. 10 is a schematic diagram of another scanning area provided by an embodiment of the present application;
图11是本申请实施例提供的解码装置的结构示意图;FIG. 11 is a schematic structural diagram of a decoding device provided by an embodiment of the present application;
图12是本申请实施例提供的编码装置的结构示意图;Figure 12 is a schematic structural diagram of an encoding device provided by an embodiment of the present application;
图13是本申请实施例提供的一种电子设备的结构示意图。FIG. 13 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式detailed description
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions, and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below with reference to the accompanying drawings.
在对本申请实施例提供的解码方法、编码方法进行详细的解释说明之前,先对本申请实施例提供的名词和实施环境进行介绍。Before explaining the decoding method and encoding method provided in the embodiment of the present application in detail, the terms and implementation environment provided in the embodiment of the present application will be introduced.
首先,对本申请实施例涉及的名词进行简单介绍。First, a brief introduction to the terms involved in the embodiments of the present application will be given.
残差:在视频编码过程中,需要经过预测过程去除空域和时域冗余,编码器经过预测得到预测值,原始像素减去预测值得到残差,残差块是变换、量化、熵编码的基本单元。Residual error: In the video encoding process, the spatial and temporal redundancy need to be removed through the prediction process. The encoder obtains the predicted value after prediction, and the original pixel is subtracted from the predicted value to obtain the residual. The residual block is transformed, quantized, and entropy coded Basic unit.
变换系数:变换、量化的作用是对残差数据进行变换、量化以去除频域相关性,对数据进行有损压缩。变换编码将图像从时域信号变换至频域信号,将能量集中至低频区域。由于图像能量主要集中在低频区域,通过量化将高频区域的变换系数置零可以在变换模块的基础上减小图像编码的动态范围。去除高频区域的变换系数,减小码率的开销,并且不会造成很大的失真。其中,残差块经过变换、量化后的系数称为变换系数。Transformation coefficient: The function of transformation and quantization is to transform and quantize the residual data to remove the correlation in the frequency domain, and to perform lossy compression on the data. Transform coding transforms an image from a time domain signal to a frequency domain signal, concentrating energy to the low frequency region. Since the image energy is mainly concentrated in the low-frequency region, zeroing the transform coefficients in the high-frequency region by quantization can reduce the dynamic range of image coding on the basis of the transform module. Remove the transform coefficients in the high-frequency region, reduce the overhead of the code rate, and will not cause great distortion. Among them, the coefficients of the residual block after being transformed and quantized are called transform coefficients.
语法元素:可以用于指示一个变换系数,通常情况下,一个变换系数需要通过至少一个语法元素来进行指示。Syntax element: can be used to indicate a transform coefficient. Generally, a transform coefficient needs to be indicated by at least one syntax element.
上下文:一般情况下,不同的语法元素之间并不完全独立,且相同语法元素自身也具有一定的记忆性。因此,根据条件熵的理论,利用其他已编码的语法元素进行条件编码,相对于独立编码或者无记忆编码能够进一步提高编码性能。这些用来作为条件的已编码符号信息称为上下文。Context: Under normal circumstances, different grammatical elements are not completely independent, and the same grammatical element itself also has a certain degree of memorability. Therefore, according to the theory of conditional entropy, using other coded syntax elements for conditional coding can further improve coding performance compared to independent coding or memoryless coding. The coded symbol information used as a condition is called context.
上下文模型:在视频编解码中,基于上下文更新符号概率的过程称为上下文模型,并且根据具体应用条件,同一个语法元素可以使用多个上下文模型来自适应的更新当前条件下的符号概率,从而进一步压缩码率。Context model: In video coding and decoding, the process of updating symbol probability based on context is called context model, and according to specific application conditions, the same syntax element can use multiple context models to adaptively update the symbol probability under current conditions, thereby further Compression rate.
SRCC(Scan Region-based Coefficient Coding,基于扫描区域的系数编码):利用(SRx,SRy)来确定一个变换系数矩阵中需要扫描的变换系数的区域,其中SRx是变换系数矩阵中最右面的非零系数的横坐标,SRy是变换系数矩阵中最下面的非零系数的纵坐标。只有(SRx,SRy)确定的扫描区域内的变换系数需要编解码,而扫描区域外的变换系数全为0,不需要进行编解码,采用该技术能够进一步降低码率开销。SRCC (Scan Region-based Coefficient Coding, coefficient coding based on scanning area): Use (SRx, SRy) to determine the area of the transformation coefficient to be scanned in a transformation coefficient matrix, where SRx is the rightmost non-zero in the transformation coefficient matrix The abscissa of the coefficient, SRy is the ordinate of the lowest non-zero coefficient in the transformation coefficient matrix. Only the transform coefficients in the scan area determined by (SRx, SRy) need to be coded and decoded, while the transform coefficients outside the scan area are all 0, no coding and decoding are required. Using this technology can further reduce the bit rate overhead.
接下来针对视频编解码的大体流程进行介绍。请参考图1中的(a),以视频编码为例,视频编码一般包括预测、变换、量化、熵编码等过程,进一步地,编码过程还可以按照图1中的(b)的框架来实现。Next, the general process of video encoding and decoding is introduced. Please refer to Figure 1 (a). Take video coding as an example. Video coding generally includes prediction, transformation, quantization, entropy coding and other processes. Further, the coding process can also be implemented in accordance with the framework of Figure 1 (b) .
其中,预测可以分为帧内预测和帧间预测,帧内预测是利用周围已编码块作为参考对当前未编码块进行预测,有效去除空域上的冗余。帧间预测是使用 邻近已编码图像对当前图像进行预测,有效去除时域上的冗余。Among them, prediction can be divided into intra-frame prediction and inter-frame prediction. Intra-frame prediction uses the surrounding coded blocks as a reference to predict the current uncoded block, effectively removing the redundancy in the spatial domain. Inter-frame prediction uses adjacent coded images to predict the current image, effectively removing redundancy in the time domain.
变换是指将图像从空间域转换至变换域,利用变换系数对图像加以表示。绝大多数图像都含有较多平坦区域和缓慢变化的区域,适当的变换可以使图像由在空间域的分散分布转换为在变换域的相对集中分布,去除信号之间的频域相关性,配合量化过程,可以有效压缩码流。Transformation refers to transforming an image from the spatial domain to the transform domain, and using transform coefficients to represent the image. Most images contain more flat areas and slowly changing areas. Appropriate transformation can transform the image from a scattered distribution in the spatial domain to a relatively concentrated distribution in the transform domain, removing the frequency domain correlation between signals, and matching The quantization process can effectively compress the code stream.
熵编码是一种无损编码方式,可以把一系列元素符号转变为一个用来传输或存储的二进制码流,输入的符号可能包括量化后的变换系数、运动矢量信息、预测模式信息,变换量化相关语法等。熵编码可以有效地去除视频元素符号的冗余。Entropy coding is a lossless coding method that can convert a series of element symbols into a binary code stream for transmission or storage. The input symbols may include quantized transform coefficients, motion vector information, prediction mode information, transform and quantization related Grammar, etc. Entropy coding can effectively remove the redundancy of video element symbols.
上述是以编码为例进行介绍,视频解码与视频编码的过程是相对的,即视频解码通常包括熵解码、预测、反量化、反变换、滤波等过程,各个过程的实现原理与熵编码相同或相似。The above is an example of encoding. The process of video decoding and video encoding is relative, that is, video decoding usually includes entropy decoding, prediction, inverse quantization, inverse transformation, filtering, etc. The implementation principle of each process is the same as or similar.
目前,熵编码可以利用SRCC技术来实现,SRCC技术可以通过确定需要编码的当前块的变换系数矩阵中最右面的非零系数的横坐标SRx和变换系数矩阵中最下面的非零系数的纵坐标SRy,利用(SRx,SRy)来确定该变化系数矩阵中需要扫描的扫描区域,对(SRx,SRy)确定的扫描区域内的变换系数进行编码。At present, entropy coding can be realized by using SRCC technology. SRCC technology can determine the abscissa SRx of the rightmost non-zero coefficient in the transformation coefficient matrix of the current block to be coded and the ordinate of the bottom non-zero coefficient in the transformation coefficient matrix. SRy uses (SRx, SRy) to determine the scan area to be scanned in the variation coefficient matrix, and encodes the transformation coefficients in the scan area determined by (SRx, SRy).
在本申请提供的一种实施例中,当采用SRCC进行解码时,significant flagGT1flag,GT2flag的上下文模型可以按照扫描顺序已编码或解码的部分变换系数的相关标志的个数确定,并根据变换系数在扫描区域的相对位置、当前块的大小和通道进行分组,其中,significant flag,GT1flag,GT2flag均可以分为亮度通道和色度通道,具体可参见下文表1。譬如,针对significant flag的亮度通道,可以根据当前块的大小分为三类上下文模型集合,每类上下文模型集合中包括13种上下文模型,然后可以根据变换系数在扫描区域的相对位置对每类上下文模型集合进一步分组,进而可以根据扫描顺序已编码或解码的5个变换系数的非零变换系数的个数,确定一个上下文模型,用于对significant flag的亮度通道进行编码或解码。针对significant flag的色度通道,可以根据变换系数在扫描区域的相对位置对上下文模型集合进行分组,然后可以根据扫描顺序已编码或解码的5个变换系数的非零变换系数的个数,确定一个上下文模型,用于对significant flag的色度通道进行编码或解码。再如,针对GT1flag或GT2flag的亮度通道,可以根据变换系数在扫描区域的相对位置进行分组,然后可以根据扫描顺序已编码或解码的5个变换系数的非零变换系数的个数,确定一个上 下文模型,用于对GT1flag或GT2flag的亮度通道进行编码或解码。针对GT1flag或GT2flag的色度通道,可以根据扫描顺序已编码或解码的5个变换系数的非零变换系数的个数,确定一个上下文模型,用于对GT1flag或GT2flag的色度通道进行编码或解码。In an embodiment provided in this application, when SRCC is used for decoding, the significant flagGT1flag and GT2flag context models can be determined according to the number of related flags of the partial transform coefficients that have been encoded or decoded in the scanning order, and according to the transform coefficients The relative position of the scanning area, the size of the current block, and the channels are grouped. The significant flag, GT1flag, and GT2flag can all be divided into luminance channels and chrominance channels. For details, see Table 1 below. For example, the brightness channel of the significant flag can be divided into three types of context model sets according to the size of the current block. Each type of context model set includes 13 types of context models. Then, each type of context can be analyzed according to the relative position of the transformation coefficient in the scanning area. The model set is further grouped, and then a context model can be determined according to the number of non-zero transform coefficients of the five transform coefficients that have been encoded or decoded in the scanning order, and used to encode or decode the significant flag luminance channel. For the chroma channel of the significant flag, the context model set can be grouped according to the relative position of the transform coefficients in the scanning area, and then one can be determined according to the number of non-zero transform coefficients of the 5 transform coefficients that have been encoded or decoded in the scanning order The context model is used to encode or decode the chrominance channel of the significant flag. For another example, for the brightness channels of GT1flag or GT2flag, the transform coefficients can be grouped according to the relative position of the scan area, and then a context can be determined according to the number of non-zero transform coefficients of the 5 transform coefficients that have been encoded or decoded in the scan order Model, used to encode or decode the brightness channel of GT1flag or GT2flag. For the chroma channel of GT1flag or GT2flag, a context model can be determined according to the number of non-zero transform coefficients of the 5 transform coefficients that have been encoded or decoded in the scan order, which is used to encode or decode the chroma channel of GT1flag or GT2flag .
接下来,对本申请实施例涉及的实施环境进行简单介绍。Next, the implementation environment involved in the embodiments of the present application will be briefly introduced.
本申请实施例提供的解码方法、编码方法可以由电子设备来执行,该电子设备可以具有对任意图像或者视频图像进行压缩编码或者解码的功能。在一些实施例中,该电子设备可以为笔记本电脑、平板电脑、台式计算机、便携式计算机等等,本申请实施例对此不做限定。The decoding method and encoding method provided in the embodiments of the present application may be executed by an electronic device, and the electronic device may have a function of compressing, encoding or decoding any image or video image. In some embodiments, the electronic device may be a notebook computer, a tablet computer, a desktop computer, a portable computer, etc., which is not limited in the embodiment of the present application.
在介绍完本申请实施例涉及的名词和实施环境后,接下来将结合附图对本申请实施例提供的解码方法、编码方法进行详细介绍。After introducing the terms and implementation environment involved in the embodiments of the present application, the decoding methods and encoding methods provided by the embodiments of the present application will be introduced in detail in conjunction with the accompanying drawings.
首先对编码流程进行介绍:当前块经过预测后得到预测值,当前块的原始值减去该预测值得到当前块的残差,对该残差经过变换量化后得到变换系数,若当前块的所有变换系数均为零,则当前块的cbf标志位置为零,不需要编码当前块的变换系数。否则当前块的cbf标志位置为1,若编码端序列头启用SRCC,则确定当前块的扫描区域,并编码SRx和SRy的坐标值,基于扫描顺序从扫描区域的右下角到左上角依次编码每个变换系数,每个变换系数需要的信息有包含significant flag、GT1flag、GT2flag、remaining level和sign中的至少一个。将SRCC启用标志位、当前块的变换系数和cbf标志位等信息经过熵编码得到二进制码流。First, the encoding process is introduced: the current block is predicted to obtain the predicted value, the original value of the current block is subtracted from the predicted value to obtain the residual of the current block, and the residual is transformed and quantized to obtain the transform coefficients. If the transform coefficients are all zero, the cbf flag position of the current block is zero, and there is no need to encode the transform coefficients of the current block. Otherwise, the cbf flag position of the current block is 1. If SRCC is enabled on the encoding end sequence header, the scan area of the current block is determined, and the coordinate values of SRx and SRy are encoded. There are two transform coefficients, and the information required for each transform coefficient includes at least one of significant flag, GT1flag, GT2flag, remaining level, and sign. Entropy encodes information such as the SRCC enable flag bit, the transform coefficient of the current block, and the cbf flag bit to obtain a binary code stream.
在实施例中,解码过程一般包括:接收码流,解析当前块的cbf标志位,cbf=0表示当前块所有变换系数都为0,不需要进行反量化和反变换操作,因此当前块的残差也为0,当前块的重建值即为当前块的预测值。若cbf标志位为1,若码流序列头解析出当前序列使用SRCC技术,则继续解析出当前块的扫描区域的坐标SRx和SRy,然后由SRx和SRy确定扫描区域,基于扫描顺序从扫描区域的右下角到左上角依次解码每一个变换系数,每个变换系数需要解码的信息包含significant flag、GT1flag、GT2flag、remaining level和sign中的至少一个。得到当前块的熵解码后的变换系数,经过反量化反变换得到当前块的残差,与预测值相加得到当前块的重建值。In the embodiment, the decoding process generally includes: receiving the code stream, analyzing the cbf flag bit of the current block, cbf=0 means that all the transform coefficients of the current block are 0, and there is no need to perform inverse quantization and inverse transform operations, so the residual of the current block The difference is also 0, and the reconstruction value of the current block is the predicted value of the current block. If the cbf flag bit is 1, if the code stream sequence header parses that the current sequence uses SRCC technology, continue to parse the coordinates SRx and SRy of the scan area of the current block, and then determine the scan area by SRx and SRy, and start from the scan area based on the scan order From the lower right corner to the upper left corner of the, each transform coefficient is sequentially decoded, and the information to be decoded for each transform coefficient includes at least one of significant flag, GT1 flag, GT2 flag, remaining level, and sign. Obtain the entropy-decoded transform coefficient of the current block, obtain the residual of the current block through inverse quantization and inverse transformation, and add the predicted value to obtain the reconstruction value of the current block.
请参考图2,这里以解码为例进行详细介绍,该图2是本申请实施例提供的一种解码方法的流程图,该方法可以由上述电子设备来执行,该方法可以包括如下几个步骤:Please refer to Figure 2, which takes decoding as an example for detailed introduction. Figure 2 is a flowchart of a decoding method provided by an embodiment of the present application. The method can be executed by the above-mentioned electronic device. The method can include the following steps :
步骤201:获取当前块的码流。Step 201: Obtain the code stream of the current block.
该当前块可以为待处理图像中的任一个图像块。在实施中,可以将待处理图像划分为不同的图像块,然后可以按一定顺序依次对每个图像块进行处理。其中,每个图像块的大小和形状可以根据预设的划分规则进行设置。The current block may be any image block in the image to be processed. In implementation, the image to be processed can be divided into different image blocks, and then each image block can be processed sequentially in a certain order. Among them, the size and shape of each image block can be set according to a preset division rule.
该码流为编码端发送的,该码流可以为二进制码流,该码流中可以携带解码端解码需要获知的一些信息,譬如,该码流可以携带用于编码端采用的编码方式的信息、当前块的尺寸等信息。The code stream is sent by the encoding end. The code stream can be a binary code stream. The code stream can carry some information that the decoding end needs to know for decoding. For example, the code stream can carry information for the encoding method adopted by the encoding end. , The size of the current block and other information.
步骤202:当确定该当前块采用SRCC时,从该码流中获取目标位置坐标信息,该目标位置坐标信息由第一坐标值和第二坐标值组成,该第一坐标值为该当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,该第二坐标值为该当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标。Step 202: When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream. The target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current block's coordinate information. The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. coordinate.
作为一种示例,在确定当前块的编码方式之前,可以确定当前块的变换系数中是否有非零变换系数。示例性的,编码端可以在码流中携带一个标志位,以通过该标志位指示该当前块所有变换系数是否都为零。譬如,该标志位可以为cbf标志位,当码流携带的cbf标志位为0时,可以表示当前块所有变换系数都为零,在该种情况下可以不需要解码当前块的变换系数。当cbf标志位为1时,表示当前块中存在非零变换系数,在该种情况下需要解码当前块的变换系数。As an example, before determining the encoding mode of the current block, it can be determined whether there are non-zero transform coefficients in the transform coefficients of the current block. Exemplarily, the encoding end may carry a flag bit in the code stream to indicate whether all transform coefficients of the current block are zero through the flag bit. For example, the flag bit can be a cbf flag bit. When the cbf flag bit carried by the bitstream is 0, it can indicate that all transform coefficients of the current block are zero. In this case, there is no need to decode the transform coefficients of the current block. When the cbf flag bit is 1, it indicates that there are non-zero transform coefficients in the current block. In this case, the transform coefficients of the current block need to be decoded.
作为一种示例,在解码之前可以确定编码端采用的编码方式。当编码端采用SRCC进行熵编码时,可以在该码流中携带用于指示该SRCC的标志位,如此,对于解码端来说,可以根据该码流中的该标志位确定当前块采用了SRCC。As an example, the encoding method adopted by the encoding end can be determined before decoding. When the encoding end uses SRCC for entropy encoding, it can carry a flag bit for indicating the SRCC in the code stream. In this way, for the decoding end, it can be determined that the current block uses SRCC according to the flag bit in the code stream. .
在确定当前块的编码方式为SRCC的情况下,可以确定变换系数对应的扫描区域,该扫描区域是通过当前块的变换系数中最右面的非零变换系数的横坐标SRx(第一坐标值)和变换系数中最下面的非零变换系数的纵坐标SRy(第二坐标值)来确定的。作为一种示例,可以以当前块的某个顶点为原点建立坐标系,如图3所示,在本实施例中以当前块的左上顶点为原点建立坐标系。基于此,解码端可以通过在码流中获取SRx和SRy的信息,确定目标扫描区域(图3中的矩形框,获取SRx和SRy组成的目标位置坐标即可确定出该目标扫描区 域),如图4所示,该目标扫描区域内所有变换系数所在的位置的坐标值均大于零。其中,该SRx和SRy对应的位置为该目标扫描区域对应的目标位置。In the case of determining that the coding mode of the current block is SRCC, the scan area corresponding to the transform coefficient can be determined. The scan area is the abscissa SRx (first coordinate value) of the rightmost non-zero transform coefficient in the transform coefficients of the current block. And the ordinate SRy (second coordinate value) of the lowest non-zero transform coefficient among the transform coefficients. As an example, the coordinate system can be established with a certain vertex of the current block as the origin. As shown in FIG. 3, in this embodiment, the coordinate system is established with the upper left vertex of the current block as the origin. Based on this, the decoder can determine the target scan area by obtaining the information of SRx and SRy in the code stream (the rectangular box in Figure 3, the target position coordinates composed of SRx and SRy can be obtained to determine the target scan area), such as As shown in Fig. 4, the coordinate values of the positions where all transform coefficients are located in the target scanning area are greater than zero. Wherein, the positions corresponding to the SRx and SRy are the target positions corresponding to the target scanning area.
需要说明的是,目标扫描区域可以根据非零变换系数的分布情况不同而不同,如目标扫描区域可以是当前块的部分区域,也可以是当前块的全部区域。其中,当前块除目标扫描区域之外的区域内的变换系数都为零,而目标扫描区域内部的某个或某些变换系数可以是零。It should be noted that the target scan area may be different according to the distribution of non-zero transform coefficients. For example, the target scan area may be a part of the current block or the entire area of the current block. Wherein, the transform coefficients in the current block except the target scanning area are all zero, and one or some transform coefficients in the target scanning area may be zero.
步骤203:针对该当前块的目标扫描区域中的待解码系数,确定该待解码系数的待解码标志位的上下文模型,该目标扫描区域是基于该目标位置坐标信息确定的扫描区域,该上下文模型是至少根据该目标位置坐标信息确定。Step 203: For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined at least according to the coordinate information of the target location.
其中,待解码系数为按扫描顺序得到的待进行解码的变换系数,也即是,在解码过程中可以按照一定的顺序扫描该目标扫描区域,譬如如图3所示,该扫描顺序可以是从右下角到左上角的反向Z字型扫描。每扫描到一个变换系数确定为待解码系数,然后可以按照本申请实施例提供的方法解码该待解码系数的待解码标志位。Among them, the coefficient to be decoded is the transform coefficient to be decoded obtained in the scanning order, that is, the target scanning area can be scanned in a certain order during the decoding process. For example, as shown in Figure 3, the scanning order can be from Reverse zigzag scan from lower right corner to upper left corner. Each scanned transform coefficient is determined as the coefficient to be decoded, and then the to-be-decoded flag of the coefficient to be decoded can be decoded according to the method provided in the embodiment of the present application.
其中,该待解码标志位为第一标志位、第二标志位、第三标志位中的至少一个。该第一标志位用于指示变换系数是否是非零。该第二标志位用于指示变换系数的绝对值是否大于1。该第三标志位用于指示变换系数的绝对值是否大于2。Wherein, the to-be-decoded flag bit is at least one of the first flag bit, the second flag bit, and the third flag bit. The first flag bit is used to indicate whether the transform coefficient is non-zero. The second flag bit is used to indicate whether the absolute value of the transform coefficient is greater than one. The third flag bit is used to indicate whether the absolute value of the transform coefficient is greater than 2.
譬如,该第一标志位为significant flag,该第二标志位为GT1flag,该第三标志位为GT2flag。也就是说,需要至少一个标志位用于指示待解码系数,即待解码系数可以由一个标志位进行指示,也可以由多个标志位进行指示。譬如,若待解码系数为1,那么需要significant flag用于指示待解码系数非零,GT1flag用于指示待解码系数幅值小于等于1。若待解码系数为0,那么只需要significant flag用于指示待解码系数为零即可。For example, the first flag bit is significant flag, the second flag bit is GT1 flag, and the third flag bit is GT2 flag. In other words, at least one flag bit is required to indicate the coefficient to be decoded, that is, the coefficient to be decoded can be indicated by one flag bit or multiple flag bits. For example, if the coefficient to be decoded is 1, a significant flag is required to indicate that the coefficient to be decoded is non-zero, and GT1flag is used to indicate that the amplitude of the coefficient to be decoded is less than or equal to 1. If the coefficient to be decoded is 0, then only a significant flag is needed to indicate that the coefficient to be decoded is zero.
一般来说至少需要标志位significant flag用于指示待解码系数是否为零。作为一种示例,当待解码系数为当前块中最后一个待解码的变换系数,且之前按照扫描顺序进行解码的变换系数全部为零,由于当前块中存在非零变换系数,也就可以确定该待解码系数非零,因此,可以不对标志位significant flag进行解码。Generally speaking, at least the significant flag is required to indicate whether the coefficient to be decoded is zero. As an example, when the coefficient to be decoded is the last transform coefficient to be decoded in the current block, and the transform coefficients previously decoded in the scan order are all zero, since there are non-zero transform coefficients in the current block, it can be determined The coefficient to be decoded is non-zero, so the significant flag may not be decoded.
当然,需要说明的是,用于指示一个变换系数的语法元素还可能包括其它标志位和/或参数,譬如,还可以包括第四标志位和/或变量,该第四标志位可以 用于指示非零变换系数的正负,该变量可以用于指示非零变换系数幅值大于2的剩余部分,其中,该第四标志位和变量可以采用其它方式进行编解码,因此本申请实施例对此不做过多介绍。Of course, it should be noted that the syntax element used to indicate a transform coefficient may also include other flag bits and/or parameters. For example, it may also include a fourth flag bit and/or variable. The fourth flag bit may be used to indicate The positive or negative of the non-zero transform coefficient. This variable can be used to indicate the remaining part of the non-zero transform coefficient whose amplitude is greater than 2. The fourth flag bit and the variable can be encoded and decoded in other ways. Therefore, this embodiment of the present application is Don't introduce too much.
如前文所述,变换系数的编解码可以通过对用于指示变换系数的语法元素进行编解码来实现,其中,该语法元素中的至少一个标志位可以通过上下文模型进行编解码,一般来说,每个标志位都可以支持多种不同的上下文模型来进行编解码。譬如,标志位significant flag、GT1flag和GT2flag对应的上下文模型的数量如下表1所示。As mentioned above, the encoding and decoding of transform coefficients can be implemented by encoding and decoding the syntax element used to indicate the transform coefficient, wherein at least one flag bit in the syntax element can be encoded and decoded through the context model. Generally speaking, Each flag bit can support a variety of different context models for encoding and decoding. For example, the number of context models corresponding to the significant flag, GT1flag, and GT2flag is shown in Table 1 below.
表1Table 1
Figure PCTCN2020096580-appb-000001
Figure PCTCN2020096580-appb-000001
需要说明的是,每个标志位对应的上下文模型可以分为亮度分量对应的上下文模型和色度分量对应的上下文模型,亮度分量和色度分量对应的上下文模型的确定方式可以相同,也可以不同,本申请实施例提供的方法可以适用于确定亮度分量对应的上下文模型,或者,也可以适用于确定色度分量对应的上下文模型。It should be noted that the context model corresponding to each flag bit can be divided into the context model corresponding to the luminance component and the context model corresponding to the chrominance component. The method of determining the context model corresponding to the luminance component and the chrominance component can be the same or different. The method provided in the embodiment of the present application may be suitable for determining the context model corresponding to the luminance component, or may also be suitable for determining the context model corresponding to the chrominance component.
作为一种示例,标志位对应的上下文模型可以根据一定规则分为多类上下文模型集合。以标志位significant flag为例,其亮度分量对应的上下文模型为39种,可以将其分为三类上下文模型集合,其中每一类上下文模型集合中包括13种上下文模型。作为一种示例,对于任一类上下文模型集合,还可以进一步划分为多个上下文模型子集,譬如,可以将上述每类上下文模型集合分为两个上下文模型子集,其中每个上下文模型子集中包括6种上下文模型。需要注意的是,目标扫描区域的右下角的1个变换系数可以使用单独的上下文模型。As an example, the context models corresponding to the flag bits can be divided into multiple types of context model sets according to certain rules. Taking the significant flag as an example, there are 39 context models corresponding to the brightness component, which can be divided into three types of context model sets, and each type of context model set includes 13 types of context models. As an example, for any type of context model set, it can be further divided into multiple context model subsets. For example, each type of context model set described above can be divided into two context model subsets, where each context model sub-set The set includes 6 context models. It should be noted that one transform coefficient in the lower right corner of the target scan area can use a separate context model.
由此可见,每个标志位都对应有多种上下文模型,因此,在解码过程中需要确定采用哪种上下文模型解码待解码系数。在本申请实施例中,上下文模型是至少根据该目标位置坐标信息确定,其具体实现方式可以包括如下几种可能的实现方式中的一种:It can be seen that there are multiple context models for each flag bit. Therefore, it is necessary to determine which context model is used to decode the coefficients to be decoded during the decoding process. In the embodiment of the present application, the context model is determined at least according to the target position coordinate information, and its specific implementation manner may include one of the following possible implementation manners:
第一种方式中,该待解码系数的待解码标志位的上下文模型是至少根据该 目标扫描区域的面积确定,该目标扫描区域的面积是根据该目标位置坐标信息确定的。In the first method, the context model of the to-be-decoded flag of the to-be-decoded coefficient is determined at least according to the area of the target scan area, and the area of the target scan area is determined according to the target position coordinate information.
如前文所述,该目标位置坐标信息包括第一坐标值和第二坐标值,因此,可以根据该第一坐标值和第二坐标值来确定该扫描区域的面积。譬如,当前目标扫描区域的面积通过SRx和SRy确定,设扫描区域的面积为ScanArea,则ScanArea=(SRx+1)*(SRy+1)。As mentioned above, the target position coordinate information includes a first coordinate value and a second coordinate value, and therefore, the area of the scanning area can be determined according to the first coordinate value and the second coordinate value. For example, the area of the current target scan area is determined by SRx and SRy, and if the area of the scan area is ScanArea, then ScanArea=(SRx+1)*(SRy+1).
作为一种示例,该待解码系数的待解码标志位的上下文模型是至少根据该目标扫描区域的面积确定的具体实现可以包括:当该目标扫描区域的面积小于等于第一面积阈值时,该上下文模型是从第一类上下模型集合中选择的,当该扫描区域的面积大于该第一面积阈值时,该上下文模型是从第二类上下模型集合中选择的。As an example, the context model of the to-be-decoded flag of the coefficient to be decoded is determined according to at least the area of the target scan area. The specific implementation may include: when the area of the target scan area is less than or equal to the first area threshold, the context The model is selected from the set of upper and lower models of the first type, and when the area of the scanning area is greater than the first area threshold, the context model is selected from the set of upper and lower models of the second type.
其中,第一面积阈值可以根据实际情况进行设置,如可以设置为1到1024之间的任一数值,例如2,4,8,16等。Among them, the first area threshold can be set according to actual conditions, for example, it can be set to any value between 1 and 1024, such as 2, 4, 8, 16, and so on.
其中,该第一类上下文模型和第二类上下文模型的分类规则可以根据实际情况进行设置。Among them, the classification rules of the first type of context model and the second type of context model can be set according to actual conditions.
也即是,当待解码标志位对应的上下文模型是根据规则分为第一类上下文模型集合和第二类上下文模型集合时,可以根据扫描区域面积与第一面积阈值的大小关系确定待解码标志位的上下文模型是从第一类上下文模型集合中选择还是从第二类上下文模型集合中选择。That is, when the context model corresponding to the flag to be decoded is divided into the first type of context model set and the second type of context model set according to the rules, the flag to be decoded can be determined according to the relationship between the scan area area and the first area threshold. Whether the context model of the bit is selected from the first type of context model set or the second type of context model set.
譬如,设置第一面积阈值为4,当ScanArea≤4时,确定待解码标志位的上下文模型从第一类上下文模型集合中选择,当ScanArea>4时,确定待解码标志位的上下文模型从第二类上下文模型集合中选择。For example, the first area threshold is set to 4. When ScanArea≤4, the context model for determining the flag to be decoded is selected from the first type of context model set. When ScanArea>4, the context model for determining the flag to be decoded is selected from the first type of context model set. Choose from a collection of two types of context models.
以上是以当ScanArea=4时,确定待解码标志位的上下文模型从第二类上下文模型集合中选择为例。在另一实施例中,当ScanArea=4时,还可以确定待解码标志位的上下文模型从第一类上下文模型集合中选择。譬如,设置第一面积阈值为4,当ScanArea<4时,确定待解码标志位的上下文模型从第一类上下文模型集合中选择,当ScanArea≥4时,确定待解码标志位的上下文模型从第二类上下文模型集合中选择。The above is based on the example that when ScanArea=4, the context model for determining the flag to be decoded is selected from the second type of context model set. In another embodiment, when ScanArea=4, the context model of the flag to be decoded can also be determined to be selected from the first type of context model set. For example, set the first area threshold to 4. When ScanArea<4, determine the context model of the flag to be decoded from the first type of context model set. When ScanArea≥4, determine the context model of the flag to be decoded from the first type of context model set. Choose from a collection of two types of context models.
作为另一种示例,当该目标扫描区域的面积小于等于第一面积阈值时,该上下文模型是从第一类上下文模型集合中选择的,当该目标扫描区域的面积大于该第一面积阈值且小于等于第二面积阈值时,该上下文模型是从第二类上下 文模型集合中选择的,当该目标扫描区域的面积大于该第二面积阈值时,该上下文模型是从第三类上下文模型集合中选择的。As another example, when the area of the target scan area is less than or equal to the first area threshold, the context model is selected from the first type of context model set, and when the area of the target scan area is greater than the first area threshold and When it is less than or equal to the second area threshold, the context model is selected from the second type of context model set. When the area of the target scanning area is greater than the second area threshold, the context model is selected from the third type of context model set Selected.
其中,第一面积阈值和第二面积阈值可以根据实际情况进行设置,如可以设置为1到1024之间的任一数值,如2,4,8,16等。需要注意的是,第一面积阈值应小于第二面积阈值。Among them, the first area threshold and the second area threshold can be set according to actual conditions, for example, can be set to any value between 1 and 1024, such as 2, 4, 8, 16, and so on. It should be noted that the first area threshold should be smaller than the second area threshold.
当待解码标志位对应的上下文模型根据规则分为第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合时,可以根据扫描区域面积与第一面积阈值之间的大小关系、以及扫描区域面积与第二面积阈值之间的大小关系确定待解码标志位的上下文模型从哪一类上下文模型集合中选择。When the context model corresponding to the flag to be decoded is divided into the first type of context model set, the second type of context model set, and the third type of context model set according to the rules, the size relationship between the scan area area and the first area threshold can be used , And the size relationship between the scan area area and the second area threshold determines which type of context model set the context model of the flag bit to be decoded is selected from.
譬如,设置第一面积阈值为4,第二面积阈值为16,当ScanArea≤4时,确定待解码标志位的上下文模型是从第一类上下文模型集合中选择的,当ScanArea>4,且ScanArea≤16时,确定待解码标志位的上下文模型是从第二类上下文模型集合中选择的。当ScanArea>16时,确定待解码标志位的上下文模型是从第三类上下文模型集合中选择的。For example, set the first area threshold to 4 and the second area threshold to 16. When ScanArea≤4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set. When ScanArea>4, and ScanArea When ≤16, it is determined that the context model of the flag to be decoded is selected from the second type of context model set. When ScanArea>16, it is determined that the context model of the flag to be decoded is selected from the third type of context model set.
以上是以当ScanArea=4时,确定待解码标志位的上下文模型是从第一类上下文模型集合中选择的,当ScanArea=16时,确定待解码标志位的上下文模型是从第二类上下文模型集合中选择的为例。在另一实施例中,当ScanArea=4时,还可以确定待解码标志位的上下文模型是从第二类上下文模型集合中选择的。类似的,对于ScanArea=16,也可以确定待解码标志位的上下文模型是从第三类上下文模型集合中选择的。The above is that when ScanArea=4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set. When ScanArea=16, it is determined that the context model of the flag to be decoded is from the second type of context model. Take the selection from the set as an example. In another embodiment, when ScanArea=4, it can also be determined that the context model of the flag to be decoded is selected from the second type of context model set. Similarly, for ScanArea=16, it can also be determined that the context model of the flag to be decoded is selected from the third type of context model set.
再譬如,设置第一面积阈值为4,第二面积阈值为16,当ScanArea<4时,确定待解码标志位的上下文模型是从第一类上下文模型集合中选择的,当ScanArea≥4,且ScanArea<16时,确定待解码标志位的上下文模型是从第二类上下文模型集合中选择的。当ScanArea≥16时,确定待解码标志位的上下文模型是从第三类上下文模型集合中选择的。For another example, set the first area threshold to 4 and the second area threshold to 16. When ScanArea<4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set, when ScanArea≥4, and When ScanArea<16, it is determined that the context model of the flag to be decoded is selected from the second type of context model set. When ScanArea≥16, it is determined that the context model of the flag to be decoded is selected from the third type of context model set.
作为一种示例,待解码标志位的上下文模型也可以分为大于三类的上下文模型集合,也就是说,待解码标志位也可以对应有四类上下文模型集合、五类上下文模型集合等等,此时可以设置更多的面积阈值进行分组,其原理与上述类似,这里不再详细介绍。As an example, the context model of the flag to be decoded can also be divided into more than three types of context model sets, that is, the flag to be decoded can also correspond to four types of context model sets, five types of context model sets, and so on. At this time, more area thresholds can be set for grouping. The principle is similar to the above, and will not be described in detail here.
第二种方式中,上下文模型是至少根据该目标扫描区域的尺寸确定,该目标扫描区域的尺寸是根据该目标位置坐标信息确定的。In the second way, the context model is determined at least according to the size of the target scanning area, and the size of the target scanning area is determined according to the coordinate information of the target position.
其中,该目标扫描区域的尺寸可以通过长度和宽度来表示,或者,该目标扫描区域的尺寸也可以通过长度来表示,再或者,该目标扫描区域的尺寸还可以通过宽度来表示。本实施例中,扫描区域的尺寸可以由第一坐标值SRx和第二坐标值SRy确定,设目标扫描区域的尺寸为ScanSize,则根据上文所述,该ScanSize可以为SRx*SRy,或者,该ScanSize也可以为SRx,或者,该ScanSize也可以为SRy,再或者,该ScanSize还可以为min(SRx,SRy)。Wherein, the size of the target scanning area may be expressed by length and width, or the size of the target scanning area may also be expressed by length, or alternatively, the size of the target scanning area may also be expressed by width. In this embodiment, the size of the scan area may be determined by the first coordinate value SRx and the second coordinate value SRy. If the size of the target scan area is ScanSize, then according to the above, the ScanSize may be SRx*SRy, or, The ScanSize may also be SRx, or the ScanSize may also be SRy, or, the ScanSize may also be min(SRx, SRy).
作为一种示例,当该目标扫描区域的尺寸小于等于第一尺寸阈值时,该上下文模型是从第一类上下模型集合中选择的,当该目标扫描区域的尺寸大于该第一尺寸阈值时,该上下文模型是从第二类上下模型集合中选择的。As an example, when the size of the target scan area is less than or equal to the first size threshold, the context model is selected from the first type of upper and lower model set, and when the size of the target scan area is greater than the first size threshold, The context model is selected from the second type of upper and lower model set.
其中,第一尺寸阈值可以根据实际情况进行设置,如可以设置为2,4,8等。Among them, the first size threshold can be set according to actual conditions, for example, it can be set to 2, 4, 8, and so on.
当待解码标志位对应的上下文模型根据规则分为第一类上下文模型集合和第二类上下文模型集合时,可以根据扫描区域的尺寸与第一尺寸阈值的大小关系确定待解码标志位的上下文模型是从第一类上下文模型集合中选择的还是从第二类上下文模型集合中选择的。When the context model corresponding to the flag to be decoded is divided into the first type of context model set and the second type of context model set according to the rules, the context model of the flag to be decoded can be determined according to the relationship between the size of the scan area and the first size threshold Whether it is selected from the first type of context model set or the second type of context model set.
譬如,假设第一尺寸阈值为4,当ScanSize≤4时,确定待解码标志位的上下文模型是从第一类上下文模型集合中选择的。当ScanSize>4时,确定待解码标志位的上下文模型是从第二类上下文模型集合中选择的。For example, assuming that the first size threshold is 4, when ScanSize≤4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set. When ScanSize>4, it is determined that the context model of the flag to be decoded is selected from the second type of context model set.
以上是以当ScanSize=4时,确定待解码标志位的上下文模型是从第一类上下文模型集合中选择的为例,在另一实施例中,当ScanSize=4时,还可以确定待解码标志位的上下文模型是从第二类上下文模型集合中选择的。The above is an example of determining that the context model of the flag to be decoded is selected from the first type of context model set when ScanSize=4. In another embodiment, when ScanSize=4, the flag to be decoded can also be determined The bit context model is selected from the second type of context model set.
再譬如,假设第一尺寸阈值为4,当ScanSize<4时,确定待解码标志位的上下文模型是从第一类上下文模型集合中选择的。当ScanSize≥4时,待解码标志位的上下文模型是从第二类上下文模型集合中选择的。For another example, assuming that the first size threshold is 4, when ScanSize<4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set. When ScanSize≥4, the context model of the flag to be decoded is selected from the second type of context model set.
作为另一种示例,当该目标扫描区域的尺寸小于等于第一尺寸阈值时,该上下文模型是从第一类上下文模型集合中选择的,当该目标扫描区域的尺寸大于该第一尺寸阈值且小于等于第二尺寸阈值时,该上下文模型是从第二类上下文模型集合中选择的,当该目标扫描区域的尺寸大于该第二尺寸阈值时,该上下文模型是从第三类上下文模型集合中选择的。As another example, when the size of the target scan area is less than or equal to the first size threshold, the context model is selected from the first type of context model set, and when the size of the target scan area is greater than the first size threshold and When the size is less than or equal to the second size threshold, the context model is selected from the second type of context model set. When the size of the target scan area is greater than the second size threshold, the context model is selected from the third type of context model set Selected.
其中,第一尺寸阈值和第二尺寸阈值可以根据实际情况进行设置,如可以设置为2,4,8等,第一尺寸阈值应该小于第二尺寸阈值。Among them, the first size threshold and the second size threshold can be set according to actual conditions, for example, can be set to 2, 4, 8, etc., and the first size threshold should be smaller than the second size threshold.
当待解码标志位对应的上下文模型根据规则分为第一类上下文模型集合、 第二类上下文模型集合和第三类上下文模型集合时,可以根据扫描区域的尺寸与第一尺寸阈值之间的大小关系、以及扫描区域的尺寸与第二尺寸阈值的大小关系确定待解码标志位的上下文模型是在哪一类上下文模型集合中选择的。When the context model corresponding to the flag to be decoded is divided into the first type of context model set, the second type of context model set, and the third type of context model set according to the rules, it can be based on the size between the scan area and the first size threshold. The relationship and the size relationship between the size of the scanning area and the second size threshold determine which type of context model set the context model of the flag bit to be decoded is selected.
譬如,设置第一尺寸阈值为2,第二尺寸阈值为8,当ScanSize≤2时,待解码标志位的上下文模型是在第一类上下文模型集合中选择的。当ScanSize>2,且ScanSize≤8时,待解码标志位的上下文模型是在第二类上下文模型集合中选择的。当ScanSize>8时,待解码标志位的上下文模型是在第三类上下文模型集合中选择的。For example, the first size threshold is set to 2, and the second size threshold is set to 8. When ScanSize≤2, the context model of the flag to be decoded is selected from the first type of context model set. When ScanSize>2 and ScanSize≦8, the context model of the flag to be decoded is selected in the second type of context model set. When ScanSize>8, the context model of the flag to be decoded is selected in the third type of context model set.
以上是以当ScanSize=2时,待解码标志位的上下文模型是在第一类上下文模型集合中选择的,当ScanSize=8时,待解码标志位的上下文模型是在第二类上下文模型集合中选择的为例,在另一种实施例中,当ScanSize=2时,还可以确定待解码标志位的上下文模型是在第二类上下文模型集合中选择的。类似的,当ScanSize=8时,也可以确定待解码标志位的上下文模型是在第三类上下文模型集合中选择的。The above is that when ScanSize=2, the context model of the flag to be decoded is selected in the first type of context model set, when ScanSize=8, the context model of the flag to be decoded is in the second type of context model set Take the selection as an example. In another embodiment, when ScanSize=2, it can also be determined that the context model of the flag to be decoded is selected in the second type of context model set. Similarly, when ScanSize=8, it can also be determined that the context model of the flag to be decoded is selected in the third type of context model set.
再如,当ScanSize<2时,待解码标志位的上下文模型是在第一类上下文模型集合中选择的。当ScanSize≥2,且ScanSize<8时,待解码标志位的上下文模型是在第二类上下文模型集合中选择的。当ScanSize≥8时,待解码标志位的上下文模型是在第三类上下文模型集合中选择的。For another example, when ScanSize<2, the context model of the flag to be decoded is selected in the first type of context model set. When ScanSize≥2 and ScanSize<8, the context model of the flag to be decoded is selected in the second type of context model set. When ScanSize≥8, the context model of the flag to be decoded is selected in the third type of context model set.
需要说明的是,当该目标扫描区域的尺寸可以通过长度和宽度来表示时,在与第一尺寸阈值或第二尺寸阈值进行比较时,需要将长度和宽度分别与第一尺寸阈值进行比较,以及将长度和宽度分别与第二尺寸阈值进行比较,譬如,当该第一尺寸阈值为2时,需要比较该目标扫描区域的长度是否小于2,以及该目标扫描区域的宽度是否小于2,等等。It should be noted that when the size of the target scan area can be represented by length and width, when comparing with the first size threshold or the second size threshold, the length and width need to be compared with the first size threshold respectively. And compare the length and width with the second size threshold. For example, when the first size threshold is 2, it is necessary to compare whether the length of the target scan area is less than 2, and whether the width of the target scan area is less than 2, etc. Wait.
作为一种示例,待解码标志位的上下文模型也可以分为大于三类的上下文模型集合,也就是说,待解码标志位也可以对应于四类上下文模型集合、五类上下文模型集合等等,此时可以设置更多的尺寸阈值进行分组,其原理与上述类似,这里不再详细介绍。As an example, the context models of the flags to be decoded can also be divided into more than three types of context model sets, that is, the flags to be decoded can also correspond to four types of context model sets, five types of context model sets, and so on. At this time, more size thresholds can be set for grouping, and the principle is similar to the above, and will not be described in detail here.
第三种方式中,上下文模型是至少根据该目标扫描区域的短边确定,该目标扫描区域的短边是根据该目标位置坐标信息确定的。In the third way, the context model is determined at least according to the short side of the target scanning area, and the short side of the target scanning area is determined according to the target position coordinate information.
本实施例中,目标扫描区域的短边可以由第一坐标值SRx和该第二坐标值SRy确定,设目标扫描区域的短边用ScanM表示,需要说明的是,短边的长度 可以用坐标值加一固定值来表示,譬如,当用SRx+1和SRy+1来表示目标扫描区域的边长时,则ScanM=min(SRx+1,SRy+1)。In this embodiment, the short side of the target scan area can be determined by the first coordinate value SRx and the second coordinate value SRy. Assuming that the short side of the target scan area is represented by ScanM, it should be noted that the length of the short side can be represented by coordinates The value is expressed by adding a fixed value. For example, when SRx+1 and SRy+1 are used to represent the side length of the target scanning area, ScanM=min(SRx+1,SRy+1).
作为一种示例,当该目标扫描区域的短边小于等于第一短边阈值时,该上下文模型是从第一类上下模型集合中选择的,当该扫描区域的短边大于该第一短边阈值时,该上下文模型是从第二类上下模型集合中选择的。As an example, when the short side of the target scan area is less than or equal to the first short side threshold, the context model is selected from the first type of upper and lower model set, and when the short side of the scan area is greater than the first short side When thresholding, the context model is selected from the second type of upper and lower model set.
其中,第一短边阈值可以根据实际情况进行设置,如可以设置为2,4,8等。Among them, the first short-side threshold can be set according to actual conditions, for example, it can be set to 2, 4, 8, and so on.
当待解码标志位对应的上下文模型根据规则分为第一类上下文模型集合和第二类上下文模型集合时,可以根据目标扫描区域的短边与第一短边阈值的大小关系确定待解码标志位的上下文模型是从第一类上下文模型集合中选择的还是从第二类上下文模型集合中选择的。When the context model corresponding to the flag to be decoded is divided into the first type of context model set and the second type of context model set according to the rules, the flag to be decoded can be determined according to the size relationship between the short side of the target scan area and the first short side threshold Is the context model selected from the first type of context model set or the second type of context model set.
譬如,设置第一短边阈值为4,当ScanM≤4时,确定待解码标志位的上下文模型是从第一类上下文模型集合中选择的。当ScanM>4时,待解码标志位的上下文模型是从第二类上下文模型集合中选择的。For example, the first short-side threshold is set to 4, and when ScanM≤4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set. When ScanM>4, the context model of the flag to be decoded is selected from the second type of context model set.
以上是以当ScanM=4时,确定待解码标志位的上下文模型是从第一类上下文模型集合中选择的为例,在另一种实施例中,当ScanM=4时,还可以确定待解码标志位的上下文模型是从第二类上下文模型集合中选择的。The above is based on when ScanM=4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set. In another embodiment, when ScanM=4, it can also be determined to be decoded. The context model of the flag bit is selected from the second type of context model set.
再譬如,设置第一短边阈值为4,当ScanM<4时,确定待解码标志位的上下文模型是从第一类上下文模型集合中选择的。当ScanM≥4时,待解码标志位的上下文模型是从第二类上下文模型集合中选择的。For another example, set the first short-side threshold to 4, and when ScanM<4, it is determined that the context model of the flag to be decoded is selected from the first type of context model set. When ScanM≥4, the context model of the flag to be decoded is selected from the second type of context model set.
作为另一种示例,当该目标扫描区域的短边小于等于第一短边阈值时,该上下文模型是从第一类上下文模型集合中选择的,当该目标扫描区域的短边大于该第一短边阈值且小于等于第二短边阈值时,该上下文模型是从第二类上下文模型集合中选择的,当该目标扫描区域的短边大于该第二短边阈值时,该上下文模型是从第三类上下文模型集合中选择的。As another example, when the short side of the target scan area is less than or equal to the first short side threshold, the context model is selected from the first type of context model set, and when the short side of the target scan area is greater than the first short side threshold, When the short side threshold is less than or equal to the second short side threshold, the context model is selected from the second type of context model set. When the short side of the target scan area is greater than the second short side threshold, the context model is selected from The third type is selected from the set of context models.
其中,第一短边阈值和第二短边阈值可以根据实际情况进行设置,如可以设置为2,4,8等,第一短边阈值应该小于第二短边阈值。Among them, the first short-side threshold and the second short-side threshold can be set according to actual conditions, such as 2, 4, 8, etc., and the first short-side threshold should be smaller than the second short-side threshold.
当待解码标志位对应的上下文模型根据规则分为第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合时,可以根据目标扫描区域的短边与第一短边阈值之间的大小关系、目标扫描区域的短边与第二短边阈值之间的大小关系,确定待解码标志位的上下文模型是在哪一类上下文模型集合中选择的。When the context model corresponding to the flag to be decoded is divided into the first type of context model set, the second type of context model set, and the third type of context model set according to the rules, it can be based on the difference between the short side of the target scan area and the first short side threshold. The size relationship between the size relationship, the size relationship between the short side of the target scanning area and the second short side threshold determines which type of context model set the context model of the flag to be decoded is selected.
譬如,设置第一短边阈值为2,第二短边阈值为8,当ScanM≤2时,待解码标志位的上下文模型是在第一类上下文模型集合中选择的。当ScanM>2,且ScanM≤8时,待解码标志位的上下文模型是在第二类上下文模型集合中选择的。当ScanM>8时,待解码标志位的上下文模型是在第三类上下文模型集合中选择的。For example, set the first short-side threshold to 2, and the second short-side threshold to 8. When ScanM≤2, the context model of the flag to be decoded is selected from the first type of context model set. When ScanM>2 and ScanM≦8, the context model of the flag to be decoded is selected in the second type of context model set. When ScanM>8, the context model of the flag to be decoded is selected in the third type of context model set.
以上是以当ScanM=2时,待解码标志位的上下文模型是在第一类上下文模型集合中选择的,当ScanM=8时,待解码标志位的上下文模型是在第二类上下文模型集合中选择的为例,在另一种实施例中,当ScanM=2时,还可以确定待解码标志位的上下文模型是在第二类上下文模型集合中选择的。类似的,当ScanM=8时,也可以确定待解码标志位的上下文模型是在第三类上下文模型集合中选择的。The above is that when ScanM=2, the context model of the flag to be decoded is selected in the first type of context model set, when ScanM=8, the context model of the flag to be decoded is in the second type of context model set Take the selection as an example. In another embodiment, when ScanM=2, it can also be determined that the context model of the flag to be decoded is selected in the second type of context model set. Similarly, when ScanM=8, it can also be determined that the context model of the flag to be decoded is selected in the third type of context model set.
譬如,当ScanM<2时,待解码标志位的上下文模型是在第一类上下文模型集合中选择的。当ScanM≥2,且ScanM<8时,待解码标志位的上下文模型是在第二类上下文模型集合中选择的。当ScanM≥8时,待解码标志位的上下文模型是在第三类上下文模型集合中选择的。For example, when ScanM<2, the context model of the flag to be decoded is selected in the first type of context model set. When ScanM≥2 and ScanM<8, the context model of the flag to be decoded is selected in the second type of context model set. When ScanM≥8, the context model of the flag to be decoded is selected in the third type of context model set.
作为一种示例,待解码标志位的上下文模型也可以分为大于三类的上下文模型集合,也就是说,待解码标志位也可以对应于四类上下文模型集合、五类上下文模型集合等等,此时可以设置更多的短边阈值进行分组,其原理与上述类似,这里不再详细介绍。As an example, the context models of the flags to be decoded can also be divided into more than three types of context model sets, that is, the flags to be decoded can also correspond to four types of context model sets, five types of context model sets, and so on. At this time, more short-side thresholds can be set for grouping, and the principle is similar to the above, and will not be described in detail here.
第四种方式中,上下文模型是至少根据该目标位置坐标信息的坐标值满足的线性关系式确定。In the fourth manner, the context model is determined at least according to the linear relationship that the coordinate value of the target position coordinate information satisfies.
作为一种示例,当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c≤n1时,该上下文模型是从第一类上下文模型集合中选择的,当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c>n1时,该上下文模型是从第二类上下文模型集合中选择的,其中,该a、b和c为常数,该SRx为该第一坐标值,该SRy为第二坐标值。As an example, when the coordinate value of the target position coordinate information satisfies the linear relationship a*SRx+b*SRy+c≤n1, the context model is selected from the first type of context model set, when the When the linear relationship that the coordinate value of the target position coordinate information satisfies is a*SRx+b*SRy+c>n1, the context model is selected from the second type of context model set, where a, b, and c are Constant, the SRx is the first coordinate value, and the SRy is the second coordinate value.
其中,n1可以取2,4,8等,a可以为1,b可以为1,c可以为0或者2。Among them, n1 can be 2, 4, 8, etc., a can be 1, b can be 1, and c can be 0 or 2.
譬如,当n1为2,a为1,b为1,c为0时,当SRx+SRy≤2时,待解码标志位的上下文模型是在第一类上下文模型集合中选择的,当SRx+SRy>2时,待解码标志位的上下文模型是在第二类上下文模型集合中选择的。For example, when n1 is 2, a is 1, b is 1, and c is 0, when SRx+SRy≤2, the context model of the flag to be decoded is selected in the first type of context model set. When SRx+ When SRy>2, the context model of the flag to be decoded is selected in the second type of context model set.
以上是以当该目标位置坐标信息的坐标值满足的线性关系式为 a*SRx+b*SRy+c=n1时,确定待解码标志位的上下文模型从第一类上下文模型集合中选择为例。在另一实施例中,当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c=n1时,还可以确定待解码标志位的上下文模型从第二类上下文模型集合中选择。The above is an example when the linear relationship that the coordinate value of the target position coordinate information satisfies is a*SRx+b*SRy+c=n1, the context model for determining the flag to be decoded is selected from the first type of context model set as an example . In another embodiment, when the linear relational expression satisfied by the coordinate value of the target position coordinate information is a*SRx+b*SRy+c=n1, it can also be determined that the context model of the flag to be decoded is from the second type of context Choose from the model collection.
譬如,当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c<n1时,该上下文模型是从第一类上下文模型集合中选择的,当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c≥n1时,该上下文模型是从第二类上下文模型集合中选择的,其中,该a、b和c为常数,该SRx为该第一坐标值,该SRy为第二坐标值。For example, when the coordinate value of the target position coordinate information satisfies the linear relationship a*SRx+b*SRy+c<n1, the context model is selected from the first type of context model set, when the target position coordinate When the linear relationship that the coordinate value of the information satisfies is a*SRx+b*SRy+c≥n1, the context model is selected from the second type of context model set, where a, b, and c are constants, and SRx is the first coordinate value, and SRy is the second coordinate value.
其中,当待解码标志位对应的上下文模型是根据规则分为第一类上下文模型和第二类上下文模型时,可以根据目标扫描区域的第一坐标和第二坐标的线性组合后确定的和与n1之间的大小关系确定待解码标志位的上下文模型从哪一类上下文模型集合中选择。Among them, when the context model corresponding to the flag to be decoded is divided into the first type of context model and the second type of context model according to the rules, the sum and the second coordinate can be determined according to the linear combination of the first coordinate and the second coordinate of the target scan area. The size relationship between n1 determines which type of context model set the context model of the flag to be decoded is selected from.
作为另一种示例,当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c≤n1时,该上下文模型是从第一类上下文模型集合中选择的,当该目标位置坐标信息的坐标值满足的线性关系式为n1<a*SRx+b*SRy+c≤n2时,该上下文模型是从第二类上下文模型集合中选择的,当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c>n2时,该上下文模型是从第三类上下文模型集合中选择的,其中,该a、b和c为常数,该SRx为该第一坐标值,该SRy为第二坐标值。As another example, when the coordinate value of the target position coordinate information satisfies the linear relationship a*SRx+b*SRy+c≤n1, the context model is selected from the first type of context model set, when When the coordinate value of the target position coordinate information satisfies the linear relationship n1<a*SRx+b*SRy+c≤n2, the context model is selected from the second type of context model set, when the target position coordinate information When the linear relationship that satisfies the coordinate value of is a*SRx+b*SRy+c>n2, the context model is selected from the third type of context model set, where a, b, and c are constants, and the SRx Is the first coordinate value, and the SRy is the second coordinate value.
其中,n1和n2可以根据实际情况进行设置,如可以设置为2,4,8等,需要注意的是,n1应小于n2。a可以为1,b可以为1,c可以为0或者2。Among them, n1 and n2 can be set according to the actual situation, such as 2, 4, 8, etc. It should be noted that n1 should be less than n2. a can be 1, b can be 1, and c can be 0 or 2.
当待解码标志位对应的上下文模型根据规则分为第一类上下文模型、第二类上下文模型和第三类上下文模型时,则可以根据扫描区域的第一坐标和第二坐标的线性组合后确定的和与n2之间的大小关系、以及扫描区域的第一坐标和第二坐标的线性组合后确定的和与n1之间的大小关系确定待解码标志位的上下文模型从哪一类上下文模型集合中选择。When the context model corresponding to the flag to be decoded is divided into the first type of context model, the second type of context model and the third type of context model according to the rules, it can be determined according to the linear combination of the first coordinate and the second coordinate of the scanning area The size relationship between the sum and n2, as well as the linear combination of the first and second coordinates of the scanning area, determines the size relationship between the sum and n1 to determine which type of context model set the context model of the flag to be decoded from Choose.
譬如,当n1为2,n2为4,a为1,b为1,c为0时,当SRx+SRy≤2时,待解码标志位的上下文模型是在第一类上下文模型集合中选择的,当2<SRx+SRy≤4时,待解码标志位的上下文模型是在第二类上下文模型集合中选择的。当SRx+SRy>4时,待解码标志位的上下文模型是在第三类上下文模型集 合中选择的。For example, when n1 is 2, n2 is 4, a is 1, b is 1, and c is 0, when SRx+SRy≤2, the context model of the flag to be decoded is selected in the first type of context model set , When 2<SRx+SRy≤4, the context model of the flag to be decoded is selected in the second type of context model set. When SRx+SRy>4, the context model of the flag to be decoded is selected in the third type of context model set.
以上是以当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c=n1时,该上下文模型是从第一类上下文模型集合中选择的为例,在另一实施例中,当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c=n1时,还可以确定该上下文模型是从第二类上下文模型集合中选择的。类似的,对于当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c=n2时,也可以确定该上下文模型是从第三类上下文模型集合中选择的。The above is an example when the coordinate value of the target position coordinate information satisfies the linear relationship a*SRx+b*SRy+c=n1, and the context model is selected from the first type of context model set. In an embodiment, when the coordinate value of the target position coordinate information satisfies the linear relational expression a*SRx+b*SRy+c=n1, it can also be determined that the context model is selected from the second type of context model set . Similarly, when the linear relational expression satisfied by the coordinate value of the target position coordinate information is a*SRx+b*SRy+c=n2, it can also be determined that the context model is selected from the third type of context model set.
譬如,当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c<n1时,该上下文模型是从第一类上下文模型集合中选择的,当该目标位置坐标信息的坐标值满足的线性关系式为n1≤a*SRx+b*SRy+c<n2时,该上下文模型是从第二类上下文模型集合中选择的,当该目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c≥n2时,该上下文模型是从第三类上下文模型集合中选择的,其中,该a、b和c为常数,该SRx为该第一坐标值,该SRy为第二坐标值。For example, when the coordinate value of the target position coordinate information satisfies the linear relationship a*SRx+b*SRy+c<n1, the context model is selected from the first type of context model set, when the target position coordinate When the linear relationship that the coordinate value of the information satisfies is n1≤a*SRx+b*SRy+c<n2, the context model is selected from the second type of context model set, when the coordinate value of the target location coordinate information satisfies When the linear relationship is a*SRx+b*SRy+c≥n2, the context model is selected from the third type of context model set, where a, b, and c are constants, and the SRx is the first The coordinate value, the SRy is the second coordinate value.
至此,便介绍完了上下文模型是至少根据该目标位置坐标信息确定的多种情况。So far, we have introduced a variety of situations where the context model is determined at least based on the target position coordinate information.
步骤204:根据该上下文模型,对待解码标志位进行解码。Step 204: According to the context model, decode the flag to be decoded.
作为一种示例,该上下文模型可以是在确定一类上下文模型集合之后,根据待解码系数之前已解码的5个变换系数中非零系数的个数,从确定的一类上下文模型集合中确定的。确定上下文模型后,即可根据该上下文模型对待解码标志位进行解码。As an example, the context model may be determined from the determined one type of context model set according to the number of non-zero coefficients in the five transform coefficients that have been decoded before the coefficients to be decoded after determining a type of context model set . After the context model is determined, the to-be-decoded flag can be decoded according to the context model.
作为一种示例,对于该目标扫描区域内的某个特殊位置的变换系数对应的significant flag可以不需要解码而直接导出。譬如,针对(SRx,0)和(0,SRy)这两个点,若(SRx,0)和(SRx,SRy)这两个点之间的线段上的变换系数均为零,则对于(SRx,0)这个点的变换系数的significant flag可以不需要解码,直接导出。同理,若(0,SRy)和(SRx,SRy)这两个点之间的线段上的变换系数均为零,则对于(0,SRy)这个点的变换系数的significant flag可以不需要解码,直接导出。As an example, the significant flag corresponding to the transform coefficient of a certain special position in the target scanning area may be directly derived without decoding. For example, for the two points (SRx, 0) and (0, SRy), if the transform coefficients on the line segment between the two points (SRx, 0) and (SRx, SRy) are all zero, then for ( SRx, 0) The significant flag of the transform coefficient at this point may be directly derived without decoding. Similarly, if the transform coefficients on the line segment between the two points (0, SRy) and (SRx, SRy) are all zero, then the significant flag of the transform coefficient at the point (0, SRy) does not need to be decoded , Export directly.
在本申请实施例中,获取当前块的码流,当确定当前块采用SRCC时,从码流中获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描 区域,至少根据该目标位置坐标信息确定该待解码系数的待解码标志位的上下文模型,根据该上下文模型,对待解码标志位进行解码。也即是,根据目标扫描区域确定待解码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了解码性能。In this embodiment of the application, the code stream of the current block is obtained. When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position The coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and decodes the to-be-decoded flag according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
需要说明的是,上述第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合仅是用于区分分组,该第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合与其他实施例中的第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合不同。It should be noted that the above-mentioned first type of context model set, second type of context model set, and third type of context model set are only used to distinguish groups. The first type of context model set, the second type of context model set and the third type of context model set The type context model set is different from the first type context model set, the second type context model set, and the third type context model set in other embodiments.
请参考图5,该图5是根据另一示例性实施例示出的一种解码方法的流程图,该方法可以由上述电子设备执行,该方法可以包括如下几个实现步骤:Please refer to FIG. 5, which is a flowchart of a decoding method according to another exemplary embodiment. The method may be executed by the above-mentioned electronic device. The method may include the following implementation steps:
步骤501:获取当前块的码流。Step 501: Obtain the code stream of the current block.
其具体实现可以参见上述图2实施例中的步骤201,这里不再重复赘述。For its specific implementation, refer to step 201 in the embodiment of FIG. 2 described above, which will not be repeated here.
步骤502:当确定该当前块采用SRCC时,从该码流中获取目标位置坐标信息,该目标位置坐标信息由第一坐标值和第二坐标值组成,该第一坐标值为该当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,该第二坐标值为该当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标。Step 502: When it is determined that the current block adopts SRCC, obtain the target position coordinate information from the code stream. The target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current block's coordinate information. The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. coordinate.
其具体实现可以参见上述图2实施例中的步骤202,这里不再重复赘述。For the specific implementation, refer to step 202 in the embodiment of FIG. 2 described above, which will not be repeated here.
步骤503:针对该当前块的目标扫描区域中的待解码系数,确定该待解码系数的待解码标志位的上下文模型,该目标扫描区域是基于该目标位置坐标信息确定的扫描区域,该上下文模型是至少根据该目标位置坐标信息确定。Step 503: For the coefficient to be decoded in the target scanning area of the current block, determine the context model of the to-be-decoded flag of the coefficient to be decoded. The target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined at least according to the coordinate information of the target location.
作为一种示例,上下文模型是至少根据该目标位置坐标信息确定,其具体实现方式可以为:该上下文模型还可以是至少根据该目标位置坐标信息和该待解码系数所在位置的坐标值确定。As an example, the context model is determined at least according to the target position coordinate information, and its specific implementation may be: the context model may also be determined at least according to the target position coordinate information and the coordinate value of the position where the coefficient to be decoded is located.
作为一种示例,该上下文模型还可以是至少根据该目标位置坐标信息和该待解码系数所在位置的坐标值确定的具体实现可以包括:根据该目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集,根据该待解码系数所在位置的坐标值,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,该上下文模型是从选择的一个上下文模型子集中确定的。As an example, the context model may also be determined according to at least the target position coordinate information and the coordinate value of the position of the coefficient to be decoded. The specific implementation may include: according to the target position coordinate information of the target scanning area, from multiple types of context One type of context model set is selected from the model set. Each type of context model set includes multiple context model subsets. According to the coordinate value of the position of the coefficient to be decoded, the selected one type of context model set includes multiple context model subsets. A subset of context models is selected, and the context model is determined from a selected subset of context models.
也即是,可以先根据目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,其具体实现方式可以包括如下(1)-(4)实现方式中的任一种:That is, one type of context model set can be selected from multiple types of context model sets according to the target location coordinate information first, and its specific implementation manner may include any of the following (1)-(4) implementation manners:
(1)根据该目标扫描区域的目标位置坐标信息,确定该目标扫描区域的面积,根据该面积,从多类上下文模型集合中选择一类上下文模型集合。(1) Determine the area of the target scan area according to the target position coordinate information of the target scan area, and select a type of context model set from multiple types of context model sets according to the area.
根据该面积从多类上下文模型集合中选择一类上下文模型集合的具体实现可以参见上述实施例2中上下文模型是至少根据目标扫描区域的面积确定的具体实现,这里不再赘述。The specific implementation of selecting one type of context model set from the multiple types of context model set according to the area can be referred to the specific implementation in which the context model is determined at least according to the area of the target scanning area in the above embodiment 2, which will not be repeated here.
(2)根据该目标扫描区域的目标位置坐标信息,确定该目标扫描区域的尺寸,根据该尺寸,从多类上下文模型集合中选择一类上下文模型集合。(2) Determine the size of the target scan area according to the target position coordinate information of the target scan area, and select a type of context model set from multiple types of context model sets according to the size.
根据该尺寸从多类上下文模型集合中选择一类上下文模型集合的具体实现可以参见上述上述实施例2中上下文模型是至少根据目标扫描区域的尺寸确定的具体实现,这里不再赘述。The specific implementation of selecting one type of context model set from the multiple types of context model set according to the size can refer to the specific implementation in which the context model is determined at least according to the size of the target scanning area in the above-mentioned embodiment 2, which will not be repeated here.
(3)根据该目标扫描区域的目标位置坐标信息,确定该目标扫描区域的短边,根据该短边,从多类上下文模型集合中选择一类上下文模型集合。(3) Determine the short side of the target scan area according to the target position coordinate information of the target scan area, and select a type of context model set from a set of multiple types of context models according to the short side.
根据该短边从多类上下文模型集合中选择一类上下文模型集合的具体实现可以参见上述上述实施例2中上下文模型是至少根据目标扫描区域的短边确定的具体实现,这里不再赘述。The specific implementation of selecting one type of context model set from the multi-type context model set according to the short side can refer to the specific implementation in which the context model is determined at least according to the short side of the target scanning area in the above-mentioned embodiment 2, which will not be repeated here.
(4)根据该目标扫描区域的目标位置坐标信息,确定该目标位置坐标信息的坐标值满足的线性关系式,根据该线性关系式,从多类上下文模型集合中选择一类上下文模型集合。(4) According to the target position coordinate information of the target scanning area, determine the linear relationship that the coordinate value of the target position coordinate information satisfies, and select a type of context model set from multiple types of context model sets according to the linear relationship.
根据该线性关系式从多类上下文模型集合中选择一类上下文模型集合的具体实现可以参见上述上述实施例2中上下文模型是至少根据目标扫描区域的线性关系式确定的具体实现,这里不再赘述。The specific implementation of selecting a type of context model set from the multiple types of context model sets according to the linear relationship can be found in the above-mentioned embodiment 2 where the context model is determined at least according to the linear relationship of the target scanning area, and will not be repeated here. .
由于一类上下文模型集合可以根据一定规则分为多个上下文模型子集,因此在选择一类上下文模型集合之后,可以再根据待解码系数所在位置的坐标值,在选择的一类上下文模型集合中选择一个上下文模型子集。Since a type of context model set can be divided into multiple context model subsets according to certain rules, after selecting a type of context model set, you can use the coordinate value of the position of the coefficient to be decoded in the selected type of context model set Select a subset of the context model.
作为一种示例,根据该待解码系数所在位置的坐标值在选择的一类上下文模型集合中选择一个上下文模型子集可以包括如下几种可能的实现方式:As an example, selecting a context model subset from a selected type of context model set according to the coordinate value of the position of the coefficient to be decoded may include the following possible implementation manners:
第一种方式中,根据该目标位置坐标信息确定第一目标位置的坐标值,根据该待解码系数所在位置的坐标值和该第一目标位置的坐标值,从选择的一类 上下文模型集合中选择一个上下文模型子集,该上下文模型是从选择的一个上下文模型子集中确定的。第一目标位置位于目标扫描区域内且排除目标位置坐标信息指示的目标位置。In the first method, the coordinate value of the first target position is determined according to the target position coordinate information, and the coordinate value of the position where the coefficient to be decoded is located and the coordinate value of the first target position are selected from the selected context model set A subset of context models is selected, and the context model is determined from a selected subset of context models. The first target position is located in the target scanning area and excludes the target position indicated by the target position coordinate information.
也就是说,该第一目标位置可以为目标扫描区域内除(SRx,SRy)点所在的位置之外的任一位置,作为一种示例,该第一目标位置还可以根据目标位置的坐标值(即SRx,SRy)确定,如该第一目标位置也可以为(SRx/2,SRy/2)。That is, the first target position may be any position in the target scanning area except the position of the (SRx, SRy) point. As an example, the first target position may also be based on the coordinate value of the target position (Ie, SRx, SRy) is determined. For example, the first target position may also be (SRx/2, SRy/2).
作为一种示例,当该待解码系数所在位置的横坐标值小于等于该第一目标位置的横坐标值,且该待解码系数所在位置的纵坐标值小于等于该第一目标位置的纵坐标值时,从选择的一类上下文模型集合中选择第一上下文模型子集。当该待解码系数所在位置的横坐标值大于该第一目标位置的横坐标值,且该待解码系数所在位置的纵坐标值大于该第一目标位置的纵坐标值时,从选择的一类上下文模型集合中选择第三上下文模型子集,否则,从选择的一类上下文模型集合中选择第二上下文模型子集。As an example, when the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the first target position, and the ordinate value of the position where the coefficient to be decoded is less than or equal to the ordinate value of the first target position When, select the first context model subset from the selected one type of context model set. When the abscissa value of the position of the coefficient to be decoded is greater than the abscissa value of the first target position, and the ordinate value of the position of the coefficient to be decoded is greater than the ordinate value of the first target position, select a type from The third context model subset is selected from the context model set; otherwise, the second context model subset is selected from the selected one type of context model set.
其中,将一类上下文模型集合分为第一上下文模型子集、第二上下文模型子集和第三上下文模型子集的规则可以根据实际情况进行设置。Among them, the rules for dividing a set of context models into a first context model subset, a second context model subset, and a third context model subset can be set according to actual conditions.
当选择的一类上下文模型集合根据规则可以分为第一上下文模型子集、第二上下文模型子集和第三上下文模型子集时,可以根据待解码系数所在位置的横坐标值和纵坐标值与第一目标位置的横坐标值和纵坐标值之间的大小关系确定待解码标志位的上下文模型从哪一个上下文模型子集中选择。When the selected context model set can be divided into the first context model subset, the second context model subset and the third context model subset according to the rules, it can be based on the abscissa value and the ordinate value of the position of the coefficient to be decoded. The magnitude relationship between the abscissa value and the ordinate value of the first target position determines from which context model subset the context model of the flag to be decoded is selected.
在本实施例中,设置pos_x为待解码系数所在位置的横坐标,pos_y为待解码系数所在位置的纵坐标,设第一目标位置的横坐标值为4,第一目标位置的纵坐标值为8,如图6(b)所示,当pos_x≤4,且pos_y≤8时,待解码系数位于区域1,确定待解码标志位的上下文模型从第一上下文模型子集中选择。当pos_x>4且pos_y>8时,待解码系数位于区域3,确定待解码标志位的上下文模型是从第三上下文模型子集中选择的。否则,待解码系数位于区域2,确定待解码标志位的上下文模型是从第二上下文模型子集中选择的。In this embodiment, set pos_x to the abscissa of the position of the coefficient to be decoded, pos_y to the ordinate of the position of the coefficient to be decoded, set the abscissa value of the first target position to 4, and set the ordinate value of the first target position to 8. As shown in Figure 6(b), when pos_x≤4 and pos_y≤8, the coefficient to be decoded is located in area 1, and the context model for determining the flag to be decoded is selected from the first context model subset. When pos_x>4 and pos_y>8, the coefficient to be decoded is located in area 3, and it is determined that the context model of the flag to be decoded is selected from the third context model subset. Otherwise, the coefficient to be decoded is located in area 2, and it is determined that the context model of the flag to be decoded is selected from the second context model subset.
以上是以当pos_x≤4,且pos_y≤8时,待解码系数位于区域1,确定待解码标志位的上下文模型从第一上下文模型子集中选择为例。在另一实施例中,还可以以当pos_x<4且pos_y≤8或pos_x≤4且pos_y<8或pos_x<4且pos_y<8时,待解码系数位于区域1,确定待解码标志位的上下文模型从第一上下文模型子集中选择为例。The above is an example when pos_x≤4 and pos_y≤8, the coefficient to be decoded is located in area 1, and the context model for determining the flag to be decoded is selected from the first context model subset. In another embodiment, when pos_x<4 and pos_y≤8 or pos_x≤4 and pos_y<8 or pos_x<4 and pos_y<8, the coefficient to be decoded is located in area 1, and the context of the flag to be decoded is determined The model is selected from the first context model subset as an example.
譬如,当pos_x<4,且pos_y<8时,待解码系数位于区域1,确定待解码标志位的上下文模型从第一上下文模型子集中选择。当pos_x≥4且pos_y≥8时,待解码系数位于区域3,确定待解码标志位的上下文模型是从第三上下文模型子集中选择的。否则,待解码系数位于区域2,确定待解码标志位的上下文模型是从第二上下文模型子集中选择的。For example, when pos_x<4 and pos_y<8, the coefficient to be decoded is located in area 1, and the context model for determining the flag to be decoded is selected from the first context model subset. When pos_x≥4 and pos_y≥8, the coefficient to be decoded is located in area 3, and it is determined that the context model of the flag to be decoded is selected from the third context model subset. Otherwise, the coefficient to be decoded is located in area 2, and it is determined that the context model of the flag to be decoded is selected from the second context model subset.
值得一提的是,若按照图6(a)中划分方式将变换系数所在的目标扫描区域分为了低频区域和非低频区域,则由于在非低频区域内包含中频区域和高频区域,中频区域往往含有非零的变换系数,而高频区域大多数的变换系数为零,如此将导致上下文自适应效果较差。而在本实施例的实现方式中,如图6(b)所示,可以更加精细地将变换系数所在的目标扫描区域分为低频、中频和高频区域,从而有利于上下文自适应,进而提高了解码效率。It is worth mentioning that if the target scan area where the transform coefficients are located is divided into a low-frequency area and a non-low-frequency area according to the division method in Figure 6(a), since the non-low-frequency area includes the intermediate frequency area and the high-frequency area, the intermediate frequency area It often contains non-zero transform coefficients, and most of the transform coefficients in the high-frequency region are zero, which will result in poor context adaptation. In the implementation of this embodiment, as shown in Figure 6(b), the target scan area where the transform coefficients are located can be divided into low-frequency, intermediate-frequency, and high-frequency areas more finely, thereby facilitating context adaptation and improving Understand code efficiency.
第二种方式中,根据该目标位置坐标信息确定第二目标位置和第三目标位置的坐标值,根据该待解码系数所在位置的坐标值、该第二目标位置和该第三目标位置的坐标值从选择的一类上下文模型集合中选择一个上下文模型子集,该上下文模型是从选择的一个上下文模型子集中确定的。In the second method, the coordinate values of the second target position and the third target position are determined according to the target position coordinate information, and the coordinate values of the position where the coefficient to be decoded is located, and the coordinates of the second target position and the third target position are determined. The value selects a context model subset from the selected one type of context model set, and the context model is determined from the selected context model subset.
作为一种示例,当该待解码系数所在位置的横坐标值小于等于该第二目标位置的横坐标值,且该待解码系数所在位置的纵坐标值小于等于该第二目标位置的纵坐标值时,从选择的一类上下文模型集合中选择第一上下文模型子集。当该待解码系数所在位置的横坐标值大于该第三目标位置的横坐标值,且该待解码系数所在位置的纵坐标值大于该第三目标位置的纵坐标值时,从选择的一类上下文模型集合中选择第三上下文模型子集,否则,从选择的一类上下文模型集合中选择第二上下文模型子集。As an example, when the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the second target position, and the ordinate value of the position where the coefficient to be decoded is less than or equal to the ordinate value of the second target position When, select the first context model subset from the selected one type of context model set. When the abscissa value of the position of the coefficient to be decoded is greater than the abscissa value of the third target position, and the ordinate value of the position of the coefficient to be decoded is greater than the ordinate value of the third target position, select a type from the The third context model subset is selected from the context model set; otherwise, the second context model subset is selected from the selected one type of context model set.
其中,第二目标位置和第三目标位置的横坐标和纵坐标可以根据实际情况进行设置,如可以设置为4,8,16等,需要注意的是,第二目标位置的横坐标值应该小于第三目标位置的横坐标值,第二目标位置的纵坐标值应该小于第三目标位置的纵坐标值。Among them, the abscissa and ordinate of the second target position and the third target position can be set according to the actual situation, such as 4, 8, 16, etc. It should be noted that the abscissa value of the second target position should be less than The abscissa value of the third target position, and the ordinate value of the second target position should be smaller than the ordinate value of the third target position.
当选择的一类上下文模型集合根据规则可以分为第一上下文模型子集、第二上下文模型子集和第三上下文模型子集时,可以根据待解码系数所在位置的横坐标与第二目标位置的横坐标之间的大小关系、待解码系数所在位置的纵坐标与第二目标位置的纵坐标之间的大小关系、待解码系数所在位置的横坐标与第三目标位置的横坐标之间的大小关系、以及待解码系数所在位置的纵坐标与 第三目标位置的纵坐标之间的大小关系确定待解码标志位的上下文模型从哪一个上下文模型子集中选择。When the selected context model set can be divided into the first context model subset, the second context model subset and the third context model subset according to the rules, it can be based on the abscissa of the position of the coefficient to be decoded and the second target position. The relationship between the size of the abscissa, the size relationship between the ordinate of the position of the coefficient to be decoded and the ordinate of the second target position, the relationship between the abscissa of the position of the coefficient to be decoded and the abscissa of the third target position The size relationship and the size relationship between the ordinate of the position where the coefficient to be decoded is located and the ordinate of the third target position determine which context model subset the context model of the flag bit to be decoded is selected from.
在本实施例中,设pos_x为待解码系数所在位置的横坐标,pos_y为待解码系数所在位置的纵坐标,设第二目标位置的横坐标为4,第二目标位置的纵坐标为8,第三目标位置的横坐标为16,第三目标位置的纵坐标为16。如图7所示,当pos_x≤4,且pos_y≤8,待解码系数位于区域1时,确定待解码标志位的上下文模型是从第一上下文模型子集中选择的。当pos_x>16,且pos_y>16时,待解码系数位于区域3时,确定待解码标志位的上下文模型是从第三上下文模型子集中选择的。否则,待解码系数位于区域2时,确定待解码标志位的上下文模型是从第二上下文模型子集中选择的。In this embodiment, let pos_x be the abscissa of the position of the coefficient to be decoded, pos_y be the ordinate of the position of the coefficient to be decoded, the abscissa of the second target position is 4, and the ordinate of the second target position is 8, The abscissa of the third target position is 16, and the ordinate of the third target position is 16. As shown in FIG. 7, when pos_x≤4 and pos_y≤8, and the coefficient to be decoded is located in area 1, it is determined that the context model of the flag to be decoded is selected from the first context model subset. When pos_x>16 and pos_y>16, when the coefficient to be decoded is located in area 3, it is determined that the context model of the flag to be decoded is selected from the third context model subset. Otherwise, when the coefficient to be decoded is located in area 2, it is determined that the context model of the flag to be decoded is selected from the second context model subset.
以上是以当pos_x≤4,且pos_y≤8时,待解码系数位于区域1,确定待解码标志位的上下文模型从第一上下文模型子集中选择为例。在另一实施例中,还可以以当pos_x<4且pos_y≤8或pos_x≤4且pos_y<8或pos_x<4且pos_y<8时,待解码系数位于区域1,确定待解码标志位的上下文模型从第一上下文模型子集中选择为例。类似的,还可以以当pos_x>16且pos_y≥16或pos_x≥16且pos_y>16或pos_x≥16且pos_y≥16时,待解码系数位于区域3时,确定待解码标志位的上下文模型从第三上下文模型子集中选择为例。The above is an example when pos_x≤4 and pos_y≤8, the coefficient to be decoded is located in area 1, and the context model for determining the flag to be decoded is selected from the first context model subset. In another embodiment, when pos_x<4 and pos_y≤8 or pos_x≤4 and pos_y<8 or pos_x<4 and pos_y<8, the coefficient to be decoded is located in area 1, and the context of the flag to be decoded is determined The model is selected from the first context model subset as an example. Similarly, when pos_x>16 and pos_y≥16 or pos_x≥16 and pos_y>16 or pos_x≥16 and pos_y≥16, when the coefficient to be decoded is in area 3, the context model of the flag to be decoded can be determined from the first Take the three-context model subset selection as an example.
譬如,当pos_x<4,且pos_y<8,待解码系数位于区域1时,确定待解码标志位的上下文模型是从第一上下文模型子集中选择的。当pos_x≥16,且pos_y≥16时,待解码系数位于区域3时,确定待解码标志位的上下文模型是从第三上下文模型子集中选择的。否则,待解码系数位于区域2时,确定待解码标志位的上下文模型是从第二上下文模型子集中选择的。For example, when pos_x<4 and pos_y<8, and the coefficient to be decoded is located in area 1, it is determined that the context model of the flag to be decoded is selected from the first context model subset. When pos_x≥16 and pos_y≥16, when the coefficient to be decoded is located in area 3, it is determined that the context model of the flag to be decoded is selected from the third context model subset. Otherwise, when the coefficient to be decoded is located in area 2, it is determined that the context model of the flag to be decoded is selected from the second context model subset.
需要说明的是,选择的一类上下文模型集合也可以分为大于三个的上下文模型子集,也就是说,选择的一类上下文模型集合也可以对应有四个上下文模型子集、五个上下文模型子集等等。It should be noted that the selected type of context model set can also be divided into more than three context model subsets, that is, the selected type of context model set can also correspond to four context model subsets and five context models. Model subsets and so on.
作为另一种示例,上下文模型是至少根据目标位置坐标信息确定的具体实现方式可以为:该上下文模型还可以是至少根据该目标位置坐标信息和该待解码系数所在位置的坐标值满足的线性关系式确定。As another example, the context model is determined at least according to the target position coordinate information. The specific implementation may be: the context model may also be a linear relationship satisfied at least according to the target position coordinate information and the coordinate value of the position where the coefficient to be decoded is located. The formula is determined.
需要说明的是,上述仅是以先根据目标位置坐标信息从多类上下文模型集合中选择一类上下文模型集合,然后再根据待解码系数所在位置的坐标值,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型 子集为例进行说明,在另一实施例中,还可以先根据待解码系数所在位置的坐标值从多类上下文模型集合中选择一类上下文模型集合,然后再根据目标位置坐标信息从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,也即是,本申请对选择的顺序不做限定。It should be noted that the above is only to first select a type of context model set from the multi-type context model set according to the target location coordinate information, and then according to the coordinate value of the position of the coefficient to be decoded, the selected one type of context model set includes One context model subset is selected from the multiple context model subsets as an example for description. In another embodiment, one type of context model set may be selected from the multiple types of context model sets according to the coordinate values of the positions of the coefficients to be decoded. , And then select a context model subset from the multiple context model subsets included in the selected context model set according to the target location coordinate information, that is, the application does not limit the order of selection.
作为一种示例,该上下文模型还可以是至少根据该目标位置坐标信息和该待解码系数所在位置的坐标值满足的线性关系式确定的具体实现可以包括:根据该目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集,根据该待解码系数所在位置的坐标值满足的线性关系式,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,该上下文模型是从选择的一个上下文模型子集中确定的。As an example, the context model may also be determined according to at least the target position coordinate information and the linear relationship that the coordinate value of the position where the coefficient to be decoded satisfies. The specific realization may include: according to the target position coordinate information of the target scanning area , Select a type of context model set from a set of multiple types of context models, each type of context model set includes multiple context model subsets, according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, from the selected type of context A context model subset is selected from a plurality of context model subsets included in the model set, and the context model is determined from the selected context model subset.
需要说明的是,根据该目标扫描区域的目标位置坐标信息从多类上下文模型集合中选择一类上下文模型集合的具体实现可以采用上一个示例中(1)-(4)四种方式中的任一种,这里不再赘述。It should be noted that the specific implementation of selecting one type of context model set from the multi-type context model set according to the target position coordinate information of the target scan area can adopt any of the four methods (1)-(4) in the previous example. One kind, I won't repeat it here.
作为一种示例,根据该待解码系数所在位置的坐标值满足的线性关系式,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集的具体实现方式可以包括但不限于如下几种可能的实现方式:As an example, according to the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded, the specific implementation manner of selecting a context model subset from the multiple context model subsets included in the selected one type of context model set may include but It is not limited to the following possible implementation methods:
第一种方式中,当该待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x≤c时,从选择的一类上下文模型集合包括的多个上下文模型子集中选择第一上下文模型子集。当该待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x>c时,从选择的一类上下文模型集合包括的多个上下文模型子集中选择第二上下文模型子集,其中,该a和b为常数,该pos_x为该待解码系数所在位置的横坐标值,该pos_y为该待解码系数所在位置的纵坐标值。In the first method, when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x≤c, select a subset of multiple context models included in the selected context model set The first subset of context models. When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x>c, the second context model subset is selected from the multiple context model subsets included in the selected one type of context model set , Where a and b are constants, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the ordinate value of the position of the coefficient to be decoded.
作为一种示例,该a可以为第一坐标值,b可以为第二坐标值,c可以为第一坐标值与该第二坐标值之间的乘积,即a=SRx,b=SRy,c=SRx*SRy。As an example, a may be the first coordinate value, b may be the second coordinate value, and c may be the product of the first coordinate value and the second coordinate value, that is, a=SRx, b=SRy, c =SRx*SRy.
当选择的一类上下文模型集合根据规则可以分为第一上下文模型子集和第二上下文模型子集时,可以根据待解码系数所在位置的坐标值满足的线性关系式确定待解码标志位的上下文模型从哪一个上下文模型子集中选择。When the selected context model set can be divided into the first context model subset and the second context model subset according to rules, the context of the flag to be decoded can be determined according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded Which context model subset the model is selected from.
譬如,如图8所示,当SRx*pos_y+SRy*pos_x≤SRx*SRy时,也就是待解码系数位于区域1,确定待解码标志位的上下文模型从第一上下文模型子集中选 择。当SRx*pos_y+SRy*pos_x>SRx*SRy时,也就是待解码系数位于区域2时,确定待解码标志位的上下文模型是从第二上下文模型子集中选择的。For example, as shown in Figure 8, when SRx*pos_y+SRy*pos_x≤SRx*SRy, that is, the coefficient to be decoded is located in area 1, the context model for determining the flag to be decoded is selected from the first context model subset. When SRx*pos_y+SRy*pos_x>SRx*SRy, that is, when the coefficient to be decoded is located in region 2, it is determined that the context model of the flag to be decoded is selected from the second context model subset.
以上是以当该待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x=c时,从选择的一类上下文模型集合包括的多个上下文模型子集中选择第一上下文模型子集为例。在另一实施例中,当该待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x=c时,还可以从选择的一类上下文模型集合包括的多个上下文模型子集中选择第二上下文模型子集。The above is that when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x=c, the first context is selected from the multiple context model subsets included in the selected context model set Take the model subset as an example. In another embodiment, when the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a*pos_y+b*pos_x=c, multiple context models may be included from the selected context model set. Select the second context model subset from the subset.
譬如,当该待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x<c时,从选择的一类上下文模型集合包括的多个上下文模型子集中选择第一上下文模型子集。当该待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x≥c时,从选择的一类上下文模型集合包括的多个上下文模型子集中选择第二上下文模型子集,其中,该a和b为常数,该pos_x为该待解码系数所在位置的横坐标值,该pos_y为该待解码系数所在位置的纵坐标值。For example, when the coordinate value of the position where the coefficient to be decoded satisfies the linear relational expression a*pos_y+b*pos_x<c, the first context model is selected from the multiple context model subsets included in the selected context model set Subset. When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x≥c, the second context model subset is selected from the multiple context model subsets included in the selected one type of context model set , Where a and b are constants, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the ordinate value of the position of the coefficient to be decoded.
第二种方式中,当该待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x≤c1时,从选择的一类上下文模型集合中选择第一上下文模型子集。当该待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x>c1,且a2*pos_y+b2*pos_x<c2时,从选择的一类上下文模型集合中选择第二上下文模型子集,当该待解码系数所在位置的坐标值满足的线性关系式为a2*pos_y+b2*pos_x≥c2时,从选择的一类上下文模型集合中选择第三上下文模型子集,其中,该a1、b1、a2、b2、c1和c2为常数,该c1小于该c2,该pos_x为该待解码系数所在位置的横坐标值,该pos_y为该待解码系数所在位置的纵坐标值。In the second way, when the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a1*pos_y+b1*pos_x≤c1, the first context model subset is selected from the selected one type of context model set. When the coordinate value of the position of the coefficient to be decoded satisfies the linear relationship a1*pos_y+b1*pos_x>c1, and a2*pos_y+b2*pos_x<c2, select the second one from the selected context model set Context model subset, when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a2*pos_y+b2*pos_x≥c2, select the third context model subset from the selected one type of context model set, where , The a1, b1, a2, b2, c1, and c2 are constants, the c1 is smaller than the c2, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the ordinate value of the position of the coefficient to be decoded.
作为一种示例,该a1和a2均可以为第一坐标值,该b1和b2均可以为第二坐标值,该c1可以为第一坐标值和该第二坐标值之间的乘积的一半,该c2可以为该第一坐标值与该第二坐标值之间的乘积。也即是,a1=a2=SRx,b1=b2=SRy,c1=(SRx*SRy)/2,c2=SRx*SRy。作为另一种示例,还可以设置a1=2*SRx,b1=2*SRy,c1=SRx*SRy,a2=SRx,b2=SRy,c2=SRx*SRy或者设置a1=0,b1=4,c1=SRx,a2=0,b=2,c2=(SRx+1)或SRx或者设置a1=4,b1=0,c1=SRy,a2=2,b2=0,c2=(SRy+1)或SRy。As an example, both a1 and a2 may be the first coordinate value, both b1 and b2 may be the second coordinate value, and the c1 may be half of the product of the first coordinate value and the second coordinate value, The c2 may be the product of the first coordinate value and the second coordinate value. That is, a1=a2=SRx, b1=b2=SRy, c1=(SRx*SRy)/2, and c2=SRx*SRy. As another example, you can also set a1=2*SRx, b1=2*SRy, c1=SRx*SRy, a2=SRx, b2=SRy, c2=SRx*SRy or set a1=0, b1=4, c1=SRx, a2=0, b=2, c2=(SRx+1) or SRx or set a1=4, b1=0, c1=SRy, a2=2, b2=0, c2=(SRy+1) Or SRy.
当选择的一类上下文模型集合根据规则可以分为第一上下文模型子集、第 二上下文模型子集和第三上下文模型子集时,可以根据待解码系数所在位置的坐标值满足的线性关系式确定待解码标志位的上下文模型从哪一个上下文模型子集中选择。When the selected context model set can be divided into the first context model subset, the second context model subset, and the third context model subset according to the rules, the linear relationship can be satisfied according to the coordinate value of the position of the coefficient to be decoded. Determine from which context model subset the context model of the flag to be decoded is selected.
譬如,如图9所示,当SRx*pos_y+SRy*pos_x≤(SRx*SRy)/2时,说明待解码系数位于区域1中,确定待解码标志位的上下文模型从第一上下文模型子集中选择。当(SRx*SRy)/2<SRx*pos_y+SRy*pos_x<SRx*SRy时,说明待解码系数位于区域2,确定待解码标志位的上下文模型从第二上下文模型子集中选择。当SRx*pos_y+SRy*pos_x≥SRx*SRy时,说明待解码系数位于区域3,确定待解码标志位的上下文模型从第三上下文模型子集中选择。For example, as shown in Figure 9, when SRx*pos_y+SRy*pos_x≤(SRx*SRy)/2, it means that the coefficient to be decoded is located in area 1, and the context model of the flag to be decoded is determined from the first context model subset select. When (SRx*SRy)/2<SRx*pos_y+SRy*pos_x<SRx*SRy, it means that the coefficient to be decoded is located in area 2, and the context model of the flag to be decoded is determined to be selected from the second context model subset. When SRx*pos_y+SRy*pos_x≥SRx*SRy, it means that the coefficient to be decoded is located in region 3, and the context model of the flag to be decoded is determined to be selected from the third context model subset.
以上是以当该待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x=c1时,从选择的一类上下文模型集合中选择第一上下文模型子集为例,在另一实施例中,当该待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x=c1时,还可以从选择的一类上下文模型集合中选择第二上下文模型子集。类似的,当该待解码系数所在位置的坐标值满足的线性关系式为a2*pos_y+b2*pos_x=c2时,也可以从选择的一类上下文模型集合中选择第二上下文模型子集。The above is an example of selecting the first context model subset from the selected one type of context model set when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a1*pos_y+b1*pos_x=c1, in In another embodiment, when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a1*pos_y+b1*pos_x=c1, the second context model can also be selected from the set of selected context models. set. Similarly, when the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a2*pos_y+b2*pos_x=c2, the second context model subset can also be selected from the selected one type of context model set.
譬如,当该待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x<c1时,从选择的一类上下文模型集合中选择第一上下文模型子集。当该待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x≥c1,且a2*pos_y+b2*pos_x≤c2时,从选择的一类上下文模型集合中选择第二上下文模型子集,当该待解码系数所在位置的坐标值满足的线性关系式为a2*pos_y+b2*pos_x>c2时,从选择的一类上下文模型集合中选择第三上下文模型子集,其中,该a1、b1、a2、b2、c1和c2为常数,该c1小于该c2,该pos_x为该待解码系数所在位置的横坐标值,该pos_y为该待解码系数所在位置的纵坐标值。For example, when the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a1*pos_y+b1*pos_x<c1, the first context model subset is selected from the selected context model set. When the coordinate value of the position of the coefficient to be decoded satisfies the linear relationship a1*pos_y+b1*pos_x≥c1, and a2*pos_y+b2*pos_x≤c2, select the second one from the selected context model set Context model subset, when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a2*pos_y+b2*pos_x>c2, select the third context model subset from the selected one type of context model set, where , The a1, b1, a2, b2, c1, and c2 are constants, the c1 is smaller than the c2, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the ordinate value of the position of the coefficient to be decoded.
另外,选择的一类上下文模型集合也可以分为大于三个的上下文模型子集,也就是说,选择的一类上下文模型集合也可以对应有四个上下文模型子集、五个上下文模型子集等等。In addition, the selected type of context model set can also be divided into more than three context model subsets, that is, the selected type of context model set can also correspond to four context model subsets and five context model subsets. and many more.
需要说明的是,上述仅是以先根据目标位置坐标信息从多类上下文模型集合中选择一类上下文模型集合,然后再根据待解码系数所在位置的坐标值满足的线性关系式,从选择的一类上下文模型集合包括的多个上下文模型子集中选 择一个上下文模型子集为例进行说明,在另一实施例中,还可以先根据待解码系数所在位置的坐标值满足的线性关系式从多类上下文模型集合中选择一类上下文模型集合,然后再根据目标位置坐标信息从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,也即是,本申请对选择的顺序不做限定。It should be noted that the above is only based on first selecting one type of context model set from the multi-type context model set according to the target position coordinate information, and then according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, from the selected one. One context model subset is selected from the multiple context model subsets included in the class context model set as an example for description. In another embodiment, it is also possible to first select the linear relationship from the multiple types according to the linear relationship satisfied by the position of the coefficient to be decoded. One type of context model set is selected from the context model set, and then a context model subset is selected from the multiple context model subsets included in the selected one type of context model set according to the target location coordinate information. The order is not limited.
作为一种示例,上下文模型是至少根据目标位置坐标信息确定的具体实现可以为:该上下文模型是至少根据该目标位置坐标信息、该待解码系数所在位置的坐标值和该待解码系数所在位置的坐标值满足的线性关系式确定。As an example, the context model is determined based on at least the target position coordinate information. The specific implementation may be: the context model is based on at least the target position coordinate information, the coordinate value of the position where the coefficient to be decoded is located, and the position where the coefficient to be decoded is located. The linear relationship that the coordinate value satisfies is determined.
作为一种示例,该上下文模型是至少根据该目标位置坐标信息、该待解码系数所在位置的坐标值和该待解码系数所在位置的坐标值满足的线性关系式确定的具体实现可以包括:根据该目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集,根据该待解码系数所在位置的坐标值满足的线性关系式、该待解码系数所在位置的坐标值和该目标位置坐标信息,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,该上下文模型是从选择的一个上下文模型子集中确定的。As an example, the context model is determined according to at least the target position coordinate information, the coordinate value of the position of the coefficient to be decoded, and the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies. The specific implementation may include: Target position coordinate information of the target scanning area, select one type of context model set from multiple types of context model sets, each type of context model set includes multiple context model subsets, according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded Formula, the coordinate value of the position of the coefficient to be decoded and the coordinate information of the target position, a context model subset is selected from a plurality of context model subsets included in the selected one type of context model set, and the context model is selected from a context model subset The model subset is determined.
需要说明的是,根据该目标扫描区域的目标位置坐标信息从多类上下文模型集合中选择一类上下文模型集合的具体实现可以采用上述示例中(1)-(4)四种方式中的任一种,这里不再赘述。It should be noted that the specific implementation of selecting one type of context model set from the multi-type context model set according to the target position coordinate information of the target scan area can be implemented in any of the four methods (1)-(4) in the above example. Kind, I won’t go into details here.
作为一种示例,根据该待解码系数所在位置的坐标值满足的线性关系式、该待解码系数所在位置的坐标值和该目标位置坐标信息,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集的具体实现方式可以为:当该待解码系数所在位置的横坐标值小于等于第一坐标阈值,且该待解码系数所在位置的纵坐标值小于等于第二坐标阈值时,从选择的一类上下文模型集合包括的多个上下文模型子集中选择第一上下文模型子集。当该待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x>c时,从选择的一类上下文模型集合包括的多个上下文模型子集中选择第三上下文模型子集。否则,从选择的一类上下文模型集合包括的多个上下文模型子集中选择第二上下文模型子集,其中,该第一坐标阈值小于第一坐标值,该第二坐标阈值小于该第二坐标值。As an example, according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the target position coordinate information, multiple contexts included in the selected context model set The specific implementation of selecting a context model subset from the model subset may be: when the abscissa value of the position where the coefficient to be decoded is less than or equal to the first coordinate threshold, and the ordinate value of the position where the coefficient to be decoded is less than or equal to the second coordinate When thresholding, the first context model subset is selected from the multiple context model subsets included in the selected one type of context model set. When the coordinate value of the position of the coefficient to be decoded satisfies the linear relationship a*pos_y+b*pos_x>c, select the third context model subset from the multiple context model subsets included in the selected one type of context model set . Otherwise, a second context model subset is selected from the plurality of context model subsets included in the selected context model set, where the first coordinate threshold is smaller than the first coordinate value, and the second coordinate threshold is smaller than the second coordinate value .
其中,第一坐标阈值和第二坐标阈值可以根据实际情况进行设置,如可以 设置为2,4,8等。作为一种示例,a可以为SRx,b可以为SRy,c可以为SRx*SRy。Among them, the first coordinate threshold and the second coordinate threshold can be set according to actual conditions, such as 2, 4, 8 and so on. As an example, a can be SRx, b can be SRy, and c can be SRx*SRy.
当选择的一类上下文模型集合根据规则可以分为第一上下文模型子集、第二上下文模型子集和第三上下文模型子集时,可以根据待解码系数所在位置的坐标值满足的线性关系式、该待解码系数所在位置的坐标值和该目标位置坐标信息确定待解码标志位的上下文模型从哪一个上下文模型子集中选择。When the selected context model set can be divided into the first context model subset, the second context model subset, and the third context model subset according to the rules, the linear relationship can be satisfied according to the coordinate value of the position of the coefficient to be decoded. , The coordinate value of the position where the coefficient to be decoded is located and the target position coordinate information determine from which context model subset the context model of the flag bit to be decoded is selected.
譬如,设置第一坐标阈值为2,第二坐标阈值为4,如图10所示,当pos_x≤2,且pos_y≤4时,说明待解码系数所在的位置的坐标位于区域1,确定待解码标志位的上下文模型从第一上下文模型子集中选择,当SRx*pos_y+SRy*pos_x>SRx*SRy时,说明待解码系数所在的位置的坐标位于区域3,确定待解码标志位的上下文模型从第三上下文模型子集中选择。否则,说明说明待解码系数所在的位置的坐标位于区域2,确定待解码标志位的上下文模型从第二上下文模型子集中选择。For example, set the first coordinate threshold to 2 and the second coordinate threshold to 4. As shown in Figure 10, when pos_x≤2 and pos_y≤4, it indicates that the coordinates of the position of the coefficient to be decoded are located in area 1, and the decoding is determined The context model of the flag bit is selected from the first context model subset. When SRx*pos_y+SRy*pos_x>SRx*SRy, it means that the coordinates of the position where the coefficient to be decoded is located in area 3, and the context model of the flag bit to be decoded is determined from The third context model subset is selected. Otherwise, it is explained that the coordinates of the position where the coefficient to be decoded is located in area 2, and the context model for determining the flag bit to be decoded is selected from the second context model subset.
以上是以当pos_x=2,且pos_y=4时,从选择的一类上下文模型集合包括的多个上下文模型子集中选择第一上下文模型子集为例,在另一种实施例中,还可以包括如下情况:当pos_x<2,且pos_y<4时,确定待解码标志位的上下文模型从第一上下文模型子集中选择,当SRx*pos_y+SRy*pos_x≥SRx*SRy时,确定待解码标志位的上下文模型从第三上下文模型子集中选择。否则,确定待解码标志位的上下文模型从第二上下文模型子集中选择。The above is an example of selecting the first context model subset from the multiple context model subsets included in the selected context model set when pos_x=2 and pos_y=4. In another embodiment, Including the following situations: when pos_x<2 and pos_y<4, the context model of the flag to be decoded is determined to be selected from the first context model subset, and when SRx*pos_y+SRy*pos_x≥SRx*SRy, the flag to be decoded is determined The context model of bits is selected from the third subset of context models. Otherwise, the context model for determining the flag to be decoded is selected from the second subset of context models.
需要说明的是,上述是以根据该待解码系数所在位置的坐标值满足的线性关系式、该待解码系数所在位置的坐标值和该目标位置坐标信息,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集为例进行说明。在另一实施例中,还可以该上下文模型可以根据该待解码系数所在位置的坐标值满足的线性关系式、该待解码系数所在位置的坐标值和该目标位置坐标信息中的至少一个,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集。It should be noted that the above is based on the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the target position coordinate information, included from the selected one type of context model set One context model subset is selected from multiple context model subsets as an example for illustration. In another embodiment, the context model may be based on at least one of the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the coordinate information of the target position, from One context model subset is selected from a plurality of context model subsets included in the selected one type of context model set.
还需要说明的是,上述是根据该目标扫描区域的目标位置坐标信息从多类上下文模型集合中选择一类上下文模型集合,再根据该目标位置坐标信息、该待解码系数所在位置的坐标值和该待解码系数所在位置的坐标值满足的线性关系式从选择的一类上下文模型集合中选择一个上下文模型子集为例进行说明的。在另一种实施例中,还可以先根据该目标位置坐标信息、该待解码系数所在位置的坐标值和该待解码系数所在位置的坐标值满足的线性关系式从多类上 下文模型集合中选择一类上下文模型集合,再根据该目标扫描区域的目标位置坐标信息从选择的一类上下文模型集合中选择一个上下文模型子集。It should also be noted that the above is to select a type of context model set from multiple types of context model sets according to the target position coordinate information of the target scan area, and then according to the target position coordinate information, the coordinate value of the position where the coefficient to be decoded is located, and The linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is described by selecting a context model subset from the selected one type of context model set as an example. In another embodiment, the target position coordinate information, the coordinate value of the position of the coefficient to be decoded, and the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies may be selected from a set of multiple types of context models. A type of context model set, and then select a context model subset from the selected type of context model set according to the target position coordinate information of the target scanning area.
作为一种示例,上下文模型是至少根据目标位置坐标信息确定的具体实现可以为:该上下文模型是至少根据该目标位置坐标信息和该当前块满足的预设条件确定。As an example, the specific implementation of the context model being determined at least according to the target position coordinate information may be: the context model is determined at least according to the target position coordinate information and the preset condition satisfied by the current block.
其中,该预设条件可以根据实际需求进行设置,作为一种示例,该预设条件可以包括但不限于如下条件中的任一种:The preset condition can be set according to actual needs. As an example, the preset condition can include but is not limited to any of the following conditions:
该第一坐标值或该第二坐标值为零。或者,该第一坐标值和该第二坐标值的乘积小于第一坐标阈值。或者,该第一坐标值大于等于第二坐标阈值且该第二坐标值大于等于第三坐标阈值。或者,该第一坐标值小于等于第二坐标阈值或该第二坐标值小于第三坐标阈值。The first coordinate value or the second coordinate value is zero. Or, the product of the first coordinate value and the second coordinate value is less than the first coordinate threshold. Or, the first coordinate value is greater than or equal to the second coordinate threshold and the second coordinate value is greater than or equal to the third coordinate threshold. Alternatively, the first coordinate value is less than or equal to the second coordinate threshold or the second coordinate value is less than the third coordinate threshold.
其中,第一坐标阈值、第二坐标阈值和第三坐标阈值可以根据实际情况进行设置。Among them, the first coordinate threshold, the second coordinate threshold, and the third coordinate threshold can be set according to actual conditions.
作为一种示例,设置第一坐标阈值为4,第二坐标阈值为1,第三坐标阈值为2。也就是预设条件可以为:SRx=0或SRy=0;SRx*SRy<4;SRx≥1,且SRy≥2;SRx≤1或SRy≤2。As an example, set the first coordinate threshold to 4, the second coordinate threshold to 1, and the third coordinate threshold to 2. That is, the preset condition may be: SRx=0 or SRy=0; SRx*SRy<4; SRx≥1 and SRy≥2; SRx≤1 or SRy≤2.
作为一种示例,该上下文模型是至少根据该目标位置坐标信息和该当前块满足的预设条件确定的具体实现可以包括:根据该目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集,根据该当前块满足的预设条件确定选择方式,根据所确定的选择方式,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,该上下文模型是从选择的一个上下文模型子集中确定的。As an example, the context model is determined according to at least the target position coordinate information and the preset conditions satisfied by the current block. The specific implementation may include: according to the target position coordinate information of the target scanning area, from a collection of multiple types of context models Select a type of context model set. Each type of context model set includes multiple context model subsets. The selection method is determined according to the preset conditions that the current block meets. According to the determined selection method, the selected one type of context model set includes A context model subset is selected from a plurality of context model subsets, and the context model is determined from the selected context model subset.
需要说明的是,根据该目标扫描区域的目标位置坐标信息从多类上下文模型集合中选择一类上下文模型集合的具体实现可以采用上述示例中(1)-(4)四种方式中的任一种,这里不再赘述。It should be noted that the specific implementation of selecting one type of context model set from the multi-type context model set according to the target position coordinate information of the target scan area can be implemented in any of the four methods (1)-(4) in the above example. Kind, I won’t go into details here.
作为一种示例,根据该当前块满足的预设条件确定选择方式,根据所确定的选择方式从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集的具体实现方式可以为:当该当前块满足预设条件时,根据该待解码系数所在位置的坐标值满足的线性关系式,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集。当该当前块不满 足该预设条件时,根据该待解码系数所在位置的坐标值与该目标位置坐标信息,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集。As an example, the selection method is determined according to the preset conditions satisfied by the current block, and the specific implementation method of selecting a context model subset from the multiple context model subsets included in the selected one type of context model set according to the determined selection method It can be: when the current block satisfies a preset condition, according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, a context model sub-set is selected from a plurality of context model subsets included in the selected context model set. set. When the current block does not meet the preset condition, according to the coordinate value of the position where the coefficient to be decoded is located and the target position coordinate information, a context model sub-set is selected from a plurality of context model subsets included in the selected context model set. set.
譬如,若当前块中第一坐标值和/或第二坐标值满足预设条件,如当SRx=0时,则待解码标志位基于pos_x和pos_y的线性组合确定上下文模型,其具体实现方式可以参见上述实施例。否则,待解码标志位基于pos_x和pos_y的位置确定上下文模型,其具体实现方式可以参见上述实施例。For example, if the first coordinate value and/or the second coordinate value in the current block meet the preset condition, such as when SRx=0, the flag to be decoded determines the context model based on the linear combination of pos_x and pos_y. The specific implementation can be See the above example. Otherwise, the to-be-decoded flag bit determines the context model based on the positions of pos_x and pos_y, and the specific implementation manner can refer to the foregoing embodiment.
上述示例中,是根据该目标扫描区域的目标位置坐标信息从多类上下文模型集合中选择一类上下文模型集合,再根据该当前块满足的预设条件确定选择方式,根据所确定的选择方式从选择的一类上下文模型集合中选择一个上下文模型子集为例进行说明的。在另一种实施例中,还可以先根据该当前块满足的预设条件确定选择方式,根据所确定的选择方式从多类上下文模型集合中选择一类上下文模型集合,再根据该目标扫描区域的目标位置坐标信息从选择的一类上下文模型集合中选择一个上下文模型子集。In the above example, one type of context model set is selected from the multi-type context model set according to the target position coordinate information of the target scanning area, and then the selection method is determined according to the preset conditions satisfied by the current block, and the selection method is selected according to the determined selection method. The selection of a subset of context models from the selected one type of context model set is taken as an example for illustration. In another embodiment, the selection method may be determined first according to the preset conditions satisfied by the current block, a type of context model set is selected from the multi-type context model set according to the determined selection method, and then the target scanning area Select a context model subset from the selected one type of context model set.
其中选择方式可以为根据待解码系数所在位置的坐标值满足的线性关系式进行选择,或者,根据待解码系数所在位置的坐标值与目标位置坐标信息进行选择。The selection method may be selected based on the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, or selected based on the coordinate value of the position of the coefficient to be decoded and the coordinate information of the target position.
步骤504:根据该上下文模型,对待解码标志位进行解码。Step 504: According to the context model, decode the flag to be decoded.
其具体实现可以参见上述图2实施例中的步骤204,这里不再重复赘述。For its specific implementation, refer to step 204 in the embodiment of FIG. 2 described above, which will not be repeated here.
在本申请实施例中,获取当前块的码流,当确定当前块采用SRCC时,从码流中获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待解码系数的待解码标志位的上下文模型,根据该上下文模型,对待解码标志位进行解码。也即是,根据目标扫描区域确定待解码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了解码性能。In this embodiment of the application, the code stream of the current block is obtained. When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position The coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and decodes the to-be-decoded flag according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
另外,在本实施例中,可以先根据目标扫描区域从多类上下文模型集合中选择一类上下文模型集合,保证分组方式与SRCC扫描方式匹配。之后,在根据待解码系数在目标扫描区域内所在的位置,从选择的一类上下文模型集合中选择一个上下文模型子集,进而从选择的一个上下文模型子集中确定该待解码系数的待解码标志位的上下文模型,使得更加精细地将变换系数所在区域分为低频、中频和高频区域,提高了解码效率。In addition, in this embodiment, a type of context model set may be selected from a set of multiple types of context models according to the target scanning area to ensure that the grouping method matches the SRCC scanning method. Then, according to the position of the coefficient to be decoded in the target scanning area, a context model subset is selected from the selected context model set, and then the to-be-decoded flag of the coefficient to be decoded is determined from the selected context model subset The bit context model makes the region where the transform coefficients are located more finely divided into low-frequency, intermediate-frequency and high-frequency regions, which improves decoding efficiency.
需要说明的是,上述第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合仅是用于区分分组,该第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合与其他实施例中的第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合不同。It should be noted that the above-mentioned first type of context model set, second type of context model set, and third type of context model set are only used to distinguish groups. The first type of context model set, the second type of context model set and the third type of context model set The type context model set is different from the first type context model set, the second type context model set, and the third type context model set in other embodiments.
作为一种示例,本申请实施例还提供了一种解码方法,该方法可以由上述电子设备来执行,该方法可以包括如下几个步骤。As an example, an embodiment of the present application also provides a decoding method, which may be executed by the above electronic device, and the method may include the following steps.
步骤A1:获取当前块的码流。Step A1: Obtain the code stream of the current block.
其具体实现方式可以参见图2实施例中的步骤201,这里不再重复赘述。For a specific implementation manner, refer to step 201 in the embodiment of FIG. 2, and details are not repeated here.
步骤A2:当确定该当前块采用SRCC时,从该码流中获取目标位置坐标信息,该目标位置坐标信息由第一坐标值和第二坐标值组成,该第一坐标值为该当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,该第二坐标值为该当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标。Step A2: When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the current block's coordinate information. The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. coordinate.
其具体实现方式可以参见图2实施例中的步骤202,这里不再重复赘述。For a specific implementation manner, refer to step 202 in the embodiment of FIG. 2, and details are not repeated here.
步骤A3:针对该当前块的目标扫描区域中的待解码系数,确定该待解码系数的待解码标志位的上下文模型,该目标扫描区域是基于该目标位置坐标信息确定的扫描区域,该上下文模型是至少根据该待解码系数所在位置的坐标值从至少三类上下文模型集合中确定。Step A3: For the coefficient to be decoded in the target scanning area of the current block, determine the context model of the to-be-decoded flag of the coefficient to be decoded. The target scanning area is the scanning area determined based on the target position coordinate information. The context model It is determined from at least three types of context model sets at least according to the coordinate value of the position of the coefficient to be decoded.
其中上下文模型是至少根据该待解码系数所在位置的坐标值从至少三类上下文模型集合中确定的具体实现方式可以有多种。The context model is determined from at least three types of context model sets at least according to the coordinate value of the position of the coefficient to be decoded. There may be multiple specific implementations.
第一种方式中,该上下文模型是至少根据该待解码系数所在位置的坐标值从至少三类上下文模型集合中确定,包括:根据该目标位置坐标信息确定第一目标位置的坐标值,该上下文模型是至少根据该待解码系数所在位置的坐标值和该第一目标位置的坐标值确定,该第一目标位置位于该目标扫描区域内且排除该目标位置坐标信息指示的目标位置。In the first manner, the context model is determined from at least three types of context model sets based on at least the coordinate value of the position where the coefficient to be decoded is located, including: determining the coordinate value of the first target position according to the target position coordinate information, and the context The model is determined at least according to the coordinate value of the position of the coefficient to be decoded and the coordinate value of the first target position, the first target position is located in the target scanning area and the target position indicated by the target position coordinate information is excluded.
也就是说,该第一目标位置可以为目标扫描区域内除(SRx,SRy)点所在的位置之外的任一位置,作为一种示例,该第一目标位置还可以根据目标位置也就是(SRx,SRy)点所在的位置确定,如该第一目标位置也可以为(SRx/2,SRy/2)。That is to say, the first target position can be any position in the target scanning area except the position where the (SRx, SRy) point is located. As an example, the first target position can also be based on the target position, which is ( The position of the point (SRx, SRy) is determined. For example, the first target position may also be (SRx/2, SRy/2).
作为一种示例,当该待解码系数所在位置的横坐标值小于等于该第一目标 位置的横坐标值,且该待解码系数所在位置的纵坐标值小于等于该第一目标位置的纵坐标值时,该上下文模型是从第一类上下文模型集合中选择的;当该待解码系数所在位置的横坐标值大于该第一目标位置的横坐标值,且该待解码系数所在位置的纵坐标值大于该第一目标位置的纵坐标值时,该上下文模型是从第三类上下文模型集合中选择的;否则,该上下文模型是从第二类上下文模型集合中选择的。As an example, when the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the first target position, and the ordinate value of the position where the coefficient to be decoded is less than or equal to the ordinate value of the first target position When the context model is selected from the first type of context model set; when the abscissa value of the position where the coefficient to be decoded is greater than the abscissa value of the first target position, and the ordinate value of the position where the coefficient to be decoded is When the ordinate value is greater than the first target position, the context model is selected from the third type of context model set; otherwise, the context model is selected from the second type of context model set.
当待解码系数的待解码标志位对应的上下文模型根据规则可以分为第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合时,可以根据待解码系数所在位置的横坐标值与第一目标位置的横坐标值之间的大小关系、以及待解码系数所在位置的纵坐标值与第一目标位置的纵坐标值之间的大小关系确定待解码标志位的上下文模型从哪一类上下文模型集合中选择。When the context models corresponding to the to-be-decoded flag bits of the coefficients to be decoded can be divided into the first-type context model set, the second-type context model set, and the third-type context model set according to the rules, it can be based on the abscissa of the position of the coefficient to be decoded. The magnitude relationship between the value and the abscissa value of the first target position, and the magnitude relationship between the ordinate value of the position where the coefficient to be decoded and the ordinate value of the first target position determine the context model of the flag to be decoded Choose from a collection of context models.
其目标扫描区域的具体情况可以参见图6。The specific conditions of the target scanning area can be seen in Figure 6.
第二种方式中,该上下文模型是至少根据该待解码系数所在位置的坐标值从至少三类上下文模型集合中确定,包括:根据该目标位置坐标信息确定第二目标位置和第三目标位置的坐标值,该上下文模型至少是根据该待解码系数所在位置的坐标值、该第二目标位置和该第三目标位置的坐标值确定。In the second manner, the context model is determined from at least three types of context model sets based on at least the coordinate value of the position where the coefficient to be decoded is located, including: determining the second target position and the third target position according to the target position coordinate information The coordinate value, the context model is determined at least according to the coordinate value of the position where the coefficient to be decoded is located, the coordinate value of the second target position and the third target position.
作为一种示例,当该待解码系数所在位置的横坐标值小于等于该第二目标位置的横坐标值,且该待解码系数所在位置的纵坐标值小于等于该第二目标位置的纵坐标值时,该上下文模型是从第一类上下文模型集合中选择的;当该待解码系数所在位置的横坐标值大于该第三目标位置的横坐标值,且该待解码系数所在位置的纵坐标值大于该第三目标位置的纵坐标值时,该上下文模型是从第三类上下文模型集合中选择的;否则,该上下文模型是从第二类上下文模型集合中选择的。As an example, when the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the second target position, and the ordinate value of the position where the coefficient to be decoded is less than or equal to the ordinate value of the second target position When the context model is selected from the first type of context model set; when the abscissa value of the position where the coefficient to be decoded is greater than the abscissa value of the third target position, and the ordinate value of the position where the coefficient to be decoded is When the ordinate value is greater than the third target position, the context model is selected from the third type of context model set; otherwise, the context model is selected from the second type of context model set.
其中,第二目标位置和第三目标位置的横坐标和纵坐标可以根据实际情况进行设置,如可以设置为4,8,16等,需要注意的是,第二目标位置的横坐标值应该小于第三目标位置的横坐标值,第二目标位置的纵坐标值应该小于第三目标位置的纵坐标值。Among them, the abscissa and ordinate of the second target position and the third target position can be set according to the actual situation, such as 4, 8, 16, etc. It should be noted that the abscissa value of the second target position should be less than The abscissa value of the third target position, and the ordinate value of the second target position should be smaller than the ordinate value of the third target position.
当待解码系数的待解码标志位对应的上下文模型根据规则可以分为第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合时,可以根据待解码系数所在位置的横坐标与第二目标位置的横坐标之间的大小关系、待解码系数所在位置的纵坐标与第二目标位置的纵坐标之间的大小关系、待解码 系数所在位置的横坐标与第三目标位置的横坐标之间的大小关系、待解码系数所在位置的纵坐标与第三目标位置的纵坐标之间的大小关系确定待解码标志位的上下文模型从哪一类上下文模型集合中选择。When the context models corresponding to the to-be-decoded flag bits of the coefficients to be decoded can be divided into the first-type context model set, the second-type context model set, and the third-type context model set according to the rules, it can be based on the abscissa of the position of the coefficient to be decoded. The size relationship between the abscissa and the second target position, the size relationship between the ordinate of the position of the coefficient to be decoded and the ordinate of the second target position, the relationship between the abscissa of the position of the coefficient to be decoded and the third target position The size relationship between the abscissas, the size relationship between the ordinate of the position of the coefficient to be decoded and the ordinate of the third target position determines which type of context model set the context model of the flag to be decoded is selected from.
其目标扫描区域的具体情况可以参见图7。The specific conditions of the target scanning area can be seen in Figure 7.
其具体实现方式可以参见图2实施例中的步骤203,这里不再重复赘述。For a specific implementation manner, refer to step 203 in the embodiment of FIG. 2, and details are not repeated here.
步骤A4:根据该上下文模型,对该待解码标志位进行解码。Step A4: According to the context model, decode the flag to be decoded.
其具体实现方式可以参见图2实施例中的步骤204,这里不再重复赘述。For a specific implementation manner, refer to step 204 in the embodiment in FIG. 2, and details are not repeated here.
在本申请实施例中,获取当前块的码流,当确定当前块采用SRCC时,从码流中获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待解码系数的待解码标志位的上下文模型,根据该上下文模型,对待解码标志位进行解码。也即是,根据目标扫描区域确定待解码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了解码性能。In this embodiment of the application, the code stream of the current block is obtained. When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position The coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and decodes the to-be-decoded flag according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
需要说明的是,上述第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合仅是用于区分分组,该第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合与其他实施例中的第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合不同。It should be noted that the above-mentioned first type of context model set, second type of context model set, and third type of context model set are only used to distinguish groups. The first type of context model set, the second type of context model set and the third type of context model set The type context model set is different from the first type context model set, the second type context model set, and the third type context model set in other embodiments.
作为一种示例,本申请实施例还提供的一种解码方法,该方法可以由上述电子设备来执行,该方法可以包括如下几个步骤。As an example, an embodiment of the present application also provides a decoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
步骤B1:获取当前块的码流。Step B1: Obtain the code stream of the current block.
其具体实现方式可以参见图2实施例中的步骤201,这里不再重复赘述。For a specific implementation manner, refer to step 201 in the embodiment of FIG. 2, and details are not repeated here.
步骤B2:当确定该当前块采用基于扫描区域的系数编码SRCC时,从该码流中获取目标位置坐标信息,该目标位置坐标信息由第一坐标值和第二坐标值组成,该第一坐标值为该当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,该第二坐标值为该当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标。Step B2: When it is determined that the current block adopts the coefficient coding SRCC based on the scanning area, obtain the target position coordinate information from the code stream. The target position coordinate information is composed of a first coordinate value and a second coordinate value. The first coordinate The value is the abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient.
其具体实现方式可以参见图2实施例中的步骤202,这里不再重复赘述。For a specific implementation manner, refer to step 202 in the embodiment of FIG. 2, and details are not repeated here.
步骤B3:针对该当前块的目标扫描区域中的待解码系数,确定该待解码系数的待解码标志位的上下文模型,该目标扫描区域是基于该目标位置坐标信息确定的扫描区域,该上下文模型是至少根据该待解码系数所在位置的坐标值满 足的线性关系式确定。Step B3: For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined at least according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded.
其中该上下文模型是至少根据该待解码系数所在位置的坐标值满足的线性关系式确定的具体实现方式可以有多种。Where the context model is determined at least according to the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded, there may be many specific implementation manners.
第一种方式中,当该待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x≤c时,该上下文模型是从第一类上下文模型集合中选择的;当该待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x>c时,该上下文模型是从第二类上下文模型集合中选择的;其中,该a和b为常数,该pos_x为该待解码系数所在位置的横坐标值,该pos_y为该待解码系数所在位置的纵坐标值。In the first method, when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x≤c, the context model is selected from the first type of context model set; when the When the coordinate value of the position of the coefficient to be decoded satisfies the linear relationship a*pos_y+b*pos_x>c, the context model is selected from the second type of context model set; where a and b are constants, and pos_x is the abscissa value of the position of the coefficient to be decoded, and pos_y is the ordinate value of the position of the coefficient to be decoded.
其中,该a为该第一坐标值,该b为该第二坐标值,该第一数值为该第一坐标值与该第二坐标值之间的乘积。Wherein, the a is the first coordinate value, the b is the second coordinate value, and the first value is the product of the first coordinate value and the second coordinate value.
当待解码系数的待解码标志位对应的上下文模型根据规则可以分为第一类上下文模型集合和第二类上下文模型集合时,可以根据待解码系数所在位置的坐标值满足的线性关系式确定待解码标志位的上下文模型从哪一类上下文模型集合中选择。When the context models corresponding to the to-be-decoded flag bits of the coefficients to be decoded can be divided into the first type of context model set and the second type of context model set according to the rules, the to-be-decoded coefficients can be determined according to the linear relationship satisfied by the coordinate values of the positions of the coefficients to be decoded. The context model of the decoding flag is selected from the set of context models.
其目标扫描区域的具体情况可以参见图8。The specific conditions of the target scanning area can be seen in Figure 8.
第二种方式中,当该待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x≤c1时,该上下文模型是从第一类上下文模型集合中选择的;当该待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x>c1,且a2*pos_y+b2*pos_x≤c2时,该上下文模型是从第二类上下文模型集合中选择的;当该待解码系数所在位置的坐标值满足的线性关系式为a2*pos_y+b2*pos_x>c2时,该上下文模型是从第三类上下文模型集合中选择的;其中,该a1、b1、a2、b2、c1和c2为常数,该c1小于该c2,该pos_x为该待解码系数所在位置的横坐标值,该pos_y为该待解码系数所在位置的纵坐标值。In the second method, when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a1*pos_y+b1*pos_x≤c1, the context model is selected from the first type of context model set; when the When the coordinate value of the position of the coefficient to be decoded satisfies the linear relationship a1*pos_y+b1*pos_x>c1, and a2*pos_y+b2*pos_x≤c2, the context model is selected from the second type of context model set ; When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a2*pos_y+b2*pos_x>c2, the context model is selected from the third type of context model set; among them, the a1, b1, a2, b2, c1, and c2 are constants, the c1 is smaller than the c2, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the ordinate value of the position of the coefficient to be decoded.
其中,该a1和a2均为该第一坐标值,该b1和b2均为该第二坐标值,该c1为该第一坐标值和该第二坐标值之间的乘积的一半,该c2为该第一坐标值与该第二坐标值之间的乘积。Wherein, the a1 and a2 are both the first coordinate value, the b1 and b2 are both the second coordinate value, the c1 is half of the product between the first coordinate value and the second coordinate value, and the c2 is The product of the first coordinate value and the second coordinate value.
当待解码系数的待解码标志位对应的上下文模型根据规则可以分为第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合时,可以根据待解码系数所在位置的坐标值满足的线性关系式确定待解码标志位的上下文 模型从哪一类上下文模型集合中选择。When the context models corresponding to the to-be-decoded flag bits of the coefficients to be decoded can be divided into the first-type context model set, the second-type context model set, and the third-type context model set according to the rules, it can be based on the coordinate value of the position of the coefficient to be decoded. The satisfied linear relationship determines which type of context model set the context model of the flag to be decoded is selected from.
其目标扫描区域的具体情况可以参见图9。The specific conditions of the target scanning area can be seen in Figure 9.
由此,上下文模型是至少根据该待解码系数所在位置的坐标值满足的线性关系式确定的具体实现方式就介绍完了。Therefore, the context model is at least determined according to the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded, and the introduction is complete.
进一步地,上述上下文模型是至少根据该待解码系数所在位置的坐标值满足的线性关系式、该待解码系数所在位置的坐标值和该目标位置坐标信息确定,其具体实现过程包括:当该待解码系数所在位置的横坐标值小于等于第一坐标阈值,且该待解码系数所在位置的纵坐标值小于等于第二坐标阈值时,该上下文模型是从第一类上下文模型集合中选择的;否则,当该待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x>c时,该上下文模型是从第三类上下文模型集合中选择的;否则,该上下文模型是从第二类上下文模型集合中选择的;其中,该第一坐标阈值小于第一坐标值,该第二坐标阈值小于该第二坐标值。Further, the above-mentioned context model is determined at least according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the coordinate information of the target position. The specific implementation process includes: When the abscissa value of the position of the decoding coefficient is less than or equal to the first coordinate threshold, and the ordinate value of the position of the coefficient to be decoded is less than or equal to the second coordinate threshold, the context model is selected from the first type of context model set; otherwise , When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x>c, the context model is selected from the third type of context model set; otherwise, the context model is from The second type of context model set is selected; wherein, the first coordinate threshold is smaller than the first coordinate value, and the second coordinate threshold is smaller than the second coordinate value.
当待解码系数的待解码标志位对应的上下文模型根据规则可以分为第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合时,可以根据待解码系数所在位置的坐标值满足的线性关系式、该待解码系数所在位置的坐标值和该目标位置坐标信息确定待解码标志位的上下文模型从哪一类上下文模型集合中选择。When the context models corresponding to the to-be-decoded flag bits of the coefficients to be decoded can be divided into the first-type context model set, the second-type context model set, and the third-type context model set according to the rules, it can be based on the coordinate value of the position of the coefficient to be decoded. The satisfied linear relationship, the coordinate value of the position where the coefficient to be decoded is located, and the target position coordinate information determine which type of context model set the context model of the flag bit to be decoded is selected from.
其目标扫描区域的具体情况可以参见图10。The specific conditions of the target scanning area can be seen in Figure 10.
其具体实现方式可以参见图2实施例中的步骤203,这里不再重复赘述。For a specific implementation manner, refer to step 203 in the embodiment of FIG. 2, and details are not repeated here.
另外,选择的一类上下文模型集合也可以分为大于三个的上下文模型集合,也就是说,选择的一类上下文模型集合也可以对应有四个上下文模型集合、五个上下文模型集合等等。In addition, the selected type of context model set may also be divided into more than three context model sets, that is, the selected type of context model set may also correspond to four context model sets, five context model sets, and so on.
步骤B4:根据该上下文模型,对该待解码标志位进行解码。Step B4: According to the context model, decode the flag to be decoded.
其具体实现方式可以参见图2实施例中的步骤204,这里不再重复赘述。For a specific implementation manner, refer to step 204 in the embodiment in FIG. 2, and details are not repeated here.
在本申请实施例中,获取当前块的码流,当确定当前块采用SRCC时,从码流中获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待解码系数的待解码标志位的上下文模型,根据该上下文模型,对待解码标志位进行解码。也即是,根据目标扫描区域确定待解码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了解码性能。In this embodiment of the application, the code stream of the current block is obtained. When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position The coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and decodes the to-be-decoded flag according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
需要说明的是,上述第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合仅是用于区分分组,该第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合与其他实施例中的第一类上下文模型集合、第二类上下文模型集合和第三类上下文模型集合不同。It should be noted that the above-mentioned first type of context model set, second type of context model set, and third type of context model set are only used to distinguish groups. The first type of context model set, the second type of context model set and the third type of context model set The type context model set is different from the first type context model set, the second type context model set, and the third type context model set in other embodiments.
作为一种示例,本申请实施例还提供的一种解码方法,该方法可以由上述电子设备来执行,该方法可以包括如下几个步骤。As an example, an embodiment of the present application also provides a decoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
步骤C1:获取当前块的码流。Step C1: Obtain the code stream of the current block.
其具体实现方式可以参见图2实施例中的步骤201,这里不再重复赘述。For a specific implementation manner, refer to step 201 in the embodiment of FIG. 2, and details are not repeated here.
步骤C2:当确定该当前块采用基于扫描区域的系数编码SRCC时,从该码流中获取目标位置坐标信息,该目标位置坐标信息由第一坐标值和第二坐标值组成,该第一坐标值为该当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,该第二坐标值为该当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标。Step C2: When it is determined that the current block adopts the coefficient coding SRCC based on the scanning area, the target position coordinate information is obtained from the code stream. The target position coordinate information is composed of a first coordinate value and a second coordinate value. The first coordinate The value is the abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient.
其具体实现方式可以参见图2实施例中的步骤202,这里不再重复赘述。For a specific implementation manner, refer to step 202 in the embodiment of FIG. 2, and details are not repeated here.
步骤C3:针对该当前块的目标扫描区域中的待解码系数,确定该待解码系数的待解码标志位的上下文模型,该目标扫描区域是基于该目标位置坐标信息确定的扫描区域,该上下文模型是至少基于该当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的。Step C3: For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined according to the determined selection method after the selection method is determined at least based on the preset condition met by the current block.
其中选择方式包括:根据该待解码系数所在位置的坐标值满足的线性关系式进行选择,或者,根据该待解码系数所在位置的坐标值与该目标位置坐标信息进行选择。The selection method includes: selecting according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, or selecting according to the coordinate value of the position of the coefficient to be decoded and the coordinate information of the target position.
该上下文模型是至少基于该当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的具体实现方式可以为:当该当前块满足预设条件时,该上下文模型是至少根据该待解码系数所在位置的坐标值满足的线性关系式确定;当该当前块不满足该预设条件时,该上下文模型是至少根据该待解码系数所在位置的坐标值与该目标位置坐标信息确定。The context model is determined based on at least the preset conditions met by the current block and the specific implementation manner determined according to the determined selection manner may be: when the current block meets the preset conditions, the context model is at least based on the pending conditions. The linear relationship that the coordinate value of the position of the decoding coefficient satisfies is determined; when the current block does not meet the preset condition, the context model is determined at least according to the coordinate value of the position of the coefficient to be decoded and the target position coordinate information.
其中,该预设条件包括如下条件中的一种:该第一坐标值或该第二坐标值为零;该第一坐标值和该第二坐标值的乘积小于第一坐标阈值;该第一坐标值大于等于第二坐标阈值且该第二坐标值大于等于第三坐标阈值;该第一坐标值小于等于第二坐标阈值或该第二坐标值小于第三坐标阈值。Wherein, the preset condition includes one of the following conditions: the first coordinate value or the second coordinate value is zero; the product of the first coordinate value and the second coordinate value is less than the first coordinate threshold; The coordinate value is greater than or equal to the second coordinate threshold and the second coordinate value is greater than or equal to the third coordinate threshold; the first coordinate value is less than or equal to the second coordinate threshold or the second coordinate value is less than the third coordinate threshold.
其中,第一坐标阈值、第二坐标阈值和第三坐标阈值可以根据实际情况进行设置。Among them, the first coordinate threshold, the second coordinate threshold, and the third coordinate threshold can be set according to actual conditions.
其具体实现方式可以参见图2实施例中的步骤203,这里不再重复赘述。For a specific implementation manner, refer to step 203 in the embodiment of FIG. 2, and details are not repeated here.
步骤C4:根据该上下文模型,对该待解码标志位进行解码。Step C4: According to the context model, decode the flag to be decoded.
其具体实现方式可以参见图2实施例中的步骤204,这里不再重复赘述。For a specific implementation manner, refer to step 204 in the embodiment in FIG. 2, and details are not repeated here.
在本申请实施例中,获取当前块的码流,当确定当前块采用SRCC时,从码流中获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待解码系数的待解码标志位的上下文模型,根据该上下文模型,对待解码标志位进行解码。也即是,根据目标扫描区域确定待解码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了解码性能。In this embodiment of the application, the code stream of the current block is obtained. When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position The coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and the to-be-decoded flag is decoded according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
作为一种示例,本申请实施例还提供的一种编码方法,该方法可以由上述电子设备来执行,该方法可以包括如下几个步骤。As an example, the embodiment of the present application also provides an encoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
步骤D1:当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,该目标位置坐标信息由第一坐标值和第二坐标值组成,该第一坐标值为该当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,该第二坐标值为该当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标。Step D1: When the current block adopts the coefficient coding SRCC based on the scanning area, obtain the target position coordinate information, the target position coordinate information is composed of the first coordinate value and the second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block .
若当前块的编码方式为SRCC,可以确定变换系数对应的扫描区域,该扫描区域是通过当前块的变换系数中最右面的非零变换系数的横坐标SRx(第一坐标值)和变换系数中最下面的非零变换系数的纵坐标SRy(第二坐标值)来确定的,作为一种示例,可以以当前块的某个顶点为原点建立坐标系。基于此,编码端可以通过SRx和SRy的信息,确定目标扫描区域,该SRx和SRy对应的位置为该目标扫描区域对应的目标位置。If the encoding method of the current block is SRCC, the scan area corresponding to the transform coefficient can be determined. The scan area is the abscissa SRx (first coordinate value) of the rightmost non-zero transform coefficient in the transform coefficient of the current block and the transform coefficient. The ordinate SRy (second coordinate value) of the bottom non-zero transformation coefficient is determined. As an example, a coordinate system can be established with a certain vertex of the current block as the origin. Based on this, the encoder can determine the target scanning area through the information of SRx and SRy, and the position corresponding to the SRx and SRy is the target position corresponding to the target scanning area.
其具体实现方式可以参见图2实施例中的步骤202,这里不再重复赘述。For a specific implementation manner, refer to step 202 in the embodiment of FIG. 2, and details are not repeated here.
步骤D2:针对该当前块的目标扫描区域中的待编码系数,确定该待编码系数的待编码标志位的上下文模型,该目标扫描区域是基于该目标位置坐标信息确定的扫描区域,该上下文模型是至少根据该目标位置坐标信息确定。Step D2: For the coefficient to be coded in the target scanning area of the current block, a context model of the to-be-coded flag of the coefficient to be coded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined at least according to the coordinate information of the target position.
其中,待编码系数为按扫描顺序得到的待进行编码的系数,也即是,在编码过程中可以按照一定的顺序扫描该目标扫描区域,如图3所示,该扫描顺序 可以是从右下角到左上角的反向Z字型扫描。每扫描到一个变换系数确定为待编码系数,然后可以按照本申请实施例提供的方法确定该待编码系数的待编码标志位。Among them, the coefficient to be coded is the coefficient to be coded obtained in the scanning order, that is, the target scanning area can be scanned in a certain order during the coding process, as shown in Figure 3, the scanning order can be from the lower right corner Reverse zigzag scan to the upper left corner. Each scan of a transform coefficient is determined as the coefficient to be coded, and then the flag bit to be coded of the coefficient to be coded can be determined according to the method provided in the embodiment of the present application.
其中,该待编码标志位为第一标志位、第二标志位、第三标志位中的至少一个。该第一标志位用于指示变换系数是否是非零。该第二标志位用于指示变换系数的绝对值是否大于1。该第三标志位用于指示变换系数的绝对值是否大于2。Wherein, the flag bit to be encoded is at least one of the first flag bit, the second flag bit, and the third flag bit. The first flag bit is used to indicate whether the transform coefficient is non-zero. The second flag bit is used to indicate whether the absolute value of the transform coefficient is greater than one. The third flag bit is used to indicate whether the absolute value of the transform coefficient is greater than 2.
譬如,作为一种示例,该第一标志位为significant flag,该第二标志位为GT1flag,该第三标志位为GT2flag。也就是说,需要至少一个标志位用于指示待编码系数,即待编码系数可以由一个标志位进行指示,也可以由多个标志位进行指示。譬如,若待编码系数为1,那么需要significant flag用于指示待编码系数非零,GT1flag用于指示待编码系数幅值小于等于1。若待编码系数为0,那么只需要significant flag用于指示待编码系数为零即可。For example, as an example, the first flag bit is significant flag, the second flag bit is GT1 flag, and the third flag bit is GT2 flag. In other words, at least one flag bit is required to indicate the coefficient to be coded, that is, the coefficient to be coded can be indicated by one flag bit or multiple flag bits. For example, if the coefficient to be coded is 1, a significant flag is required to indicate that the coefficient to be coded is non-zero, and GT1flag is used to indicate that the magnitude of the coefficient to be coded is less than or equal to 1. If the coefficient to be coded is 0, then only a significant flag is needed to indicate that the coefficient to be coded is zero.
如前文所述,变换系数的编码可以通过对用于指示变换系数的语法元素进行编码来实现,其中,该语法元素中的至少一个标志位可以通过上下文模型进行编码,一般来说,每个标志位都可以通过多种不同的上下文模型来进行编码。如图2实施例中表1所示,可知每个标志位都对应有多种上下文模型,因此,在编码过程中需要确定采用哪种上下文模型编码待编码系数。As mentioned above, the encoding of transform coefficients can be realized by encoding the syntax element used to indicate the transform coefficient, wherein at least one flag bit in the syntax element can be encoded by the context model. Generally speaking, each flag Bits can be coded through a variety of different context models. As shown in Table 1 in the embodiment of FIG. 2, it can be known that each flag bit corresponds to multiple context models. Therefore, it is necessary to determine which context model is used to encode the coefficients to be encoded during the encoding process.
在本申请实施例中,上下文模型是至少根据该目标位置坐标信息确定,其具体实现方式可以参见图2实施例中的步骤203,这里不再重复赘述。In the embodiment of the present application, the context model is determined at least according to the coordinate information of the target position. For a specific implementation manner, refer to step 203 in the embodiment of FIG. 2, and details are not repeated here.
步骤D3:根据该上下文模型,对该待编码标志位进行编码。Step D3: encoding the flag to be encoded according to the context model.
作为一种示例,该上下文模型可以是在确定一类上下文模型集合之后,根据待编码系数之前已编码的5个变换系数中非零系数的个数,在该类上下文模型集合中确定的。确定上下文模型后,即可根据该上下文模型对待编码标志位进行编码。As an example, the context model may be determined in this type of context model set according to the number of non-zero coefficients in the five transformation coefficients that have been encoded before the coefficients to be encoded after a type of context model set is determined. After the context model is determined, the to-be-coded flag can be coded according to the context model.
其具体实现方式可以参见图2实施例中的步骤204,这里不再重复赘述。For a specific implementation manner, refer to step 204 in the embodiment in FIG. 2, and details are not repeated here.
在本申请实施例中,当当前块采用SRCC时,获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待编码系数的待编码标志位的上下文模型,根据该上下文模型,对待编码标志位进行编码。也即是,根据目标扫描区域确定待编码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了编码性能。In the embodiment of the present application, when the current block adopts SRCC, the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information According to the context model of the context model, the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
作为一种示例,本申请实施例还提供的一种编码方法,该方法可以由上述电子设备来执行,该方法可以包括如下几个步骤。As an example, the embodiment of the present application also provides an encoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
步骤E1:当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,该目标位置坐标信息由第一坐标值和第二坐标值组成,该第一坐标值为该当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,该第二坐标值为该当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标。Step E1: When the current block adopts the coefficient coding SRCC based on the scanning area, obtain the target position coordinate information, the target position coordinate information is composed of the first coordinate value and the second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block .
其具体实现方式可以参见图2实施例中的步骤202,这里不再重复赘述。For a specific implementation manner, refer to step 202 in the embodiment of FIG. 2, and details are not repeated here.
步骤E2:针对该当前块的目标扫描区域中的待编码系数,确定该待编码系数的待编码标志位的上下文模型,该目标扫描区域是基于该目标位置坐标信息确定的扫描区域,该上下文模型是至少根据该待解码系数所在位置的坐标值从至少三类上下文模型集合中确定。Step E2: For the coefficient to be coded in the target scan area of the current block, determine the context model of the flag to be coded of the coefficient to be coded, the target scan area is a scan area determined based on the target position coordinate information, and the context model It is determined from at least three types of context model sets at least according to the coordinate value of the position of the coefficient to be decoded.
其具体实现方式可以参见上述实施例中的步骤A3,这里不再重复赘述。For a specific implementation manner, refer to step A3 in the above-mentioned embodiment, which will not be repeated here.
步骤E3:根据该上下文模型,对该待编码标志位进行编码。Step E3: According to the context model, the flag bit to be encoded is encoded.
其具体实现方式可以参见图2实施例中的步骤204,这里不再重复赘述。For a specific implementation manner, refer to step 204 in the embodiment in FIG. 2, and details are not repeated here.
在本申请实施例中,当当前块采用SRCC时,获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待编码系数的待编码标志位的上下文模型,根据该上下文模型,对待编码标志位进行编码。也即是,根据目标扫描区域确定待编码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了编码性能。In the embodiment of the present application, when the current block adopts SRCC, the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-coded flag of the coefficient to be encoded is determined at least according to the target position coordinate information According to the context model of the context model, the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
作为一种示例,本申请实施例还提供的一种编码方法,该方法可以由上述电子设备来执行,该方法可以包括如下几个步骤。As an example, the embodiment of the present application also provides an encoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
步骤F1:当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,该目标位置坐标信息由第一坐标值和第二坐标值组成,该第一坐标值为该当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,该第二坐标值为该当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标。Step F1: When the current block adopts the coefficient coding SRCC based on the scanning area, obtain the target position coordinate information, the target position coordinate information is composed of the first coordinate value and the second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block .
其具体实现方式可以参见图2实施例中的步骤202,这里不再重复赘述。For a specific implementation manner, refer to step 202 in the embodiment of FIG. 2, and details are not repeated here.
步骤F2:针对该当前块的目标扫描区域中的待编码系数,确定该待编码系 数的待编码标志位的上下文模型,该目标扫描区域是基于该目标位置坐标信息确定的扫描区域,该上下文模型是至少根据该待解码系数所在位置的坐标值满足的线性关系式确定。Step F2: For the coefficient to be coded in the target scanning area of the current block, a context model of the to-be-coded flag of the coefficient to be coded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, and the context model It is determined at least according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded.
其具体实现方式可以参见上述实施例中的步骤B3,这里不再重复赘述。For a specific implementation manner, refer to step B3 in the above-mentioned embodiment, which will not be repeated here.
步骤F3:根据该上下文模型,对该待编码标志位进行编码。Step F3: According to the context model, the flag bit to be encoded is encoded.
其具体实现方式可以参见图2实施例中的步骤204,这里不再重复赘述。For a specific implementation manner, refer to step 204 in the embodiment in FIG. 2, and details are not repeated here.
在本申请实施例中,当当前块采用SRCC时,获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待编码系数的待编码标志位的上下文模型,根据该上下文模型,对待编码标志位进行编码。也即是,根据目标扫描区域确定待编码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了编码性能。In the embodiment of the present application, when the current block adopts SRCC, the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information According to the context model of the context model, the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
作为一种示例,本申请实施例还提供的一种编码方法,该方法可以由上述电子设备来执行,该方法可以包括如下几个步骤。As an example, the embodiment of the present application also provides an encoding method, which may be executed by the above-mentioned electronic device, and the method may include the following steps.
步骤G1:当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,该目标位置坐标信息由第一坐标值和第二坐标值组成,该第一坐标值为该当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,该第二坐标值为该当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标。Step G1: When the current block adopts the coefficient coding SRCC based on the scanning area, obtain the target position coordinate information, the target position coordinate information is composed of the first coordinate value and the second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficient, and the second coordinate value is the ordinate of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block .
其具体实现方式可以参见图2实施例中的步骤202,这里不再重复赘述。For a specific implementation manner, refer to step 202 in the embodiment of FIG. 2, and details are not repeated here.
步骤G2:针对该当前块的目标扫描区域中的待编码系数,确定该待编码系数的待编码标志位的上下文模型,该目标扫描区域是基于该目标位置坐标信息确定的扫描区域,该上下文模型是至少基于该当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的。Step G2: For the coefficient to be coded in the target scan area of the current block, determine the context model of the flag to be coded of the coefficient to be coded. The target scan area is a scan area determined based on the target position coordinate information, and the context model It is determined according to the determined selection method at least after the selection method is determined based on the preset condition met by the current block.
其具体实现方式可以参见上述实施例中的步骤C3,这里不再重复赘述。For a specific implementation manner, refer to step C3 in the foregoing embodiment, and details are not repeated here.
步骤G3:根据该上下文模型,对该待编码标志位进行编码。Step G3: According to the context model, encode the flag to be encoded.
其具体实现方式可以参见图2实施例中的步骤204,这里不再重复赘述。For a specific implementation manner, refer to step 204 in the embodiment in FIG. 2, and details are not repeated here.
在本申请实施例中,当当前块采用SRCC时,获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待编码系数的待编码标志位的上下文模型,根据该上下文模型,对待编码标志位进行编码。也即是,根据目标扫描区域确定待编码标志位的上下文 模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了编码性能。In the embodiment of the present application, when the current block adopts SRCC, the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information According to the context model of the context model, the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
请参考图11,图11是本申请实施例提供的一种解码装置的结构示意图,该装置可以包括:Please refer to FIG. 11. FIG. 11 is a schematic structural diagram of a decoding device provided by an embodiment of the present application. The device may include:
码流获取模块1110,用于获取当前块的码流;The code stream obtaining module 1110 is used to obtain the code stream of the current block;
信息获取模块1120,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information obtaining module 1120 is configured to obtain target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate. The first coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the transformation coefficient of the current block Among the included non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
模型确定模块1130,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述目标位置坐标信息确定;The model determination module 1130 is configured to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, where the target scan area is based on the target position coordinate information For the determined scanning area, the context model is determined at least according to the coordinate information of the target position;
解码模块1140,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module 1140 is configured to decode the to-be-decoded flag bit according to the context model.
在本申请一种可能的实现方式中,所述上下文模型是至少根据所述目标扫描区域的面积确定,所述目标扫描区域的面积是根据所述目标位置坐标信息确定的。In a possible implementation manner of the present application, the context model is determined at least according to the area of the target scan area, and the area of the target scan area is determined according to the target position coordinate information.
在本申请一种可能的实现方式中,当所述目标扫描区域的面积小于等于第一面积阈值时,所述上下文模型是从第一类上下模型集合中选择的;当所述扫描区域的面积大于所述第一面积阈值时,所述上下文模型是从第二类上下模型集合中选择的。In a possible implementation of this application, when the area of the target scan area is less than or equal to the first area threshold, the context model is selected from the first type of upper and lower model set; when the area of the scan area When it is greater than the first area threshold, the context model is selected from the second type of upper and lower model set.
在本申请一种可能的实现方式中,当所述目标扫描区域的面积小于等于第一面积阈值时,所述上下文模型是从第一类上下文模型集合中选择的;当所述目标扫描区域的面积大于所述第一面积阈值且小于等于第二面积阈值时,所述上下文模型是从第二类上下文模型集合中选择的;当所述目标扫描区域的面积大于所述第二面积阈值时,所述上下文模型是从第三类上下文模型集合中选择的。In a possible implementation of the present application, when the area of the target scan area is less than or equal to the first area threshold, the context model is selected from the first type of context model set; when the area of the target scan area is When the area is greater than the first area threshold and less than or equal to the second area threshold, the context model is selected from the second type of context model set; when the area of the target scan area is greater than the second area threshold, The context model is selected from the third type of context model set.
在本申请一种可能的实现方式中,所述上下文模型是至少根据所述目标扫描区域的尺寸确定,所述目标扫描区域的尺寸是根据所述目标位置坐标信息确定的。In a possible implementation manner of the present application, the context model is determined at least according to the size of the target scanning area, and the size of the target scanning area is determined according to the target position coordinate information.
在本申请一种可能的实现方式中,当所述目标扫描区域的尺寸小于等于第一尺寸阈值时,所述上下文模型是从第一类上下模型集合中选择的;当所述扫描区域的尺寸大于所述第一尺寸阈值时,所述上下文模型是从第二类上下模型集合中选择的。In a possible implementation of the present application, when the size of the target scan area is less than or equal to the first size threshold, the context model is selected from the first type of upper and lower model set; when the size of the scan area When it is greater than the first size threshold, the context model is selected from the second type of upper and lower model set.
在本申请一种可能的实现方式中,当所述目标扫描区域的尺寸小于等于第一尺寸阈值时,所述上下文模型是从第一类上下文模型集合中选择的;当所述目标扫描区域的尺寸大于所述第一尺寸阈值且小于等于第二尺寸阈值时,所述上下文模型是从第二类上下文模型集合中选择的;当所述目标扫描区域的尺寸大于所述第二尺寸阈值时,所述上下文模型是从第三类上下文模型集合中选择的。In a possible implementation of the present application, when the size of the target scan area is less than or equal to the first size threshold, the context model is selected from the first type of context model set; when the size of the target scan area is When the size is greater than the first size threshold and less than or equal to the second size threshold, the context model is selected from the second type of context model set; when the size of the target scanning area is greater than the second size threshold, The context model is selected from the third type of context model set.
在本申请一种可能的实现方式中,所述上下文模型是至少根据所述目标扫描区域的短边确定,所述目标扫描区域的短边是根据所述目标位置坐标信息确定的。In a possible implementation manner of the present application, the context model is determined at least according to the short side of the target scanning area, and the short side of the target scanning area is determined according to the target position coordinate information.
在本申请一种可能的实现方式中,当所述目标扫描区域的短边小于等于第一短边阈值时,所述上下文模型是从第一类上下模型集合中选择的;当所述扫描区域的短边大于所述第一短边阈值时,所述上下文模型是从第二类上下模型集合中选择的。In a possible implementation of the present application, when the short side of the target scan area is less than or equal to the first short side threshold, the context model is selected from the first type of upper and lower model set; when the scan area When the short side of is greater than the first short side threshold, the context model is selected from the set of upper and lower models of the second type.
在本申请一种可能的实现方式中,当所述目标扫描区域的短边小于等于第一短边阈值时,所述上下文模型是从第一类上下文模型集合中选择的;当所述目标扫描区域的短边大于所述第一短边阈值且小于等于第二短边阈值时,所述上下文模型是从第二类上下文模型集合中选择的;当所述目标扫描区域的短边大于所述第二短边阈值时,所述上下文模型是从第三类上下文模型集合中选择的。In a possible implementation of the present application, when the short side of the target scan area is less than or equal to the first short side threshold, the context model is selected from the first type of context model set; when the target scan When the short side of the region is greater than the first short side threshold and less than or equal to the second short side threshold, the context model is selected from the second type of context model set; when the short side of the target scanning area is greater than the When the second short-side threshold is used, the context model is selected from the third type of context model set.
在本申请一种可能的实现方式中,所述上下文模型是至少根据所述目标位置坐标信息的坐标值满足的线性关系式确定。In a possible implementation manner of the present application, the context model is determined at least according to the linear relationship that the coordinate value of the target position coordinate information satisfies.
在本申请一种可能的实现方式中,当所述目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c≤n1时,所述上下文模型是从第一类上下文模型集合中选择的;当所述目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c>n1时,所述上下文模型是从第二类上下文模型集合中选择的;其中,所述a、b和c为常数,所述SRx为所述第一坐标值,所述SRy为第二坐标值。In a possible implementation of the present application, when the coordinate value of the target position coordinate information satisfies the linear relationship a*SRx+b*SRy+c≤n1, the context model is from the first type of context Selected from the model set; when the coordinate value of the target position coordinate information satisfies the linear relationship a*SRx+b*SRy+c>n1, the context model is selected from the second type of context model set Wherein, the a, b, and c are constants, the SRx is the first coordinate value, and the SRy is the second coordinate value.
在本申请一种可能的实现方式中,当所述目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c≤n1时,所述上下文模型是从第一类上下文模型集合中选择的;当所述目标位置坐标信息的坐标值满足的线性关系式为n1<a*SRx+b*SRy+c≤n2时,所述上下文模型是从第二类上下文模型集合中选择的;当所述目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c>n2时,所述上下文模型是从第三类上下文模型集合中选择的;其中,所述a、b和c为常数,所述SRx为所述第一坐标值,所述SRy为第二坐标值。In a possible implementation of the present application, when the coordinate value of the target position coordinate information satisfies the linear relationship a*SRx+b*SRy+c≤n1, the context model is from the first type of context Selected from the model set; when the coordinate value of the target position coordinate information satisfies the linear relationship n1<a*SRx+b*SRy+c≤n2, the context model is from the second type of context model set Selected; when the linear relational expression satisfied by the coordinate value of the target position coordinate information is a*SRx+b*SRy+c>n2, the context model is selected from the third type of context model set; wherein, The a, b, and c are constants, the SRx is the first coordinate value, and the SRy is the second coordinate value.
在本申请一种可能的实现方式中,所述待解码标志位为第一标志位、第二标志位、第三标志位中的至少一个;所述第一标志位用于指示变换系数是否是非零;所述第二标志位用于指示变换系数的绝对值是否大于1;所述第三标志位用于指示变换系数的绝对值是否大于2。In a possible implementation of this application, the flag to be decoded is at least one of a first flag, a second flag, and a third flag; the first flag is used to indicate whether the transform coefficient is non- Zero; the second flag bit is used to indicate whether the absolute value of the transform coefficient is greater than 1; the third flag bit is used to indicate whether the absolute value of the transform coefficient is greater than 2.
在本申请一种可能的实现方式中,所述上下文模型是至少根据所述目标位置坐标信息和所述待解码系数所在位置的坐标值确定。In a possible implementation manner of the present application, the context model is determined at least according to the coordinate information of the target location and the coordinate value of the location where the coefficient to be decoded is located.
在本申请一种可能的实现方式中,根据所述目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集;In a possible implementation manner of the present application, according to the target position coordinate information of the target scanning area, one type of context model set is selected from multiple types of context model sets, and each type of context model set includes multiple context model subsets;
根据所述待解码系数所在位置的坐标值,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,所述上下文模型是从选择的一个上下文模型子集中确定的。According to the coordinate value of the position of the coefficient to be decoded, a context model subset is selected from a plurality of context model subsets included in the selected one type of context model set, and the context model is determined from the selected context model subset .
在本申请一种可能的实现方式中,所述上下文模型是至少根据所述目标位置坐标信息和所述待解码系数所在位置的坐标值满足的线性关系式确定。In a possible implementation manner of the present application, the context model is determined at least according to a linear relationship that is satisfied by the target position coordinate information and the coordinate value of the position where the coefficient to be decoded is located.
在本申请一种可能的实现方式中,所述模型确定模块1130用于:根据所述目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集;根据所述待解码系数所在位置的坐标值满足的线性关系式,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,所述上下文模型是从选择的一个上下文模型子集中确定的。In a possible implementation of the present application, the model determination module 1130 is configured to: select a set of context models from a set of multiple types of context models according to the target position coordinate information of the target scan area, and each type of context model The set includes multiple context model subsets; according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, a context model subset is selected from the multiple context model subsets included in the selected context model set, so The context model is determined from a selected subset of context models.
在本申请一种可能的实现方式中,当所述待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x≤c时,所述上下文模型是从第一上下文模型子集中选择的;当所述待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x>c时,所述上下文模型是从第二上下文模型子集中选择的; 其中,所述a和b为常数,所述pos_x为所述待解码系数所在位置的横坐标值,所述pos_y为所述待解码系数所在位置的纵坐标值。In a possible implementation of the present application, when the linear relationship that the coordinate value of the position where the coefficient to be decoded satisfies is a*pos_y+b*pos_x≤c, the context model is derived from the first context model Centrally selected; when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x>c, the context model is selected from the second context model subset; where, The a and b are constants, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the ordinate value of the position of the coefficient to be decoded.
在本申请一种可能的实现方式中,所述a为所述第一坐标值,所述b为所述第二坐标值,所述第一数值为所述第一坐标值与所述第二坐标值之间的乘积。In a possible implementation manner of this application, said a is the first coordinate value, said b is the second coordinate value, and the first value is the first coordinate value and the second coordinate value. The product of coordinate values.
在本申请一种可能的实现方式中,当所述待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x≤c1时,所述上下文模型是从第一上下文模型子集中选择的;当所述待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x>c1,且a2*pos_y+b2*pos_x<c2时,所述上下文模型是从第二上下文模型子集中选择的;当所述待解码系数所在位置的坐标值满足的线性关系式为a2*pos_y+b2*pos_x≥c2时,所述上下文模型是从第三上下文模型子集中选择的;其中,所述a1、b1、a2、b2、c1和c2为常数,所述c1小于所述c2,所述pos_x为所述待解码系数所在位置的横坐标值,所述pos_y为所述待解码系数所在位置的纵坐标值。In a possible implementation of the present application, when the linear relationship that the coordinate value of the position where the coefficient to be decoded satisfies is a1*pos_y+b1*pos_x≤c1, the context model is derived from the first context model Centralized selection; when the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a1*pos_y+b1*pos_x>c1, and a2*pos_y+b2*pos_x<c2, the context model is from The second context model is selected from the subset; when the coordinate value of the position where the coefficient to be decoded satisfies the linear relationship a2*pos_y+b2*pos_x≥c2, the context model is selected from the third context model subset Wherein, the a1, b1, a2, b2, c1, and c2 are constants, the c1 is less than the c2, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the to be decoded The ordinate value of the position of the decoding coefficient.
在本申请一种可能的实现方式中,所述a1和a2均为所述第一坐标值,所述b1和b2均为所述第二坐标值,所述c1为所述第一坐标值和所述第二坐标值之间的乘积的一半,所述c2为所述第一坐标值与所述第二坐标值之间的乘积。In a possible implementation of the present application, the a1 and a2 are both the first coordinate value, the b1 and b2 are both the second coordinate value, and the c1 is the first coordinate value and Half of the product between the second coordinate values, and the c2 is the product between the first coordinate value and the second coordinate value.
在本申请一种可能的实现方式中,所述上下文模型是至少根据所述目标位置坐标信息、所述待解码系数所在位置的坐标值和所述待解码系数所在位置的坐标值满足的线性关系式确定。In a possible implementation manner of the present application, the context model is based on at least a linear relationship satisfied by the target position coordinate information, the coordinate value of the position where the coefficient to be decoded is located, and the coordinate value of the position where the coefficient to be decoded is located. The formula is determined.
在本申请一种可能的实现方式中,所述模型确定模块1130用于:根据所述目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集;根据所述待解码系数所在位置的坐标值满足的线性关系式、所述待解码系数所在位置的坐标值和所述目标位置坐标信息,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,所述上下文模型是从选择的一个上下文模型子集中确定的。In a possible implementation of the present application, the model determination module 1130 is configured to: select a set of context models from a set of multiple types of context models according to the target position coordinate information of the target scan area, and each type of context model The set includes a plurality of context model subsets; according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the target position coordinate information, select a type of context A context model subset is selected from a plurality of context model subsets included in the model set, and the context model is determined from the selected context model subset.
在本申请一种可能的实现方式中,所述上下文模型是至少根据所述目标位置坐标信息和所述当前块满足的预设条件确定。In a possible implementation manner of the present application, the context model is determined at least according to the target position coordinate information and the preset condition satisfied by the current block.
在本申请一种可能的实现方式中,所述模型确定模块1130还用于:根据所述目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集;根据所述当前块 满足的预设条件确定选择方式,根据所确定的选择方式,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,所述上下文模型是从选择的一个上下文模型子集中确定的。In a possible implementation of the present application, the model determination module 1130 is further configured to: select a set of context models from a set of multiple types of context models according to the target position coordinate information of the target scan area, and each type of context The model set includes multiple context model subsets; the selection method is determined according to the preset conditions satisfied by the current block, and a context is selected from the multiple context model subsets included in the selected context model set according to the determined selection method A subset of models, and the context model is determined from a selected subset of context models.
在本申请一种可能的实现方式中,所述模型确定模块1130用于:根据所述目标扫描区域的目标位置坐标信息,确定所述目标扫描区域的面积,根据所述面积,从多类上下文模型集合中选择一类上下文模型集合;或者,根据所述目标扫描区域的目标位置坐标信息,确定所述目标扫描区域的尺寸,根据所述尺寸,从多类上下文模型集合中选择一类上下文模型集合;或者,根据所述目标扫描区域的目标位置坐标信息,确定所述目标扫描区域的短边,根据所述短边,从多类上下文模型集合中选择一类上下文模型集合;或者,根据所述目标扫描区域的目标位置坐标信息,确定所述目标位置坐标信息的坐标值满足的线性关系式,根据所述线性关系式,从多类上下文模型集合中选择一类上下文模型集合。In a possible implementation of the present application, the model determination module 1130 is configured to determine the area of the target scanning area according to the target position coordinate information of the target scanning area, and according to the area, from multiple types of contexts Select a type of context model set from the model set; or, determine the size of the target scan area according to the target position coordinate information of the target scan area, and select a type of context model from a set of multiple types of context models according to the size Or, determine the short side of the target scan area according to the target position coordinate information of the target scan area, and select a type of context model set from a set of multiple types of context models according to the short side; or, according to all According to the target position coordinate information of the target scanning area, a linear relationship expression satisfied by the coordinate value of the target position coordinate information is determined, and a type of context model set is selected from a plurality of types of context model sets according to the linear relationship expression.
在本申请实施例中,获取当前块的码流,当确定当前块采用SRCC时,从码流中获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待解码系数的待解码标志位的上下文模型,根据该上下文模型,对待解码标志位进行解码。也即是,根据目标扫描区域确定待解码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了解码性能。In this embodiment of the application, the code stream of the current block is obtained. When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position The coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and the to-be-decoded flag is decoded according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
作为一种示例,本申请实施例还提供一种解码装置,该装置可以包括:As an example, an embodiment of the present application further provides a decoding device, which may include:
码流获取模块,用于获取当前块的码流;The code stream acquisition module is used to obtain the code stream of the current block;
信息获取模块,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information consists of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient of the current block. Among the non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
模型确定模块,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定;The model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The context model is determined from at least three types of context model sets according to at least the coordinate values of the positions where the coefficients to be decoded are located;
解码模块,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module is configured to decode the to-be-decoded flag bit according to the context model.
在本申请一种可能的实现方式中,根据所述目标位置坐标信息确定第一目标位置的坐标值,所述上下文模型是至少根据所述待解码系数所在位置的坐标值和所述第一目标位置的坐标值确定,所述第一目标位置位于所述目标扫描区域内且排除所述目标位置坐标信息指示的目标位置。In a possible implementation manner of the present application, the coordinate value of the first target position is determined according to the target position coordinate information, and the context model is based on at least the coordinate value of the position where the coefficient to be decoded is located and the first target The coordinate value of the position is determined, the first target position is located in the target scanning area and the target position indicated by the target position coordinate information is excluded.
在本申请一种可能的实现方式中,当所述待解码系数所在位置的横坐标值小于等于所述第一目标位置的横坐标值,且所述待解码系数所在位置的纵坐标值小于等于所述第一目标位置的纵坐标值时,所述上下文模型是从第一类上下文模型集合中选择的;当所述待解码系数所在位置的横坐标值大于所述第一目标位置的横坐标值,且所述待解码系数所在位置的纵坐标值大于所述第一目标位置的纵坐标值时,所述上下文模型是从第三类上下文模型集合中选择的;否则,所述上下文模型是从第二类上下文模型集合中选择的。In a possible implementation of the present application, when the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the first target position, and the ordinate value of the position where the coefficient to be decoded is less than or equal to When the ordinate value of the first target position, the context model is selected from the first type of context model set; when the abscissa value of the position where the coefficient to be decoded is located is greater than the abscissa value of the first target position Value, and the ordinate value of the position where the coefficient to be decoded is located is greater than the ordinate value of the first target position, the context model is selected from the third type of context model set; otherwise, the context model is Selected from the second type of context model collection.
在本申请一种可能的实现方式中,根据所述目标位置坐标信息确定第二目标位置和第三目标位置的坐标值,所述上下文模型至少是根据所述待解码系数所在位置的坐标值、所述第二目标位置和所述第三目标位置的坐标值确定。In a possible implementation manner of the present application, the coordinate values of the second target position and the third target position are determined according to the target position coordinate information, and the context model is at least based on the coordinate values of the positions where the coefficients to be decoded are located, The coordinate values of the second target position and the third target position are determined.
在本申请一种可能的实现方式中,当所述待解码系数所在位置的横坐标值小于等于所述第二目标位置的横坐标值,且所述待解码系数所在位置的纵坐标值小于等于所述第二目标位置的纵坐标值时,所述上下文模型是从第一类上下文模型集合中选择的;当所述待解码系数所在位置的横坐标值大于所述第三目标位置的横坐标值,且所述待解码系数所在位置的纵坐标值大于所述第三目标位置的纵坐标值时,所述上下文模型是从第三类上下文模型集合中选择的;否则,所述上下文模型是从第二类上下文模型集合中选择的。In a possible implementation of the present application, when the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the second target position, and the ordinate value of the position where the coefficient to be decoded is less than or equal to When the ordinate value of the second target position, the context model is selected from the first type of context model set; when the abscissa value of the position where the coefficient to be decoded is located is greater than the abscissa value of the third target position Value, and the ordinate value of the position where the coefficient to be decoded is greater than the ordinate value of the third target position, the context model is selected from the third type of context model set; otherwise, the context model is Selected from the second type of context model collection.
在本申请实施例中,获取当前块的码流,当确定当前块采用SRCC时,从码流中获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待解码系数的待解码标志位的上下文模型,根据该上下文模型,对待解码标志位进行解码。也即是,根据目标扫描区域确定待解码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了解码性能。In this embodiment of the application, the code stream of the current block is obtained. When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position The coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and the to-be-decoded flag is decoded according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
作为一种示例,本申请实施例还提供一种解码装置,该装置可以包括:As an example, an embodiment of the present application further provides a decoding device, which may include:
码流获取模块,用于获取当前块的码流;The code stream acquisition module is used to obtain the code stream of the current block;
信息获取模块,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information consists of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient of the current block. Among the non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
模型确定模块,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;The model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The scanning area of the, the context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
解码模块,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module is configured to decode the to-be-decoded flag bit according to the context model.
在本申请一种可能的实现方式中,当所述待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x≤c时,所述上下文模型是从第一类上下文模型集合中选择的;当所述待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x>c时,所述上下文模型是从第二类上下文模型集合中选择的;其中,所述a和b为常数,所述pos_x为所述待解码系数所在位置的横坐标值,所述pos_y为所述待解码系数所在位置的纵坐标值。In a possible implementation of the present application, when the linear relationship that the coordinate value of the position where the coefficient to be decoded satisfies is a*pos_y+b*pos_x≤c, the context model is from the first type of context model Selected from the set; when the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a*pos_y+b*pos_x>c, the context model is selected from the second type of context model set; wherein The a and b are constants, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the ordinate value of the position of the coefficient to be decoded.
在本申请一种可能的实现方式中,所述a为所述第一坐标值,所述b为所述第二坐标值,所述第一数值为所述第一坐标值与所述第二坐标值之间的乘积。In a possible implementation manner of this application, said a is the first coordinate value, said b is the second coordinate value, and the first value is the first coordinate value and the second coordinate value. The product of coordinate values.
在本申请一种可能的实现方式中,当所述待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x≤c1时,所述上下文模型是从第一类上下文模型集合中选择的;当所述待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x>c1,且a2*pos_y+b2*pos_x<c2时,所述上下文模型是从第二类上下文模型集合中选择的;当所述待解码系数所在位置的坐标值满足的线性关系式为a2*pos_y+b2*pos_x≥c2时,所述上下文模型是从第三类上下文模型集合中选择的;其中,所述a1、b1、a2、b2、c1和c2为常数,所述c1小于所述c2,所述pos_x为所述待解码系数所在位置的横坐标值,所述pos_y为所述待解码系数所在位置的纵坐标值。In a possible implementation of the present application, when the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a1*pos_y+b1*pos_x≤c1, the context model is from the first type of context model Selected from the set; when the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a1*pos_y+b1*pos_x>c1, and a2*pos_y+b2*pos_x<c2, the context model is from Selected from the second type of context model set; when the coordinate value of the position where the coefficient to be decoded satisfies the linear relationship a2*pos_y+b2*pos_x≥c2, the context model is from the third type of context model set Where the a1, b1, a2, b2, c1, and c2 are constants, the c1 is less than the c2, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is The ordinate value of the position where the coefficient to be decoded is located.
在本申请一种可能的实现方式中,所述a1和a2均为所述第一坐标值,所述b1和b2均为所述第二坐标值,所述c1为所述第一坐标值和所述第二坐标值之间的乘积的一半,所述c2为所述第一坐标值与所述第二坐标值之间的乘积。In a possible implementation of the present application, the a1 and a2 are both the first coordinate value, the b1 and b2 are both the second coordinate value, and the c1 is the first coordinate value and Half of the product between the second coordinate values, and the c2 is the product between the first coordinate value and the second coordinate value.
在本申请一种可能的实现方式中,所述上下文模型是至少根据所述待解码 系数所在位置的坐标值满足的线性关系式、所述待解码系数所在位置的坐标值和所述目标位置坐标信息确定。In a possible implementation of the present application, the context model is based on at least a linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the coordinates of the target position. The information is OK.
在本申请一种可能的实现方式中,当所述待解码系数所在位置的横坐标值小于等于第一阈值,且所述待解码系数所在位置的纵坐标值小于等于第二阈值时,所述上下文模型是从第一类上下文模型集合中选择的;否则,当所述待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x>c时,所述上下文模型是从第三类上下文模型集合中选择的;否则,所述上下文模型是从第二类上下文模型集合中选择的;其中,所述第一阈值小于第一坐标值,所述第二阈值小于所述第二坐标值。In a possible implementation manner of the present application, when the abscissa value of the position where the coefficient to be decoded is less than or equal to the first threshold, and the ordinate value of the position where the coefficient to be decoded is less than or equal to the second threshold value, the The context model is selected from the first type of context model set; otherwise, when the coordinate value of the position where the coefficient to be decoded satisfies the linear relationship a*pos_y+b*pos_x>c, the context model is from The third type of context model set is selected; otherwise, the context model is selected from the second type of context model set; wherein, the first threshold is less than the first coordinate value, and the second threshold is less than the first Two coordinate values.
在本申请实施例中,获取当前块的码流,当确定当前块采用SRCC时,从码流中获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待解码系数的待解码标志位的上下文模型,根据该上下文模型,对待解码标志位进行解码。也即是,根据目标扫描区域确定待解码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了解码性能。In this embodiment of the application, the code stream of the current block is obtained. When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position The coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and the to-be-decoded flag is decoded according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
作为一种示例,本申请实施例还提供一种解码装置,该装置可以包括:As an example, an embodiment of the present application further provides a decoding device, which may include:
码流获取模块,用于获取当前块的码流;The code stream acquisition module is used to obtain the code stream of the current block;
信息获取模块,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information consists of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient of the current block. Among the non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
模型确定模块,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少基于所述当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的;The model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The context model is determined according to the determined selection method after determining a selection method at least based on a preset condition satisfied by the current block;
解码模块,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module is configured to decode the to-be-decoded flag bit according to the context model.
在本申请一种可能的实现方式中,根据所述待解码系数所在位置的坐标值满足的线性关系式进行选择;或者,根据所述待解码系数所在位置的坐标值与所述目标位置坐标信息进行选择。In a possible implementation manner of the present application, the selection is made according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located; or, according to the coordinate value of the position where the coefficient to be decoded is located and the target position coordinate information Make a selection.
在本申请一种可能的实现方式中,当所述当前块满足预设条件时,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;当所述当前块不满足所述预设条件时,所述上下文模型是至少根据所述待解码系数所在位置的坐标值与所述目标位置坐标信息确定。In a possible implementation of the present application, when the current block satisfies a preset condition, the context model is determined at least according to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded; when the current block When the block does not satisfy the preset condition, the context model is determined at least according to the coordinate value of the position where the coefficient to be decoded is located and the target position coordinate information.
在本申请一种可能的实现方式中,所述预设条件包括如下条件中的一种:所述第一坐标值或所述第二坐标值为零;所述第一坐标值和所述第二坐标值的乘积小于第一坐标阈值;所述第一坐标值大于等于第二坐标阈值且所述第二坐标值大于等于第三坐标阈值;所述第一坐标值小于等于第二坐标阈值或所述第二坐标值小于第三坐标阈值。In a possible implementation manner of the present application, the preset condition includes one of the following conditions: the first coordinate value or the second coordinate value is zero; the first coordinate value and the first coordinate value The product of the two coordinate values is less than the first coordinate threshold; the first coordinate value is greater than or equal to the second coordinate threshold and the second coordinate value is greater than or equal to the third coordinate threshold; the first coordinate value is less than or equal to the second coordinate threshold or The second coordinate value is less than the third coordinate threshold.
在本申请实施例中,获取当前块的码流,当确定当前块采用SRCC时,从码流中获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待解码系数的待解码标志位的上下文模型,根据该上下文模型,对待解码标志位进行解码。也即是,根据目标扫描区域确定待解码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了解码性能。In this embodiment of the application, the code stream of the current block is obtained. When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream, and the target scanning area of the current block is determined based on the target position coordinate information, at least according to the target position The coordinate information determines the context model of the to-be-decoded flag of the coefficient to be decoded, and the to-be-decoded flag is decoded according to the context model. That is, the context model of the flag to be decoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the decoding performance is improved.
需要说明的是:上述实施例提供的解码装置在实现解码方法时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的解码装置与解码方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that when the decoding device provided in the above embodiment implements the decoding method, only the division of the above functional modules is used as an example for illustration. In actual applications, the above functions can be allocated by different functional modules according to needs, i.e. The internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the decoding device provided in the foregoing embodiment and the decoding method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
请参考图12,图12是本申请实施例提供的一种编码装置的结构示意图,该装置可以包括:Please refer to FIG. 12, which is a schematic structural diagram of an encoding device provided by an embodiment of the present application. The device may include:
获取模块1210,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The obtaining module 1210 is configured to obtain target position coordinate information when the current block adopts the scanning area-based coefficient coding SRCC, the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the absolute value of the ordinate of the non-zero coefficient included in the transformation coefficient of the current block The ordinate of the largest non-zero coefficient;
确定模块1220,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所 述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述目标位置坐标信息确定;The determining module 1220 is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The scanning area of the, the context model is determined according to at least the target position coordinate information;
编码模块1230,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module 1230 is configured to encode the flag bit to be encoded according to the context model.
在本申请实施例中,当当前块采用SRCC时,获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待编码系数的待编码标志位的上下文模型,根据该上下文模型,对待编码标志位进行编码。也即是,根据目标扫描区域确定待编码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了编码性能。In the embodiment of the present application, when the current block adopts SRCC, the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information According to the context model of the context model, the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
作为一种示例,本申请实施例还提供一种编码装置,该装置可以包括:As an example, an embodiment of the present application further provides an encoding device, which may include:
获取模块,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
确定模块,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定;The determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined from at least three types of context model sets according to at least the coordinate value of the position where the coefficient to be decoded is located;
编码模块,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module is used to encode the to-be-encoded flag bit according to the context model.
在本申请实施例中,当当前块采用SRCC时,获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待编码系数的待编码标志位的上下文模型,根据该上下文模型,对待编码标志位进行编码。也即是,根据目标扫描区域确定待编码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了编码性能。In the embodiment of the present application, when the current block adopts SRCC, the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information According to the context model of the context model, the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
作为一种示例,本申请实施例还提供一种编码装置,该装置可以包括:As an example, an embodiment of the present application further provides an encoding device, which may include:
获取模块,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数 中纵坐标绝对值最大的非零系数的纵坐标;The acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
确定模块,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;The determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined at least according to a linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
编码模块,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module is used to encode the to-be-encoded flag bit according to the context model.
在本申请实施例中,当当前块采用SRCC时,获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待编码系数的待编码标志位的上下文模型,根据该上下文模型,对待编码标志位进行编码。也即是,根据目标扫描区域确定待编码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了编码性能。In the embodiment of the present application, when the current block adopts SRCC, the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information According to the context model of the context model, the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
作为一种示例,本申请实施例还提供一种编码装置,该装置可以包括:As an example, an embodiment of the present application further provides an encoding device, which may include:
获取模块,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
确定模块,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少基于所述当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的;The determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined according to the determined selection method after a selection method is determined at least based on a preset condition satisfied by the current block;
编码模块,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module is used to encode the to-be-encoded flag bit according to the context model.
在本申请实施例中,当当前块采用SRCC时,获取目标位置坐标信息,基于目标位置坐标信息确定当前块的目标扫描区域,至少根据该目标位置坐标信息确定该待编码系数的待编码标志位的上下文模型,根据该上下文模型,对待编码标志位进行编码。也即是,根据目标扫描区域确定待编码标志位的上下文模型,使得该种分组方式与SRCC技术的扫描方式匹配,提高了编码性能。In the embodiment of the present application, when the current block adopts SRCC, the target position coordinate information is acquired, the target scanning area of the current block is determined based on the target position coordinate information, and the to-be-encoded flag of the coefficient to be encoded is determined at least according to the target position coordinate information According to the context model of the context model, the to-be-coded flag is coded. That is, the context model of the flag to be encoded is determined according to the target scanning area, so that this grouping method matches the scanning method of the SRCC technology, and the encoding performance is improved.
需要说明的是:上述实施例提供的编码装置在实现编码方法时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分 配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的编码装置与编码方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that when the encoding device provided in the above embodiment implements the encoding method, only the division of the above functional modules is used as an example for illustration. In actual applications, the above functions can be allocated by different functional modules according to needs, i.e. The internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the encoding device provided in the foregoing embodiment and the encoding method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
图13是本申请实施例提供的一种电子设备1300的结构框图。该电子设备可以用于编码,也可以用于解码。该电子设备1300可以是便携式移动终端,比如:智能手机、平板电脑、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、笔记本电脑或台式电脑。电子设备1300还可能被称为用户设备、便携式终端、膝上型终端、台式终端等其他名称。FIG. 13 is a structural block diagram of an electronic device 1300 provided by an embodiment of the present application. The electronic device can be used for encoding and decoding. The electronic device 1300 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image expert compression standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, The dynamic image expert compresses the standard audio level 4) Player, laptop or desktop computer. The electronic device 1300 may also be called user equipment, portable terminal, laptop terminal, desktop terminal and other names.
通常,电子设备1300包括有:处理器1301和存储器1302。Generally, the electronic device 1300 includes a processor 1301 and a memory 1302.
处理器1301可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器1301可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器1301也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器1301可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器1301还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。The processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 1301 may adopt at least one hardware form among DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array, Programmable Logic Array). achieve. The processor 1301 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the awake state, also called a CPU (Central Processing Unit, central processing unit); the coprocessor is A low-power processor used to process data in the standby state. In some embodiments, the processor 1301 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing content that needs to be displayed on the display screen. In some embodiments, the processor 1301 may further include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
存储器1302可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器1302还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器1302中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器1301所执行以实现本申请中方法实施例提供的解码方法、编码方法。The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 1301 to implement the decoding method provided in the method embodiment of the present application , Coding method.
在一些实施例中,电子设备1300还可选包括有:外围设备接口1303和至少一个外围设备。处理器1301、存储器1302和外围设备接口1303之间可以通 过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口1303相连。具体地,外围设备包括:射频电路1304、触摸显示屏1305、摄像头1306、音频电路1307、定位组件1308和电源1309中的至少一种。In some embodiments, the electronic device 1300 may optionally further include: a peripheral device interface 1303 and at least one peripheral device. The processor 1301, the memory 1302, and the peripheral device interface 1303 may be connected by a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 1303 through a bus, a signal line, or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1304, a touch display screen 1305, a camera 1306, an audio circuit 1307, a positioning component 1308, and a power supply 1309.
外围设备接口1303可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器1301和存储器1302。在一些实施例中,处理器1301、存储器1302和外围设备接口1303被集成在同一芯片或电路板上;在一些其他实施例中,处理器1301、存储器1302和外围设备接口1303中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。The peripheral device interface 1303 can be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 1301 and the memory 1302. In some embodiments, the processor 1301, the memory 1302, and the peripheral device interface 1303 are integrated on the same chip or circuit board; in some other embodiments, any one of the processor 1301, the memory 1302, and the peripheral device interface 1303 or The two can be implemented on a separate chip or circuit board, which is not limited in this embodiment.
射频电路1304用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路1304通过电磁信号与通信网络以及其他通信设备进行通信。射频电路1304将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路1304包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路1304可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:万维网、城域网、内联网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路1304还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本申请对此不加以限定。The radio frequency circuit 1304 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals. The radio frequency circuit 1304 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 1304 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 1304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and so on. The radio frequency circuit 1304 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: World Wide Web, Metropolitan Area Network, Intranet, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area network and/or WiFi (Wireless Fidelity, wireless fidelity) network. In some embodiments, the radio frequency circuit 1304 may also include a circuit related to NFC (Near Field Communication), which is not limited in this application.
显示屏1305用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏1305是触摸显示屏时,显示屏1305还具有采集在显示屏1305的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器1301进行处理。此时,显示屏1305还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏1305可以为一个,设置电子设备1300的前面板;在另一些实施例中,显示屏1305可以为至少两个,分别设置在电子设备1300的不同表面或呈折叠设计;在再一些实施例中,显示屏1305可以是柔性显示屏,设置在电子设备1300的弯曲表面上或折叠面上。甚至,显示屏1305还可以设置成非矩形的不规则图形,也即异形屏。显示屏1305可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。The display screen 1305 is used to display UI (User Interface). The UI can include graphics, text, icons, videos, and any combination thereof. When the display screen 1305 is a touch display screen, the display screen 1305 also has the ability to collect touch signals on or above the surface of the display screen 1305. The touch signal may be input to the processor 1301 as a control signal for processing. At this time, the display screen 1305 may also be used to provide virtual buttons and/or virtual keyboards, also called soft buttons and/or soft keyboards. In some embodiments, there may be one display screen 1305, which is provided with the front panel of the electronic device 1300; in other embodiments, there may be at least two display screens 1305, which are respectively arranged on different surfaces of the electronic device 1300 or in a folded design. In still other embodiments, the display screen 1305 may be a flexible display screen, which is arranged on the curved surface or the folding surface of the electronic device 1300. Even the display screen 1305 can also be set as a non-rectangular irregular pattern, that is, a special-shaped screen. The display screen 1305 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
摄像头组件1306用于采集图像或视频。可选地,摄像头组件1306包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端的前面板,后置摄像头 设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件1306还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。The camera assembly 1306 is used to capture images or videos. Optionally, the camera assembly 1306 includes a front camera and a rear camera. Generally, the front camera is set on the front panel of the terminal, and the rear camera is set on the back of the terminal. In some embodiments, there are at least two rear cameras, each of which is a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth-of-field camera to realize the background blur function, the main camera Integrate with the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, the camera assembly 1306 may also include a flashlight. The flash can be a single-color flash or a dual-color flash. Dual color temperature flash refers to a combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.
音频电路1307可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器1301进行处理,或者输入至射频电路1304以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在电子设备1300的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器1301或射频电路1304的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路1307还可以包括耳机插孔。The audio circuit 1307 may include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals and input them to the processor 1301 for processing, or input to the radio frequency circuit 1304 to implement voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively arranged in different parts of the electronic device 1300. The microphone can also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signal from the processor 1301 or the radio frequency circuit 1304 into sound waves. The speaker can be a traditional thin-film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into human audible sound waves, but also convert the electrical signal into human inaudible sound waves for distance measurement and other purposes. In some embodiments, the audio circuit 1307 may also include a headphone jack.
定位组件1308用于定位电子设备1300的当前地理位置,以实现导航或LBS(Location Based Service,基于位置的服务)。定位组件1308可以是基于美国的GPS(Global Positioning System,全球定位系统)、中国的北斗系统或俄罗斯的伽利略系统的定位组件。The positioning component 1308 is used to locate the current geographic location of the electronic device 1300 to implement navigation or LBS (Location Based Service, location-based service). The positioning component 1308 may be a positioning component based on the GPS (Global Positioning System, Global Positioning System) of the United States, the Beidou system of China, or the Galileo system of Russia.
电源1309用于为电子设备1300中的各个组件进行供电。电源1309可以是交流电、直流电、一次性电池或可充电电池。当电源1309包括可充电电池时,该可充电电池可以是有线充电电池或无线充电电池。有线充电电池是通过有线线路充电的电池,无线充电电池是通过无线线圈充电的电池。该可充电电池还可以用于支持快充技术。The power supply 1309 is used to supply power to various components in the electronic device 1300. The power supply 1309 may be alternating current, direct current, disposable batteries, or rechargeable batteries. When the power source 1309 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
在一些实施例中,电子设备1300还包括有一个或多个传感器1310。该一个或多个传感器1310包括但不限于:加速度传感器1311、陀螺仪传感器1312、压力传感器1313、指纹传感器1314、光学传感器1315以及接近传感器1316。In some embodiments, the electronic device 1300 further includes one or more sensors 1310. The one or more sensors 1310 include, but are not limited to: an acceleration sensor 1311, a gyroscope sensor 1312, a pressure sensor 1313, a fingerprint sensor 1314, an optical sensor 1315, and a proximity sensor 1316.
加速度传感器1311可以检测以电子设备1300建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器1311可以用于检测重力加速度在三个坐标轴上的分量。处理器1301可以根据加速度传感器1311采集的重力加速度信 号,控制触摸显示屏1305以横向视图或纵向视图进行用户界面的显示。加速度传感器1311还可以用于游戏或者用户的运动数据的采集。The acceleration sensor 1311 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the electronic device 1300. For example, the acceleration sensor 1311 can be used to detect the components of gravitational acceleration on three coordinate axes. The processor 1301 can control the touch screen 1305 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 1311. The acceleration sensor 1311 may also be used for the collection of game or user motion data.
陀螺仪传感器1312可以检测电子设备1300的机体方向及转动角度,陀螺仪传感器1312可以与加速度传感器1311协同采集用户对电子设备1300的3D动作。处理器1301根据陀螺仪传感器1312采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。The gyroscope sensor 1312 can detect the body direction and rotation angle of the electronic device 1300, and the gyroscope sensor 1312 can cooperate with the acceleration sensor 1311 to collect the user's 3D actions on the electronic device 1300. The processor 1301 can implement the following functions according to the data collected by the gyroscope sensor 1312: motion sensing (for example, changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
压力传感器1313可以设置在电子设备1300的侧边框和/或触摸显示屏1305的下层。当压力传感器1313设置在电子设备1300的侧边框时,可以检测用户对电子设备1300的握持信号,由处理器1301根据压力传感器1313采集的握持信号进行左右手识别或快捷操作。当压力传感器1313设置在触摸显示屏1305的下层时,由处理器1301根据用户对触摸显示屏1305的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。The pressure sensor 1313 may be disposed on the side frame of the electronic device 1300 and/or the lower layer of the touch display screen 1305. When the pressure sensor 1313 is arranged on the side frame of the electronic device 1300, the user's holding signal of the electronic device 1300 can be detected, and the processor 1301 performs left and right hand recognition or quick operation according to the holding signal collected by the pressure sensor 1313. When the pressure sensor 1313 is arranged on the lower layer of the touch display screen 1305, the processor 1301 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 1305. The operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
指纹传感器1314用于采集用户的指纹,由处理器1301根据指纹传感器1314采集到的指纹识别用户的身份,或者,由指纹传感器1314根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器1301授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器1314可以被设置电子设备1300的正面、背面或侧面。当电子设备1300上设置有物理按键或厂商Logo时,指纹传感器1314可以与物理按键或厂商Logo集成在一起。The fingerprint sensor 1314 is used to collect the user's fingerprint. The processor 1301 identifies the user's identity according to the fingerprint collected by the fingerprint sensor 1314, or the fingerprint sensor 1314 identifies the user's identity according to the collected fingerprint. When the user's identity is recognized as a trusted identity, the processor 1301 authorizes the user to perform related sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 1314 may be provided on the front, back or side of the electronic device 1300. When the electronic device 1300 is provided with a physical button or a manufacturer logo, the fingerprint sensor 1314 may be integrated with the physical button or the manufacturer logo.
光学传感器1315用于采集环境光强度。在一个实施例中,处理器1301可以根据光学传感器1315采集的环境光强度,控制触摸显示屏1305的显示亮度。具体地,当环境光强度较高时,调高触摸显示屏1305的显示亮度;当环境光强度较低时,调低触摸显示屏1305的显示亮度。在另一个实施例中,处理器1301还可以根据光学传感器1315采集的环境光强度,动态调整摄像头组件1306的拍摄参数。The optical sensor 1315 is used to collect the ambient light intensity. In an embodiment, the processor 1301 may control the display brightness of the touch screen 1305 according to the intensity of the ambient light collected by the optical sensor 1315. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 1305 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 1305 is decreased. In another embodiment, the processor 1301 may also dynamically adjust the shooting parameters of the camera assembly 1306 according to the ambient light intensity collected by the optical sensor 1315.
接近传感器1316,也称距离传感器,通常设置在电子设备1300的前面板。接近传感器1316用于采集用户与电子设备1300的正面之间的距离。在一个实施例中,当接近传感器1316检测到用户与电子设备1300的正面之间的距离逐渐变小时,由处理器1301控制触摸显示屏1305从亮屏状态切换为息屏状态; 当接近传感器1316检测到用户与电子设备1300的正面之间的距离逐渐变大时,由处理器1301控制触摸显示屏1305从息屏状态切换为亮屏状态。The proximity sensor 1316, also called a distance sensor, is usually arranged on the front panel of the electronic device 1300. The proximity sensor 1316 is used to collect the distance between the user and the front of the electronic device 1300. In one embodiment, when the proximity sensor 1316 detects that the distance between the user and the front of the electronic device 1300 gradually decreases, the processor 1301 controls the touch screen 1305 to switch from the on-screen state to the off-screen state; when the proximity sensor 1316 When it is detected that the distance between the user and the front of the electronic device 1300 is gradually increasing, the processor 1301 controls the touch display screen 1305 to switch from the on-screen state to the on-screen state.
本领域技术人员可以理解,图13中示出的结构并不构成对电子设备1300的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。Those skilled in the art can understand that the structure shown in FIG. 13 does not constitute a limitation on the electronic device 1300, and may include more or fewer components than shown, or combine certain components, or adopt different component arrangements.
在一些实施例中,还提供了一种计算机可读存储介质,该存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述实施例中方法的步骤。例如,所述计算机可读存储介质可以是ROM(Read Only Memory,只读存储器)、RAM(Random Access Memory,随时存取存储器)、CD-ROM(Compact Disk-ROM,光盘只读存储器)、磁带、软盘和光数据存储设备等。In some embodiments, a computer-readable storage medium is also provided, the storage medium stores a computer program, and the computer program implements the steps of the method in the above-mentioned embodiments when the computer program is executed by a processor. For example, the computer-readable storage medium may be ROM (Read Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disk-ROM, optical disk read-only memory), magnetic tape , Floppy disks and optical data storage devices.
值得注意的是,本申请提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是非瞬时性存储介质。It should be noted that the computer-readable storage medium mentioned in this application may be a non-volatile storage medium, in other words, it may be a non-transitory storage medium.
应当理解的是,实现上述实施例的全部或部分步骤可以通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。所述计算机指令可以存储在上述计算机可读存储介质中。It should be understood that all or part of the steps for implementing the foregoing embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. The computer instructions may be stored in the aforementioned computer-readable storage medium.
也即是,在一些实施例中,还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述所述的解码方法、编码方法的步骤。That is, in some embodiments, a computer program product containing instructions is also provided, which when running on a computer, causes the computer to execute the steps of the decoding method and encoding method described above.
以上所述为本申请提供的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above-mentioned examples provided for this application are not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection scope of this application. Inside.

Claims (55)

  1. 一种解码方法,其特征在于,所述方法包括:A decoding method, characterized in that the method includes:
    获取当前块的码流;Get the code stream of the current block;
    当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When it is determined that the current block adopts SRCC coding based on the coefficient of the scanning area, the target position coordinate information is obtained from the code stream, and the target position coordinate information is composed of a first coordinate value and a second coordinate value. The coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the ordinate of the non-zero coefficient included in the transformation coefficient of the current block. The ordinate of the non-zero coefficient with the largest absolute value of the coordinate;
    针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述目标位置坐标信息确定;For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined at least according to the coordinate information of the target position;
    根据所述上下文模型,对所述待解码标志位进行解码。According to the context model, the to-be-decoded flag bit is decoded.
  2. 如权利要求1所述的方法,其特征在于,所述上下文模型是至少根据所述目标位置坐标信息确定,包括:The method according to claim 1, wherein the context model is determined according to at least the target location coordinate information, and comprises:
    所述上下文模型是至少根据所述目标扫描区域的面积确定,所述目标扫描区域的面积是根据所述目标位置坐标信息确定的。The context model is determined at least according to the area of the target scan area, and the area of the target scan area is determined according to the target position coordinate information.
  3. 如权利要求2所述的方法,其特征在于,The method of claim 2, wherein:
    当所述目标扫描区域的面积小于等于第一面积阈值时,所述上下文模型是从第一类上下模型集合中选择的;When the area of the target scanning area is less than or equal to the first area threshold, the context model is selected from the first type of upper and lower model set;
    当所述扫描区域的面积大于所述第一面积阈值时,所述上下文模型是从第二类上下模型集合中选择的。When the area of the scan area is greater than the first area threshold, the context model is selected from the second type of upper and lower model set.
  4. 如权利要求2所述的方法,其特征在于,The method of claim 2, wherein:
    当所述目标扫描区域的面积小于等于第一面积阈值时,所述上下文模型是从第一类上下文模型集合中选择的;When the area of the target scanning area is less than or equal to the first area threshold, the context model is selected from the first type of context model set;
    当所述目标扫描区域的面积大于所述第一面积阈值且小于等于第二面积阈值时,所述上下文模型是从第二类上下文模型集合中选择的;When the area of the target scanning area is greater than the first area threshold and less than or equal to the second area threshold, the context model is selected from the second type of context model set;
    当所述目标扫描区域的面积大于所述第二面积阈值时,所述上下文模型是从第三类上下文模型集合中选择的。When the area of the target scanning area is greater than the second area threshold, the context model is selected from a third type of context model set.
  5. 如权利要求1所述的方法,其特征在于,所述上下文模型是至少根据所述目标位置坐标信息确定,包括:The method according to claim 1, wherein the context model is determined according to at least the target location coordinate information, and comprises:
    所述上下文模型是至少根据所述目标扫描区域的尺寸确定,所述目标扫描区域的尺寸是根据所述目标位置坐标信息确定的。The context model is determined at least according to the size of the target scanning area, and the size of the target scanning area is determined according to the target position coordinate information.
  6. 如权利要求5所述的方法,其特征在于,The method of claim 5, wherein:
    当所述目标扫描区域的尺寸小于等于第一尺寸阈值时,所述上下文模型是从第一类上下模型集合中选择的;When the size of the target scanning area is less than or equal to the first size threshold, the context model is selected from the first type of upper and lower model set;
    当所述扫描区域的尺寸大于所述第一尺寸阈值时,所述上下文模型是从第二类上下模型集合中选择的。When the size of the scan area is greater than the first size threshold, the context model is selected from the second type of upper and lower model set.
  7. 如权利要求5所述的方法,其特征在于,The method of claim 5, wherein:
    当所述目标扫描区域的尺寸小于等于第一尺寸阈值时,所述上下文模型是从第一类上下文模型集合中选择的;When the size of the target scanning area is less than or equal to the first size threshold, the context model is selected from the first type of context model set;
    当所述目标扫描区域的尺寸大于所述第一尺寸阈值且小于等于第二尺寸阈值时,所述上下文模型是从第二类上下文模型集合中选择的;When the size of the target scanning area is greater than the first size threshold and less than or equal to the second size threshold, the context model is selected from the second type of context model set;
    当所述目标扫描区域的尺寸大于所述第二尺寸阈值时,所述上下文模型是从第三类上下文模型集合中选择的。When the size of the target scanning area is greater than the second size threshold, the context model is selected from a third type of context model set.
  8. 如权利要求1所述的方法,其特征在于,所述上下文模型是至少根据所述目标位置坐标信息确定,包括:The method according to claim 1, wherein the context model is determined according to at least the target location coordinate information, and comprises:
    所述上下文模型是至少根据所述目标扫描区域的短边确定,所述目标扫描区域的短边是根据所述目标位置坐标信息确定的。The context model is determined at least according to the short side of the target scanning area, and the short side of the target scanning area is determined according to the target position coordinate information.
  9. 如权利要求8所述的方法,其特征在于,The method of claim 8, wherein:
    当所述目标扫描区域的短边小于等于第一短边阈值时,所述上下文模型是从第一类上下模型集合中选择的;When the short side of the target scanning area is less than or equal to the first short side threshold, the context model is selected from the first type of upper and lower model set;
    当所述扫描区域的短边大于所述第一短边阈值时,所述上下文模型是从第二类上下模型集合中选择的。When the short side of the scan area is greater than the first short side threshold, the context model is selected from the second type of upper and lower model set.
  10. 如权利要求8所述的方法,其特征在于,The method of claim 8, wherein:
    当所述目标扫描区域的短边小于等于第一短边阈值时,所述上下文模型是从第一类上下文模型集合中选择的;When the short side of the target scanning area is less than or equal to the first short side threshold, the context model is selected from the first type of context model set;
    当所述目标扫描区域的短边大于所述第一短边阈值且小于等于第二短边阈值时,所述上下文模型是从第二类上下文模型集合中选择的;When the short side of the target scanning area is greater than the first short-side threshold and less than or equal to the second short-side threshold, the context model is selected from the second type of context model set;
    当所述目标扫描区域的短边大于所述第二短边阈值时,所述上下文模型是从第三类上下文模型集合中选择的。When the short side of the target scanning area is greater than the second short side threshold, the context model is selected from a third type of context model set.
  11. 如权利要求1所述的方法,其特征在于,所述上下文模型是至少根据所述目标位置坐标信息确定,包括:The method according to claim 1, wherein the context model is determined according to at least the target location coordinate information, and comprises:
    所述上下文模型是至少根据所述目标位置坐标信息的坐标值满足的线性关系式确定。The context model is determined at least according to the linear relational expression satisfied by the coordinate value of the target position coordinate information.
  12. 如权利要求11所述的方法,其特征在于,The method of claim 11, wherein:
    当所述目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c≤n1时,所述上下文模型是从第一类上下文模型集合中选择的;When the linear relational expression satisfied by the coordinate value of the target position coordinate information is a*SRx+b*SRy+c≤n1, the context model is selected from the first type of context model set;
    当所述目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c>n1时,所述上下文模型是从第二类上下文模型集合中选择的;When the linear relational expression satisfied by the coordinate value of the target position coordinate information is a*SRx+b*SRy+c>n1, the context model is selected from the second type of context model set;
    其中,所述a、b和c为常数,所述SRx为所述第一坐标值,所述SRy为第二坐标值。Wherein, the a, b, and c are constants, the SRx is the first coordinate value, and the SRy is the second coordinate value.
  13. 如权利要求11所述的方法,其特征在于,The method of claim 11, wherein:
    当所述目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c≤n1时,所述上下文模型是从第一类上下文模型集合中选择的;When the linear relational expression satisfied by the coordinate value of the target position coordinate information is a*SRx+b*SRy+c≤n1, the context model is selected from the first type of context model set;
    当所述目标位置坐标信息的坐标值满足的线性关系式为n1<a*SRx+b*SRy+c≤n2时,所述上下文模型是从第二类上下文模型集合中选择的;When the linear relational expression satisfied by the coordinate value of the target position coordinate information is n1<a*SRx+b*SRy+c≤n2, the context model is selected from the second type of context model set;
    当所述目标位置坐标信息的坐标值满足的线性关系式为a*SRx+b*SRy+c>n2时,所述上下文模型是从第三类上下文模型集合中选择的;When the linear relational expression satisfied by the coordinate value of the target position coordinate information is a*SRx+b*SRy+c>n2, the context model is selected from the third type of context model set;
    其中,所述a、b和c为常数,所述SRx为所述第一坐标值,所述SRy为第二坐标值。Wherein, the a, b, and c are constants, the SRx is the first coordinate value, and the SRy is the second coordinate value.
  14. 如权利要求1所述的方法,其特征在于,The method of claim 1, wherein:
    所述待解码标志位为第一标志位、第二标志位、第三标志位中的至少一个;所述第一标志位用于指示变换系数是否是非零;所述第二标志位用于指示变换系数的绝对值是否大于1;所述第三标志位用于指示变换系数的绝对值是否大于2。The flag to be decoded is at least one of a first flag, a second flag, and a third flag; the first flag is used to indicate whether the transform coefficient is non-zero; the second flag is used to indicate Whether the absolute value of the transform coefficient is greater than 1; the third flag bit is used to indicate whether the absolute value of the transform coefficient is greater than 2.
  15. 如权利要求1所述的方法,其特征在于,所述上下文模型是至少根据所述目标位置坐标信息确定,包括:The method according to claim 1, wherein the context model is determined according to at least the target location coordinate information, and comprises:
    所述上下文模型是至少根据所述目标位置坐标信息和所述待解码系数所在位置的坐标值确定。The context model is determined according to at least the target location coordinate information and the coordinate value of the location where the coefficient to be decoded is located.
  16. 如权利要求15所述的方法,其特征在于,所述上下文模型是至少根据所述目标位置坐标信息和所述待解码系数所在位置的坐标值确定的具体实现包括:The method according to claim 15, wherein the specific realization of the context model being determined at least according to the target position coordinate information and the coordinate value of the position where the coefficient to be decoded is located comprises:
    根据所述目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集;According to the target position coordinate information of the target scanning area, select a type of context model set from multiple types of context model sets, and each type of context model set includes a plurality of context model subsets;
    根据所述待解码系数所在位置的坐标值,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,所述上下文模型是从选择的一个上下文模型子集中确定的。According to the coordinate value of the position of the coefficient to be decoded, a context model subset is selected from a plurality of context model subsets included in the selected one type of context model set, and the context model is determined from the selected context model subset .
  17. 如权利要求1所述的方法,其特征在于,所述上下文模型是至少根据所述目标位置坐标信息确定,包括:The method according to claim 1, wherein the context model is determined according to at least the target location coordinate information, and comprises:
    所述上下文模型是至少根据所述目标位置坐标信息和所述待解码系数所在位置的坐标值满足的线性关系式确定。The context model is determined at least according to a linear relationship that is satisfied by the target position coordinate information and the coordinate value of the position where the coefficient to be decoded is located.
  18. 如权利要求17所述的方法,其特征在于,所述上下文模型是至少根据所述目标位置坐标信息和所述待解码系数所在位置的坐标值满足的线性关系式确定的具体实现包括:The method according to claim 17, wherein the context model is determined according to at least the linear relationship that the target position coordinate information and the coordinate value of the position where the coefficient to be decoded satisfies, and the specific realization comprises:
    根据所述目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集;According to the target position coordinate information of the target scanning area, select a type of context model set from multiple types of context model sets, and each type of context model set includes a plurality of context model subsets;
    根据所述待解码系数所在位置的坐标值满足的线性关系式,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,所述上下文模型是从选择的一个上下文模型子集中确定的。According to the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded, a context model subset is selected from a plurality of context model subsets included in the selected one type of context model set, and the context model is selected from a context model subset. The model subset is determined.
  19. 如权利要求18所述的方法,其特征在于,The method of claim 18, wherein:
    当所述待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x≤c时,所述上下文模型是从第一上下文模型子集中选择的;When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x≤c, the context model is selected from the first context model subset;
    当所述待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x>c时,所述上下文模型是从第二上下文模型子集中选择的;When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x>c, the context model is selected from the second context model subset;
    其中,所述a和b为常数,所述pos_x为所述待解码系数所在位置的横坐标值,所述pos_y为所述待解码系数所在位置的纵坐标值。Wherein, the a and b are constants, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the ordinate value of the position of the coefficient to be decoded.
  20. 如权利要求19所述的方法,其特征在于,所述a为所述第一坐标值,所述b为所述第二坐标值,所述第一数值为所述第一坐标值与所述第二坐标值之间的乘积。The method according to claim 19, wherein said a is said first coordinate value, said b is said second coordinate value, and said first value is said first coordinate value and said The product between the second coordinate values.
  21. 如权利要求18所述的方法,其特征在于,The method of claim 18, wherein:
    当所述待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x≤c1时,所述上下文模型是从第一上下文模型子集中选择的;When the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a1*pos_y+b1*pos_x≤c1, the context model is selected from the first context model subset;
    当所述待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x>c1,且a2*pos_y+b2*pos_x<c2时,所述上下文模型是从第二上下文模型子集中选择的;When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a1*pos_y+b1*pos_x>c1, and a2*pos_y+b2*pos_x<c2, the context model is derived from the second context model Centralized selection
    当所述待解码系数所在位置的坐标值满足的线性关系式为a2*pos_y+b2*pos_x≥c2时,所述上下文模型是从第三上下文模型子集中选择的;When the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a2*pos_y+b2*pos_x≥c2, the context model is selected from the third context model subset;
    其中,所述a1、b1、a2、b2、c1和c2为常数,所述c1小于所述c2,所述pos_x为所述待解码系数所在位置的横坐标值,所述pos_y为所述待解码系数所在位置的纵坐标值。Wherein, the a1, b1, a2, b2, c1, and c2 are constants, the c1 is less than the c2, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the to be decoded The ordinate value of the position of the coefficient.
  22. 如权利要求21所述的方法,其特征在于,所述a1和a2均为所述第一坐标值,所述b1和b2均为所述第二坐标值,所述c1为所述第一坐标值和所述第二坐标值之间的乘积的一半,所述c2为所述第一坐标值与所述第二坐标值之间的乘积。The method of claim 21, wherein the a1 and a2 are both the first coordinate value, the b1 and b2 are both the second coordinate value, and the c1 is the first coordinate value Half of the product between the value and the second coordinate value, and the c2 is the product between the first coordinate value and the second coordinate value.
  23. 如权利要求1所述的方法,其特征在于,所述上下文模型是至少根据所述目标位置坐标信息确定,包括:The method according to claim 1, wherein the context model is determined according to at least the target location coordinate information, and comprises:
    所述上下文模型是至少根据所述目标位置坐标信息、所述待解码系数所在位置的坐标值和所述待解码系数所在位置的坐标值满足的线性关系式确定。The context model is determined at least according to a linear relationship that satisfies the target position coordinate information, the coordinate value of the position of the coefficient to be decoded, and the coordinate value of the position of the coefficient to be decoded.
  24. 如权利要求23所述的方法,其特征在于,所述上下文模型是至少根据所述目标位置坐标信息、所述待解码系数所在位置的坐标值和所述待解码系数所在位置的坐标值满足的线性关系式确定的具体实现包括:The method according to claim 23, wherein the context model is satisfied according to at least the target position coordinate information, the coordinate value of the position of the coefficient to be decoded, and the coordinate value of the position of the coefficient to be decoded. The specific realization of the determination of the linear relationship includes:
    根据所述目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集;According to the target position coordinate information of the target scanning area, select a type of context model set from multiple types of context model sets, and each type of context model set includes multiple context model subsets;
    根据所述待解码系数所在位置的坐标值满足的线性关系式、所述待解码系数所在位置的坐标值和所述目标位置坐标信息,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,所述上下文模型是从选择的一个上下文模型子集中确定的。According to the linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the coordinate information of the target position, a plurality of context models included in the selected context model set A subset of context models is collectively selected, and the context model is determined from the selected subset of context models.
  25. 如权利要求1所述的方法,其特征在于,所述上下文模型是至少根据 所述目标位置坐标信息确定,包括:The method according to claim 1, wherein the context model is determined according to at least the target location coordinate information, and comprises:
    所述上下文模型是至少根据所述目标位置坐标信息和所述当前块满足的预设条件确定。The context model is determined at least according to the target location coordinate information and the preset condition satisfied by the current block.
  26. 如权利要求25所述的方法,其特征在于,所述方法还包括:The method of claim 25, wherein the method further comprises:
    根据所述目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,每类上下文模型集合包括多个上下文模型子集;According to the target position coordinate information of the target scanning area, select a type of context model set from multiple types of context model sets, and each type of context model set includes a plurality of context model subsets;
    根据所述当前块满足的预设条件确定选择方式,根据所确定的选择方式,从选择的一类上下文模型集合包括的多个上下文模型子集中选择一个上下文模型子集,所述上下文模型是从选择的一个上下文模型子集中确定的。The selection method is determined according to the preset conditions satisfied by the current block, and according to the determined selection method, a context model subset is selected from a plurality of context model subsets included in the selected one type of context model set, and the context model is selected from A selected subset of context models is determined.
  27. 如权利要求15-26任一项所述的方法,其特征在于,所述根据所述目标扫描区域的目标位置坐标信息,从多类上下文模型集合中选择一类上下文模型集合,包括:The method according to any one of claims 15-26, wherein the selecting a type of context model set from multiple types of context model sets according to the target position coordinate information of the target scanning area comprises:
    根据所述目标扫描区域的目标位置坐标信息,确定所述目标扫描区域的面积,根据所述面积,从多类上下文模型集合中选择一类上下文模型集合;或者,Determine the area of the target scan area according to the target position coordinate information of the target scan area, and select a type of context model set from multiple types of context model sets according to the area; or,
    根据所述目标扫描区域的目标位置坐标信息,确定所述目标扫描区域的尺寸,根据所述尺寸,从多类上下文模型集合中选择一类上下文模型集合;或者,Determine the size of the target scan area according to the target position coordinate information of the target scan area, and select a type of context model set from multiple types of context model sets according to the size; or,
    根据所述目标扫描区域的目标位置坐标信息,确定所述目标扫描区域的短边,根据所述短边,从多类上下文模型集合中选择一类上下文模型集合;或者,Determine the short side of the target scan area according to the target position coordinate information of the target scan area, and select a type of context model set from multiple types of context model sets according to the short side; or,
    根据所述目标扫描区域的目标位置坐标信息,确定所述目标位置坐标信息的坐标值满足的线性关系式,根据所述线性关系式,从多类上下文模型集合中选择一类上下文模型集合。According to the target position coordinate information of the target scanning area, a linear relationship expression satisfied by the coordinate value of the target position coordinate information is determined, and a type of context model set is selected from multiple types of context model sets according to the linear relationship expression.
  28. 一种解码方法,其特征在于,所述方法包括:A decoding method, characterized in that the method includes:
    获取当前块的码流;Get the code stream of the current block;
    当确定所述当前块采用SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream. The target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the block, and the second coordinate value is the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. The ordinate of the zero coefficient;
    针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的 待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定;For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined from at least three types of context model sets at least according to the coordinate value of the position where the coefficient to be decoded is located;
    根据所述上下文模型,对所述待解码标志位进行解码。According to the context model, the to-be-decoded flag bit is decoded.
  29. 如权利要求28所述的方法,其特征在于,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定,包括:The method according to claim 28, wherein the context model is determined from at least three types of context model sets according to at least the coordinate values of the positions of the coefficients to be decoded, comprising:
    根据所述目标位置坐标信息确定第一目标位置的坐标值,所述上下文模型是至少根据所述待解码系数所在位置的坐标值和所述第一目标位置的坐标值从至少三类上下文模型集合中确定,所述第一目标位置位于所述目标扫描区域内且排除所述目标位置坐标信息指示的目标位置。The coordinate value of the first target position is determined according to the target position coordinate information, and the context model is a collection of at least three types of context models based on at least the coordinate value of the position where the coefficient to be decoded is located and the coordinate value of the first target position It is determined that the first target position is located in the target scanning area and the target position indicated by the target position coordinate information is excluded.
  30. 如权利要求29所述的方法,其特征在于,The method of claim 29, wherein:
    当所述待解码系数所在位置的横坐标值小于等于所述第一目标位置的横坐标值,且所述待解码系数所在位置的纵坐标值小于等于所述第一目标位置的纵坐标值时,所述上下文模型是从第一类上下文模型集合中选择的;When the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the first target position, and the ordinate value of the position where the coefficient to be decoded is less than or equal to the ordinate value of the first target position , The context model is selected from the first type of context model set;
    当所述待解码系数所在位置的横坐标值大于所述第一目标位置的横坐标值,且所述待解码系数所在位置的纵坐标值大于所述第一目标位置的纵坐标值时,所述上下文模型是从第三类上下文模型集合中选择的;When the abscissa value of the position where the coefficient to be decoded is greater than the abscissa value of the first target position, and the ordinate value of the position where the coefficient to be decoded is greater than the ordinate value of the first target position, The context model is selected from the third type of context model set;
    否则,所述上下文模型是从第二类上下文模型集合中选择的。Otherwise, the context model is selected from the second type of context model set.
  31. 如权利要求28所述的方法,其特征在于,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定,包括:The method according to claim 28, wherein the context model is determined from at least three types of context model sets according to at least the coordinate values of the positions of the coefficients to be decoded, comprising:
    根据所述目标位置坐标信息确定第二目标位置和第三目标位置的坐标值,所述上下文模型至少是根据所述待解码系数所在位置的坐标值、所述第二目标位置和所述第三目标位置的坐标值从至少三类上下文模型集合中确定。The coordinate values of the second target position and the third target position are determined according to the target position coordinate information, and the context model is at least based on the coordinate values of the position where the coefficient to be decoded is located, the second target position and the third target position. The coordinate value of the target location is determined from at least three types of context model sets.
  32. 如权利要求31所述的方法,其特征在于,The method of claim 31, wherein:
    当所述待解码系数所在位置的横坐标值小于等于所述第二目标位置的横坐标值,且所述待解码系数所在位置的纵坐标值小于等于所述第二目标位置的纵坐标值时,所述上下文模型是从第一类上下文模型集合中选择的;When the abscissa value of the position where the coefficient to be decoded is less than or equal to the abscissa value of the second target position, and the ordinate value of the position where the coefficient to be decoded is less than or equal to the ordinate value of the second target position , The context model is selected from the first type of context model set;
    当所述待解码系数所在位置的横坐标值大于所述第三目标位置的横坐标值,且所述待解码系数所在位置的纵坐标值大于所述第三目标位置的纵坐标值时,所述上下文模型是从第三类上下文模型集合中选择的;When the abscissa value of the position where the coefficient to be decoded is greater than the abscissa value of the third target position, and the ordinate value of the position where the coefficient to be decoded is greater than the ordinate value of the third target position, The context model is selected from the third type of context model set;
    否则,所述上下文模型是从第二类上下文模型集合中选择的。Otherwise, the context model is selected from the second type of context model set.
  33. 一种解码方法,其特征在于,所述方法包括:A decoding method, characterized in that the method includes:
    获取当前块的码流;Get the code stream of the current block;
    当确定所述当前块采用SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream. The target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the block, and the second coordinate value is the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. The ordinate of the zero coefficient;
    针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
    根据所述上下文模型,对所述待解码标志位进行解码。According to the context model, the to-be-decoded flag bit is decoded.
  34. 如权利要求33所述的方法,其特征在于,The method of claim 33, wherein:
    当所述待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x≤c时,所述上下文模型是从第一类上下文模型集合中选择的;When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x≤c, the context model is selected from the first type of context model set;
    当所述待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x>c时,所述上下文模型是从第二类上下文模型集合中选择的;When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a*pos_y+b*pos_x>c, the context model is selected from the second type of context model set;
    其中,所述a和b为常数,所述pos_x为所述待解码系数所在位置的横坐标值,所述pos_y为所述待解码系数所在位置的纵坐标值。Wherein, the a and b are constants, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the ordinate value of the position of the coefficient to be decoded.
  35. 如权利要求34所述的方法,其特征在于,所述a为所述第一坐标值,所述b为所述第二坐标值,所述第一数值为所述第一坐标值与所述第二坐标值之间的乘积。The method of claim 34, wherein said a is said first coordinate value, said b is said second coordinate value, and said first value is said first coordinate value and said The product between the second coordinate values.
  36. 如权利要求33所述的方法,其特征在于,The method of claim 33, wherein:
    当所述待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x≤c1时,所述上下文模型是从第一类上下文模型集合中选择的;When the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a1*pos_y+b1*pos_x≤c1, the context model is selected from the first type of context model set;
    当所述待解码系数所在位置的坐标值满足的线性关系式为a1*pos_y+b1*pos_x>c1,且a2*pos_y+b2*pos_x<c2时,所述上下文模型是从 第二类上下文模型集合中选择的;When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a1*pos_y+b1*pos_x>c1, and a2*pos_y+b2*pos_x<c2, the context model is from the second type of context model Selected from the set;
    当所述待解码系数所在位置的坐标值满足的线性关系式为a2*pos_y+b2*pos_x≥c2时,所述上下文模型是从第三类上下文模型集合中选择的;When the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies is a2*pos_y+b2*pos_x≥c2, the context model is selected from the third type of context model set;
    其中,所述a1、b1、a2、b2、c1和c2为常数,所述c1小于所述c2,所述pos_x为所述待解码系数所在位置的横坐标值,所述pos_y为所述待解码系数所在位置的纵坐标值。Wherein, the a1, b1, a2, b2, c1, and c2 are constants, the c1 is less than the c2, the pos_x is the abscissa value of the position of the coefficient to be decoded, and the pos_y is the to be decoded The ordinate value of the position of the coefficient.
  37. 如权利要求36所述的方法,其特征在于,所述a1和a2均为所述第一坐标值,所述b1和b2均为所述第二坐标值,所述c1为所述第一坐标值和所述第二坐标值之间的乘积的一半,所述c2为所述第一坐标值与所述第二坐标值之间的乘积。The method of claim 36, wherein the a1 and a2 are both the first coordinate value, the b1 and b2 are both the second coordinate value, and the c1 is the first coordinate value Half of the product between the value and the second coordinate value, and the c2 is the product between the first coordinate value and the second coordinate value.
  38. 如权利要求33所述的方法,其特征在于,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式、所述待解码系数所在位置的坐标值和所述目标位置坐标信息确定。The method according to claim 33, wherein the context model is based on at least a linear relationship satisfied by the coordinate value of the position of the coefficient to be decoded, the coordinate value of the position of the coefficient to be decoded, and the target The position coordinate information is determined.
  39. 如权利要求38所述的方法,其特征在于,The method of claim 38, wherein:
    当所述待解码系数所在位置的横坐标值小于等于第一阈值,且所述待解码系数所在位置的纵坐标值小于等于第二阈值时,所述上下文模型是从第一类上下文模型集合中选择的;When the abscissa value of the position of the coefficient to be decoded is less than or equal to the first threshold, and the ordinate value of the position of the coefficient to be decoded is less than or equal to the second threshold, the context model is from the first type of context model set Selected;
    否则,当所述待解码系数所在位置的坐标值满足的线性关系式为a*pos_y+b*pos_x>c时,所述上下文模型是从第三类上下文模型集合中选择的;Otherwise, when the linear relational expression satisfied by the coordinate value of the position of the coefficient to be decoded is a*pos_y+b*pos_x>c, the context model is selected from the third type of context model set;
    否则,所述上下文模型是从第二类上下文模型集合中选择的;Otherwise, the context model is selected from the second type of context model set;
    其中,所述第一阈值小于第一坐标值,所述第二阈值小于所述第二坐标值。Wherein, the first threshold value is smaller than the first coordinate value, and the second threshold value is smaller than the second coordinate value.
  40. 一种解码方法,其特征在于,所述方法包括:A decoding method, characterized in that the method includes:
    获取当前块的码流;Get the code stream of the current block;
    当确定所述当前块采用SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When it is determined that the current block adopts SRCC, the target position coordinate information is obtained from the code stream. The target position coordinate information consists of a first coordinate value and a second coordinate value, and the first coordinate value is the current The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the block, and the second coordinate value is the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block. The ordinate of the zero coefficient;
    针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少基于所述当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的;For the coefficient to be decoded in the target scanning area of the current block, a context model of the to-be-decoded flag bit of the coefficient to be decoded is determined, the target scanning area is a scanning area determined based on the target position coordinate information, the The context model is determined according to the determined selection method after the selection method is determined at least based on the preset conditions satisfied by the current block;
    根据所述上下文模型,对所述待解码标志位进行解码。According to the context model, the to-be-decoded flag bit is decoded.
  41. 如权利要求40所述的方法,其特征在于,所述选择方式包括:The method of claim 40, wherein the selection method comprises:
    根据所述待解码系数所在位置的坐标值满足的线性关系式进行选择;或者,The selection is made according to the linear relationship that the coordinate value of the position of the coefficient to be decoded satisfies; or,
    根据所述待解码系数所在位置的坐标值与所述目标位置坐标信息进行选择。The selection is made according to the coordinate value of the position where the coefficient to be decoded is located and the target position coordinate information.
  42. 如权利要求41所述的方法,其特征在于,The method of claim 41, wherein:
    当所述当前块满足预设条件时,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;When the current block satisfies a preset condition, the context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
    当所述当前块不满足所述预设条件时,所述上下文模型是至少根据所述待解码系数所在位置的坐标值与所述目标位置坐标信息确定。When the current block does not satisfy the preset condition, the context model is determined at least according to the coordinate value of the position where the coefficient to be decoded is located and the target position coordinate information.
  43. 如权利要求40-42任一项所述的方法,其特征在于,所述预设条件包括如下条件中的一种:The method according to any one of claims 40-42, wherein the preset condition comprises one of the following conditions:
    所述第一坐标值或所述第二坐标值为零;The first coordinate value or the second coordinate value is zero;
    所述第一坐标值和所述第二坐标值的乘积小于第一坐标阈值;The product of the first coordinate value and the second coordinate value is less than a first coordinate threshold;
    所述第一坐标值大于等于第二坐标阈值且所述第二坐标值大于等于第三坐标阈值;The first coordinate value is greater than or equal to a second coordinate threshold, and the second coordinate value is greater than or equal to a third coordinate threshold;
    所述第一坐标值小于等于第二坐标阈值或所述第二坐标值小于第三坐标阈值。The first coordinate value is less than or equal to the second coordinate threshold or the second coordinate value is less than the third coordinate threshold.
  44. 一种编码方法,其特征在于,所述方法包括:An encoding method, characterized in that the method includes:
    当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When the current block adopts the coefficient coding SRCC based on the scanning area, the target position coordinate information is obtained. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficients, and the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
    针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的 待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述目标位置坐标信息确定;For the coefficient to be coded in the target scan area of the current block, the context model of the flag to be coded of the coefficient to be coded is determined, the target scan area is a scan area determined based on the target position coordinate information, the The context model is determined at least according to the coordinate information of the target location;
    根据所述上下文模型,对所述待编码标志位进行编码。According to the context model, the to-be-encoded flag bit is encoded.
  45. 一种编码方法,其特征在于,所述方法包括:An encoding method, characterized in that the method includes:
    当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When the current block adopts the coefficient coding SRCC based on the scanning area, the target position coordinate information is obtained. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficients, and the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
    针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定;For the coefficient to be coded in the target scan area of the current block, a context model of the flag to be coded of the coefficient to be coded is determined, and the target scan area is a scan area determined based on the target position coordinate information, and The context model is determined from at least three types of context model sets at least according to the coordinate value of the position where the coefficient to be decoded is located;
    根据所述上下文模型,对所述待编码标志位进行编码。According to the context model, the to-be-encoded flag bit is encoded.
  46. 一种编码方法,其特征在于,所述方法包括:An encoding method, characterized in that the method includes:
    当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When the current block adopts the coefficient coding SRCC based on the scanning area, the target position coordinate information is obtained. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficients, and the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
    针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;For the coefficient to be coded in the target scan area of the current block, a context model of the flag to be coded of the coefficient to be coded is determined, and the target scan area is a scan area determined based on the target position coordinate information, and The context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
    根据所述上下文模型,对所述待编码标志位进行编码。According to the context model, the to-be-encoded flag bit is encoded.
  47. 一种编码方法,其特征在于,所述方法包括:An encoding method, characterized in that the method includes:
    当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息, 所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;When the current block adopts the coefficient coding SRCC based on the scanning area, the target position coordinate information is obtained, the target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is the transformation of the current block The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the coefficients, and the second coordinate value is the abscissa of the non-zero coefficient with the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block Y-axis;
    针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少基于所述当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的;For the coefficient to be coded in the target scan area of the current block, a context model of the flag to be coded of the coefficient to be coded is determined, and the target scan area is a scan area determined based on the target position coordinate information, and The context model is determined according to the determined selection method after the selection method is determined at least based on the preset conditions satisfied by the current block;
    根据所述上下文模型,对所述待编码标志位进行编码。According to the context model, the to-be-encoded flag bit is encoded.
  48. 一种解码装置,其特征在于,所述装置包括:A decoding device, characterized in that the device comprises:
    码流获取模块,用于获取当前块的码流;The code stream acquisition module is used to obtain the code stream of the current block;
    信息获取模块,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information consists of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient of the current block. Among the non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
    模型确定模块,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述目标位置坐标信息确定;The model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The scanning area of the target location, the context model is determined at least according to the coordinate information of the target position;
    解码模块,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module is configured to decode the to-be-decoded flag bit according to the context model.
  49. 一种解码装置,其特征在于,所述装置包括:A decoding device, characterized in that the device comprises:
    码流获取模块,用于获取当前块的码流;The code stream acquisition module is used to obtain the code stream of the current block;
    信息获取模块,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information consists of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient of the current block. Among the non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
    模型确定模块,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定;The model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The context model is determined from at least three types of context model sets according to at least the coordinate values of the positions where the coefficients to be decoded are located;
    解码模块,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module is configured to decode the to-be-decoded flag bit according to the context model.
  50. 一种解码装置,其特征在于,所述装置包括:A decoding device, characterized in that the device comprises:
    码流获取模块,用于获取当前块的码流;The code stream acquisition module is used to obtain the code stream of the current block;
    信息获取模块,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information consists of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient of the current block. Among the non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
    模型确定模块,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;The model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The scanning area of the, the context model is determined at least according to the linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
    解码模块,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module is configured to decode the to-be-decoded flag bit according to the context model.
  51. 一种解码装置,其特征在于,所述装置包括:A decoding device, characterized in that the device comprises:
    码流获取模块,用于获取当前块的码流;The code stream acquisition module is used to obtain the code stream of the current block;
    信息获取模块,用于当确定所述当前块采用基于扫描区域的系数编码SRCC时,从所述码流中获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The information acquisition module is configured to acquire target position coordinate information from the code stream when it is determined that the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information consists of a first coordinate value and a second coordinate value. The first coordinate value is the abscissa of the non-zero coefficient with the largest abscissa absolute value among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the abscissa of the non-zero coefficient of the current block. Among the non-zero coefficients, the ordinate of the non-zero coefficient with the largest absolute value of the ordinate;
    模型确定模块,用于针对所述当前块的目标扫描区域中的待解码系数,确定所述待解码系数的待解码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少基于所述当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的;The model determination module is used to determine the context model of the to-be-decoded flag of the to-be-decoded coefficient for the to-be-decoded coefficient in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information The context model is determined according to the determined selection method after determining a selection method at least based on a preset condition satisfied by the current block;
    解码模块,用于根据所述上下文模型,对所述待解码标志位进行解码。The decoding module is configured to decode the to-be-decoded flag bit according to the context model.
  52. 一种编码装置,其特征在于,所述装置包括:An encoding device, characterized in that the device comprises:
    获取模块,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
    确定模块,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述目标位置坐标信息确定;The determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined according to at least the target position coordinate information;
    编码模块,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module is used to encode the to-be-encoded flag bit according to the context model.
  53. 一种编码装置,其特征在于,所述装置包括:An encoding device, characterized in that the device comprises:
    获取模块,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
    确定模块,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值从至少三类上下文模型集合中确定;The determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined from at least three types of context model sets according to at least the coordinate value of the position where the coefficient to be decoded is located;
    编码模块,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module is used to encode the to-be-encoded flag bit according to the context model.
  54. 一种编码装置,其特征在于,所述装置包括:An encoding device, characterized in that the device comprises:
    获取模块,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的 非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
    确定模块,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少根据所述待解码系数所在位置的坐标值满足的线性关系式确定;The determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined at least according to a linear relationship satisfied by the coordinate value of the position where the coefficient to be decoded is located;
    编码模块,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module is used to encode the to-be-encoded flag bit according to the context model.
  55. 一种编码装置,其特征在于,所述装置包括:An encoding device, characterized in that the device comprises:
    获取模块,用于当当前块采用基于扫描区域的系数编码SRCC时,获取目标位置坐标信息,所述目标位置坐标信息由第一坐标值和第二坐标值组成,所述第一坐标值为所述当前块的变换系数包括的非零系数中横坐标绝对值最大的非零系数的横坐标,所述第二坐标值为所述当前块的变换系数包括的非零系数中纵坐标绝对值最大的非零系数的纵坐标;The acquiring module is used to acquire target position coordinate information when the current block adopts the coefficient coding SRCC based on the scanning area. The target position coordinate information is composed of a first coordinate value and a second coordinate value, and the first coordinate value is The abscissa of the non-zero coefficient with the largest absolute value of the abscissa among the non-zero coefficients included in the transformation coefficient of the current block, and the second coordinate value is the largest absolute value of the ordinate among the non-zero coefficients included in the transformation coefficient of the current block The ordinate of the non-zero coefficient of;
    确定模块,用于针对所述当前块的目标扫描区域中的待编码系数,确定所述待编码系数的待编码标志位的上下文模型,所述目标扫描区域是基于所述目标位置坐标信息确定的扫描区域,所述上下文模型是至少基于所述当前块满足的预设条件确定选择方式后根据所确定的选择方式确定的;The determining module is configured to determine the context model of the to-be-coded flag bits of the to-be-coded coefficients for the to-be-coded coefficients in the target scan area of the current block, and the target scan area is determined based on the target position coordinate information Scanning area, the context model is determined according to the determined selection method after a selection method is determined at least based on a preset condition satisfied by the current block;
    编码模块,用于根据所述上下文模型,对所述待编码标志位进行编码。The encoding module is used to encode the to-be-encoded flag bit according to the context model.
PCT/CN2020/096580 2019-08-27 2020-06-17 Decoding method, encoding method, and apparatus WO2021036430A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910798693.6 2019-08-27
CN201910798693.6A CN112449192B (en) 2019-08-27 2019-08-27 Decoding method, encoding method and device

Publications (1)

Publication Number Publication Date
WO2021036430A1 true WO2021036430A1 (en) 2021-03-04

Family

ID=69229942

Family Applications (2)

Application Number Title Priority Date Filing Date
PCT/CN2020/096578 WO2021036429A1 (en) 2019-08-27 2020-06-17 Decoding method, encoding method, and apparatus
PCT/CN2020/096580 WO2021036430A1 (en) 2019-08-27 2020-06-17 Decoding method, encoding method, and apparatus

Family Applications Before (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/096578 WO2021036429A1 (en) 2019-08-27 2020-06-17 Decoding method, encoding method, and apparatus

Country Status (2)

Country Link
CN (3) CN115842916A (en)
WO (2) WO2021036429A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115842916A (en) * 2019-08-27 2023-03-24 杭州海康威视数字技术股份有限公司 Decoding method, encoding method and device
CN113453008B (en) * 2020-03-26 2022-08-02 腾讯科技(深圳)有限公司 Video decoding method, video encoding method, related apparatus and medium
CN111787326B (en) * 2020-07-31 2022-06-28 广州市百果园信息技术有限公司 Entropy coding and decoding method and device
CN114079772B (en) * 2020-08-21 2023-04-07 腾讯科技(深圳)有限公司 Video decoding method and device, computer readable medium and electronic equipment
US11722678B2 (en) * 2020-08-25 2023-08-08 Tencent America LLC Method and apparatus for transform skip coefficients coding
CN112543337B (en) * 2020-09-27 2023-05-02 腾讯科技(深圳)有限公司 Video decoding method, device, computer readable medium and electronic equipment
CN112995671B (en) * 2021-02-21 2022-10-28 腾讯科技(深圳)有限公司 Video encoding and decoding method and device, computer readable medium and electronic equipment
CN114979641A (en) * 2021-02-21 2022-08-30 腾讯科技(深圳)有限公司 Video encoding and decoding method and device, computer readable medium and electronic equipment
CN113068033B (en) * 2021-03-11 2022-05-31 腾讯科技(深圳)有限公司 Multimedia inverse quantization processing method, device, equipment and storage medium
EP4307666A1 (en) * 2021-03-12 2024-01-17 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Coefficient encoding method, coefficient decoding method, encoding device, decoding device, and storage medium
CN115083046A (en) * 2022-06-28 2022-09-20 维沃移动通信有限公司 Decryption method, decryption information creation method, and decryption apparatus

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080085058A1 (en) * 2006-10-05 2008-04-10 Microsoft Corporation Color image coding using inter-color correlation
CN103621086A (en) * 2011-06-28 2014-03-05 高通股份有限公司 Derivation of the position in scan order of the last significant transform coefficient in video coding
CN103636208A (en) * 2011-07-01 2014-03-12 高通股份有限公司 Context adaptive entropy coding for non-square blocks in video coding
CN103929642A (en) * 2014-04-24 2014-07-16 北京航空航天大学 Method for rapidly calculating deviation value of entropy coding context model of HEVC transformation coefficients
CN104469378A (en) * 2013-09-19 2015-03-25 黑莓有限公司 Coding position data for the last non-zero transform coefficient in a coefficient group
US9445132B2 (en) * 2013-09-09 2016-09-13 Qualcomm Incorporated Two level last significant coefficient (LSC) position coding
CN108293139A (en) * 2015-09-08 2018-07-17 三星电子株式会社 Device and method for entropy coding and entropy decoding

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7379608B2 (en) * 2003-12-04 2008-05-27 Fraunhofer-Gesellschaft Zur Foerderung Der Angewandten Forschung, E.V. Arithmetic coding for transforming video and picture data units
CN100488254C (en) * 2005-11-30 2009-05-13 联合信源数字音视频技术(北京)有限公司 Entropy coding method and decoding method based on text
AU2011274680B2 (en) * 2010-07-09 2015-06-11 Samsung Electronics Co., Ltd. Method and apparatus for entropy encoding/decoding a transform coefficient
US9042440B2 (en) * 2010-12-03 2015-05-26 Qualcomm Incorporated Coding the position of a last significant coefficient within a video block based on a scanning order for the block in video coding
US9338449B2 (en) * 2011-03-08 2016-05-10 Qualcomm Incorporated Harmonized scan order for coding transform coefficients in video coding
CN103548354A (en) * 2011-10-05 2014-01-29 通用仪表公司 Coding and decoding utilizing adaptive context model selection with zigzag scan
EP2946552B1 (en) * 2013-01-16 2018-03-21 BlackBerry Limited Context determination for entropy coding of run-length encoded transform coefficients
EP3490253A1 (en) * 2017-11-23 2019-05-29 Thomson Licensing Encoding and decoding methods and corresponding devices
WO2019135448A1 (en) * 2018-01-02 2019-07-11 삼성전자 주식회사 Method for decoding video and apparatus therefor and method for encoding video and apparatus therefor
CN115842916A (en) * 2019-08-27 2023-03-24 杭州海康威视数字技术股份有限公司 Decoding method, encoding method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080085058A1 (en) * 2006-10-05 2008-04-10 Microsoft Corporation Color image coding using inter-color correlation
CN103621086A (en) * 2011-06-28 2014-03-05 高通股份有限公司 Derivation of the position in scan order of the last significant transform coefficient in video coding
CN103636208A (en) * 2011-07-01 2014-03-12 高通股份有限公司 Context adaptive entropy coding for non-square blocks in video coding
US9445132B2 (en) * 2013-09-09 2016-09-13 Qualcomm Incorporated Two level last significant coefficient (LSC) position coding
CN104469378A (en) * 2013-09-19 2015-03-25 黑莓有限公司 Coding position data for the last non-zero transform coefficient in a coefficient group
CN103929642A (en) * 2014-04-24 2014-07-16 北京航空航天大学 Method for rapidly calculating deviation value of entropy coding context model of HEVC transformation coefficients
CN108293139A (en) * 2015-09-08 2018-07-17 三星电子株式会社 Device and method for entropy coding and entropy decoding

Also Published As

Publication number Publication date
CN110708552B (en) 2021-12-31
CN115842916A (en) 2023-03-24
WO2021036429A1 (en) 2021-03-04
CN112449192B (en) 2022-09-16
CN110708552A (en) 2020-01-17
CN112449192A (en) 2021-03-05

Similar Documents

Publication Publication Date Title
WO2021036430A1 (en) Decoding method, encoding method, and apparatus
CN110234008B (en) Encoding method, decoding method and device
CN113411592B (en) Method and device for decoding and encoding prediction mode
CN108391127B (en) Video encoding method, device, storage medium and equipment
TWI537880B (en) Color compression using a selective color transform
CN112040337B (en) Video watermark adding and extracting method, device, equipment and storage medium
CN113099233A (en) Video encoding method, video encoding device, video encoding apparatus, and storage medium
WO2020083385A1 (en) Image processing method, device and system
CN111586413A (en) Video adjusting method and device, computer equipment and storage medium
CN109040753B (en) Prediction mode selection method, device and storage medium
CN110062226B (en) Video coding method, video decoding method, device, system and medium
CN114422782B (en) Video encoding method, video encoding device, storage medium and electronic equipment
CN116980627A (en) Video filtering method and device for decoding, electronic equipment and storage medium
CN116074512A (en) Video encoding method, video encoding device, electronic equipment and storage medium
CN115118979A (en) Image encoding method, image decoding method, device, equipment and storage medium
CN116506616A (en) Video frame coding method, device, electronic equipment and storage medium
CN116546203A (en) Video frame processing method and device, electronic equipment and readable storage medium
CN116957933A (en) Image processing method, apparatus and computer readable storage medium
CN113658283A (en) Image processing method, image processing device, electronic equipment and storage medium

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: 20857325

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20857325

Country of ref document: EP

Kind code of ref document: A1