Processing method, processing device, and storage medium
By determining the transform coefficient representation method based on the transform block information and entropy encoding combined with the context model, the problem of low encoding efficiency caused by the consistency of the transform block coefficient representation method in the H.266/VVC standard is solved, and more efficient video encoding and decoding is achieved.
Patent Information
- Application Number
- PCT/CN2023/143466
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-03
AI Technical Summary
In the prior art, the H.266/VVC standard protocol uses the same transformation coefficient representation method for entropy encoding during video frame encoding, and cannot accurately characterize the coefficient change rules of different transformation blocks, affecting the video encoding and decoding efficiency.
Determine or obtain the transform coefficient representation method based on the information of the transform block, and entropy encoding and decoding are performed in combination with the context model to ensure that each transform block adopts a personalized representation method to improve the accuracy of the transform coefficient representation.
Through personalized transformation coefficient representation method and context model, the efficiency of video encoding and decoding is improved, and the problem of insufficient accuracy caused by the same representation method is avoided.
Smart Images

Figure CN2023143466_03072025_PF_FP_ABST
Abstract
Description
Processing method, processing device and storage medium Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a processing method, a processing device, and a storage medium. Background Art
[0002] The H.266 / VVC standard protocol proposes a video frame encoding technology. When encoding and decoding video frames, each frame is divided into different blocks, and prediction, transformation and quantization processing are performed before encoding and decoding.
[0003] During the process of conceiving and implementing this application, the inventors discovered that there are at least the following problems: for all transform coefficients of all transform blocks, the protocol scheme uses the same transform coefficient representation method for entropy coding, but the number and value amplitude of coefficients of different transform blocks are very different. If the same transform coefficient representation is used, it will be impossible to accurately characterize the context change law of the transform coefficient, which will affect the video encoding and / or decoding efficiency.
[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art.
[0005] Summary of the Invention
[0006] In response to the above technical problems, the present application provides a processing method, a processing device and a storage medium, which aim to improve the accuracy of transform coefficient representation in transform coefficient entropy coding and / or entropy decoding, thereby improving video encoding and / or decoding efficiency.
[0007] The present application provides a processing method that can be applied to a processing device, comprising the steps of:
[0008] S10, determining or obtaining a transform coefficient representation method based on information of the transform block;
[0009] S20: Perform entropy encoding and / or entropy decoding according to the transform coefficient representation method and the context model.
[0010] Optionally, the number of the transform blocks is at least one; and / or the number of the transform coefficient representation methods is at least one.
[0011] Optionally, the method for determining or obtaining the transform coefficient representation includes at least one of the following:
[0012] Determining or obtaining based on scanned neighbor coefficient information of the transform coefficient;
[0013] Determined or obtained based on coefficient information, and / or position and / or size parameters of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block;
[0014] Determine or obtain according to the position and / or size parameters corresponding to the transformation block;
[0015] Determine or obtain a candidate representation list based on information of the transform block, and determine or obtain based on the candidate representation list;
[0016] If the transform block is to be entropy coded, determining or obtaining based on information of transform coefficients corresponding to the transform block;
[0017] If the transformed block is to be entropy decoded, it is determined or obtained according to the index obtained from the bitstream.
[0018] Optionally, determining or obtaining the candidate representation list according to the information of the transform block includes at least one of the following:
[0019] Construct or update a candidate representation list according to coefficient information of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block, and / or position and / or size parameters;
[0020] Construct or update a candidate representation list based on the scanned neighbor coefficient information of the transform coefficient;
[0021] Construct or update a candidate representation list according to position and / or size parameters corresponding to the transformed block;
[0022] Construct or update the candidate representation list according to the default candidate representation mode;
[0023] Construct or update a candidate representation list according to coefficient representations of neighboring blocks;
[0024] The at least two candidate representations are sorted according to their costs, and a candidate representation list is constructed or updated according to the sorting result.
[0025] Optionally, step S20 includes the following steps:
[0026] S21, determining or obtaining a syntax element corresponding to the transform coefficient according to a transform coefficient representation method;
[0027] S22: Perform entropy encoding and / or entropy decoding on the syntax elements according to the context model.
[0028] Optionally, step S21 includes: scanning the transform block according to a preset scanning order, and determining or obtaining syntax elements corresponding to transform coefficients in the scanned transform block according to a transform coefficient representation method;
[0029] Optionally, step S22 includes: determining or obtaining the number of syntax elements corresponding to the transform coefficients and the order of the syntax elements; if there are multiple syntax elements, entropy encoding and / or entropy decoding the syntax elements according to the order of the syntax elements and the context model.
[0030] Optionally, the syntax element includes at least one of the following:
[0031] A first flag that is less than a threshold;
[0032] a second flag greater than a threshold;
[0033] a third flag that is less than or equal to a threshold;
[0034] A fourth flag greater than or equal to a threshold.
[0035] Optionally, the context model is determined or obtained by at least one of the following methods:
[0036] Determining or obtaining based on scanned neighbor coefficient information of the transform coefficient;
[0037] Determined or obtained based on coefficient information, and / or position and / or size parameters of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block;
[0038] Determine or obtain a candidate context model list based on information of the transform block, and determine or obtain based on the candidate context model list;
[0039] Determining or obtaining according to position and / or size parameters of the transform block;
[0040] If the transform block is to be entropy coded, the transform coefficient is determined or obtained based on information of the transform coefficient corresponding to the transform block;
[0041] If the transformed block is to be entropy decoded, it is determined or obtained based on the index obtained from the bitstream;
[0042] Determine or obtain according to the transformation coefficient representation method.
[0043] The present application also provides a processing device, comprising:
[0044] The processing module is used to determine or obtain a transform coefficient representation according to information of the transform block, and is also used to perform entropy coding and / or entropy decoding according to the transform coefficient representation and the context model.
[0045] The present application also provides a processing device, including: a memory and a processor, wherein a processing program is stored in the memory, and when the processing program is executed by the processor, the steps of any of the above processing methods are implemented.
[0046] The processing device in this application can be a smart terminal or a server.
[0047] The present application also provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the processing methods described above are implemented.
[0048] As described above, the processing method of the present application can be applied to a processing device, including the steps of: determining or obtaining a transform coefficient representation based on information of a transform block; and performing encoding and decoding based on a context model and the transform coefficient representation. Through the above technical solution, it is possible to use different transform coefficient representations for transform blocks without being limited to the same transform coefficient representation as other transform blocks, and the transform coefficient representation corresponding to each transform block is determined or obtained based on the information of the transform block, thereby ensuring the accuracy and effectiveness of the transform coefficients while avoiding the phenomenon that all transform blocks use the same transform coefficient representation, thereby improving the accuracy of the transform coefficient representation. After determining the transform coefficients, entropy encoding and / or entropy decoding are performed based on the context model, thereby improving the performance of entropy encoding and / or entropy decoding based on the context model, thereby improving the efficiency of video encoding and / or decoding. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for describing the embodiments. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without inventive work.
[0050] FIG1 is a schematic diagram of the hardware structure of a mobile terminal for implementing various embodiments of the present application;
[0051] FIG2 is a diagram of a communication network system architecture provided by an embodiment of the present application;
[0052] FIG3 is a schematic flow chart of a processing method according to the first embodiment;
[0053] FIG4 is a schematic diagram of entropy coding on the encoding side of the processing method according to the first embodiment;
[0054] FIG5 is a schematic diagram of entropy decoding on the decoding side of the processing method according to the first embodiment;
[0055] FIG6 is a schematic diagram showing a processing method candidate representation list construction according to the second embodiment;
[0056] FIG7 is a schematic diagram showing a comparison between a context index ctxIdx and a context variable of a processing method par according to a third embodiment;
[0057] FIG8 is a schematic diagram of an 8×16 residual block processing method according to a third embodiment;
[0058] FIG9 is a schematic diagram of reverse diagonal scanning of a 4×4 coefficient group according to a processing method of a third embodiment;
[0059] FIG10 is a schematic diagram of reverse diagonal scanning of 4×4 transform coefficients according to a processing method of the third embodiment;
[0060] FIG11 is a module diagram illustrating a processing device according to an embodiment of the present application.
[0061] The purpose of this application, its features, and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings. The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and the accompanying text are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of this application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0062] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0063] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not explicitly listed, or also includes elements inherent to such process, method, article, or device. In the absence of further restrictions, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined based on their explanation in the specific embodiment or further combined with the context of the specific embodiment.
[0064] It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this document, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the term "if" as used herein may be interpreted as "when," "when," or "in response to a determination." Furthermore, as used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms "comprising" and "including" indicate the presence of the described features, steps, operations, elements, components, items, types, and / or groups, but do not exclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, types, and / or groups. The terms "or," "and / or," "including at least one of the following," etc., used herein, may be interpreted as inclusive, or mean any one or any combination. For example, “comprising at least one of the following: A, B, C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”; and for another example, “A, B or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”. An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some manner.
[0065] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and they can be performed in other orders. Moreover, some of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or sub-steps of other steps or parts of stages.
[0066] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to the determination" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)," depending on the context.
[0067] It should be noted that in this article, step codes such as S10 and S20 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the order. When implementing the step, those skilled in the art may execute S20 first and then S10, etc., but these should all be within the scope of protection of this application.
[0068] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0069] In the subsequent description, the use of suffixes such as "module", "component" or "unit" to represent elements is only for the purpose of facilitating the description of the present application and has no specific meaning. Therefore, "module", "component" or "unit" can be used interchangeably.
[0070] The processing device in this application can be a smart terminal or a server. The smart terminal can be implemented in various forms. For example, the smart terminal described in this application can include smart terminals such as mobile phones, tablet computers, laptop computers, PDAs, portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, etc., as well as fixed terminals such as digital TVs and desktop computers.
[0071] The subsequent description will be made by taking a mobile terminal as an example. It will be understood by those skilled in the art that, in addition to components specifically used for mobile purposes, the configuration according to the embodiments of the present application can also be applied to fixed-type terminals.
[0072] Please refer to Figure 1, which is a schematic diagram of the hardware structure of a mobile terminal for implementing various embodiments of the present application. The mobile terminal 100 may include components such as an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an A / V (Audio / Video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will understand that the mobile terminal structure shown in Figure 1 does not limit the mobile terminal. The mobile terminal may include more or fewer components than shown, or may combine certain components, or arrange the components differently.
[0073] The following is a detailed introduction to the various components of the mobile terminal in conjunction with Figure 1:
[0074] The RF unit 101 can be used to send and receive information or receive signals during calls. Specifically, it receives downlink information from the base station and transmits it to the processor 110 for processing. It also transmits uplink data to the base station. Typically, the RF unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, and more. Furthermore, the RF unit 101 can communicate with the network and other devices via wireless communication. The above-mentioned wireless communications can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution), TDD-LTE (Time Division Duplexing-Long Term Evolution), 5G and 6G, etc.
[0075] WiFi is a short-range wireless transmission technology. A mobile terminal, through WiFi module 102, enables users to send and receive emails, browse web pages, and access streaming media, providing wireless broadband Internet access. Although FIG1 illustrates WiFi module 102, it is understood that it is not a required component of the mobile terminal and can be omitted as needed without altering the essence of the invention.
[0076] The audio output unit 103 can convert audio data received by the RF unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output it as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Furthermore, the audio output unit 103 can also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, or the like.
[0077] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos captured by an image capture device (e.g., a camera) in video capture mode or image capture mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the GPU 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the RF unit 101 or the WiFi module 102. The microphone 1042 may receive sound (audio data) in operating modes such as phone call mode, recording mode, and voice recognition mode, and may process such sound into audio data. In phone call mode, the processed audio (voice) data may be converted into a format that can be transmitted to a mobile communication base station via the RF unit 101. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to eliminate (or suppress) noise or interference generated during the reception and transmission of audio signals.
[0078] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Optionally, the light sensor includes an ambient light sensor and a proximity sensor. Optionally, the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and / or the backlight when the mobile terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described here.
[0079] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0080] The user input unit 107 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile terminal. Optionally, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using a finger, stylus, or any other suitable object or accessory on or near the touch panel 1071) and drive the corresponding connection device according to a pre-set program. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Optionally, the touch detection device detects the user's touch direction and detects the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 110. It can also receive commands sent by the processor 110 and execute them. In addition, the touch panel 1071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may further include other input devices 1072. Optionally, the other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power keys, etc.), a trackball, a mouse, a joystick, etc., and the specifics are not limited here.
[0081] Optionally, the touch panel 1071 may overlay the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of touch event. The processor 110 then provides a corresponding visual output on the display panel 1061 based on the type of touch event. Although in FIG1 , the touch panel 1071 and the display panel 1061 are shown as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, which is not limited to this specific embodiment.
[0082] The interface unit 108 serves as an interface through which at least one external device can be connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.
[0083] Memory 109 can be used to store software programs and various data. Memory 109 may primarily include a program storage area and a data storage area. Optionally, the program storage area may store an operating system and at least one application required for a function (such as a sound playback function or an image playback function); the data storage area may store data generated based on the use of the mobile phone (such as audio data, a phone book, etc.). Furthermore, memory 109 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0084] Processor 110 is the control center of the mobile terminal, connecting all components of the mobile terminal using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 109 and accessing data stored in memory 109, it executes various functions of the mobile terminal and processes data, thereby providing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, processor 110 may integrate an application processor and a modem processor. Optionally, the application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 110.
[0085] The mobile terminal 100 may also include a power supply 111 (such as a battery) for supplying power to various components. Preferably, the power supply 111 may be logically connected to the processor 110 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.
[0086] Although not shown in FIG. 1 , the mobile terminal 100 may further include a Bluetooth module, etc., which will not be described in detail here.
[0087] To facilitate understanding of the embodiments of the present application, the communication network system on which the mobile terminal of the present application is based is described below.
[0088] Please refer to Figure 2, which is a communication network system architecture diagram provided in an embodiment of the present application. The communication network system is an LTE system of universal mobile communication technology. The LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203 and an operator's IP service 204, which are connected in sequence.
[0089] Optionally, UE201 may be the above-mentioned terminal 100, which will not be described in detail here.
[0090] E-UTRAN 202 includes eNodeB 2021 and other eNodeBs 2022 . Optionally, eNodeB 2021 may be connected to other eNodeBs 2022 via a backhaul (eg, an X2 interface). eNodeB 2021 is connected to EPC 203 , and eNodeB 2021 may provide access from UE 201 to EPC 203 .
[0091] EPC 203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving Gate Way) 2034, a PGW (PDN Gate Way) 2035, and a PCRF (Policy and Charging Rules Function) 2036. Optionally, MME 2031 is a control node that processes signaling between UE 201 and EPC 203, providing bearer and connection management. HSS 2032 provides registers for managing functions such as the Home Location Register (not shown) and stores user-specific information such as service features and data rates. All user data can be sent through SGW2034, PGW2035 can provide IP address allocation and other functions for UE 201, PCRF2036 is the policy and charging control policy decision point for service data flow and IP bearer resources, and it selects and provides available policy and charging control decisions for the policy and charging execution function unit (not shown in the figure).
[0092] The IP service 204 may include the Internet, an intranet, an IMS (IP Multimedia Subsystem), or other IP services.
[0093] Although the above introduction takes the LTE system as an example, those skilled in the art should know that this application is not only applicable to the LTE system, but can also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, 5G and future new network systems (such as 6G), etc., which are not limited here.
[0094] Based on the above-mentioned mobile terminal hardware structure and communication network system, various embodiments of the present application are proposed.
[0095] First embodiment
[0096] 3 , which is a flow chart of a processing method according to a first embodiment, the processing method of the embodiment of the present application can be applied to a processing device, including the following steps:
[0097] S10, determining or obtaining a transform coefficient representation method based on information of the transform block;
[0098] S20: Perform entropy encoding and / or entropy decoding according to the transform coefficient representation method and the context model.
[0099] In this embodiment, the processing device can be a smart terminal, such as a mobile phone, a computer, etc., or a server, such as a local server or a cloud server. In this embodiment and this application, the processing device is mainly described as a smart terminal.
[0100] Optionally, the transform block may be a block obtained by transforming the prediction residual block, and a transform block includes at least one transform coefficient. The transform coefficient may be a number of the block obtained after the block is transformed and quantized. The transform coefficient representation method may be a method of representing the transform coefficient level.
[0101] Optionally, the prediction residual block is transformed to obtain a transform coefficient, and the transform coefficient is quantized to obtain a transform coefficient level. For example, if the prediction residual block is -3, the transform coefficient after transformation is 2.3, and the transform coefficient level is 2 after quantization, and then entropy coding is performed.
[0102] Optionally, the technical solution of this embodiment can be applied to the fields of image coding and decoding, video coding and decoding, hardware video coding and decoding, dedicated circuit video coding and decoding, real-time video coding and decoding, and so on.
[0103] Optionally, for ease of understanding, a brief introduction to the codec architecture is first given. In the codec framework, the intra-frame estimation unit and the intra-frame prediction unit may predict the target image block with reference to the adjacent image blocks of the image frame to be encoded to output a prediction block. Alternatively, the motion compensation unit and the motion estimation unit may predict the target image block with reference to the adjacent image blocks of the image frame to be encoded to output a prediction block. The residual unit may calculate a residual block based on the prediction block and the target image block to be encoded, that is, the difference between the prediction block and the target image block to be encoded. The residual block may also be referred to as residual information. The residual block is transformed and quantized by the transform and quantization unit, and information to which the human eye is not sensitive may be removed to eliminate visual redundancy. Optionally, the residual block before transformation and quantization by the transform and quantization unit may be referred to as a time domain residual block, and the time domain residual block after transformation and quantization by the transform and quantization unit may be referred to as a frequency residual block or a frequency domain residual block. After receiving the quantized change coefficient output by the change quantization unit, the header information encoding unit or the entropy encoding unit may output a target bitstream based on the quantized change coefficient and the intra-frame prediction data output by the intra-frame estimation unit and the intra-frame prediction unit or the motion data output by the motion compensation unit and the motion estimation unit. For example, the header information encoding unit or the entropy encoding unit may eliminate character redundancy based on the target context model and the probability information of the binary bitstream. For example, the header information encoding unit or the entropy encoding unit may be used for context-based adaptive binary arithmetic entropy coding (CABAC).
[0104] After the decoding end receives and parses the code stream, it obtains the time domain residual block through steps such as inverse transformation and inverse quantization. After superimposing the predicted block obtained by the decoding end on the time domain residual block, the reconstructed block can be obtained. Optionally, in the present application, the current block can also be referred to as the original image block or the image block to be encoded, and the matching block can also be referred to as the predicted image block or the image prediction block. In addition, for the encoding end, the current block can also be referred to as the target coding block or the target coding image block, and for the decoding end, the current block can also be referred to as the target decoding block or the target decoding image block. Optionally, the current block can be a macroblock. Optionally, the intra-frame estimation unit and the intra-frame prediction unit can be used for intra-frame prediction. The intra-frame prediction only refers to the information of the same frame image and predicts the pixel information within the target image block to eliminate spatial redundancy; the frame used for intra-frame prediction can be an I frame. The motion compensation unit and the motion estimation unit can be used for inter-frame prediction. Inter-frame prediction can refer to the image information of different frames and use motion estimation to search for the motion vector information that best matches the target image block to eliminate temporal redundancy. If the input digital video is in color format, such as YUV 4:2:0 format, then each 4 pixel points of each image frame of the digital video are composed of 4 Y components and 2 UV components. The encoding framework can encode the Y component (i.e., the luminance block) and the UV component (i.e., the chrominance block) separately. Similarly, the decoding end can also perform corresponding decoding according to the format. It should be noted that the frames used for inter-frame prediction can be P frames and / or B frames. P frames refer to forward prediction frames, and B frames refer to bidirectional prediction frames.
[0105] Optionally, in a codec architecture, the input frame is segmented into multiple image blocks at the encoder end. Each image block is subtracted from a prediction block obtained using a prediction mode to produce a residual block. The residual block is then transformed and quantized before being encoded by an entropy encoder. Finally, an encoded bitstream is formed. The transformed and quantized residual block is then added to the corresponding prediction block obtained using the prediction mode to produce a reconstructed block. This reconstructed block is then loop-filtered to reduce distortion. Optionally, the prediction mode can include an intra-frame prediction mode and an inter-frame prediction mode.
[0106] Optionally, in CABAC coding mode, two operating modes can be supported: regular mode and a low-complexity bypass mode. Optionally, regular mode encodes bins using an adaptive probability model. Optionally, bypass mode uses a fixed probability of 1 / 2. Optionally, the adaptive probability model is also called a context, and assigning a probability model to a single bin is called context modeling.
[0107] Optionally, in transform coefficient coding in H.266 / VVC, pixel residuals in the residual block are mainly subjected to conventional residual coding and transform skip coding. In conventional residual coding, the prediction residual is transformed and quantized to obtain a transform coefficient level, which is then entropy coded using context-based adaptive binary coding (i.e., CABAC coding) as follows.
[0108] Optionally, any transform coefficient level coeff_level is represented as two parts: the absolute value level abs_coeff_level and the sign coeff_sign_flag. Optionally, coeff_sign_flag is 1 to represent a negative number and / or 0 to represent a positive number. The absolute value level abs_coeff_level is further represented as sig_coeff_flag(sig), abs_level_gtx_flag[0](gt1), par_level_flag(par), abs_level_gtx_flag[1](gt3) and abs_remainder(remLevel). Optionally, the coding order of the above syntax elements can be sig, gt1, par, gt3, remLevel and coeff_sign_flag, and different coding orders represent different representation methods. Optionally, sig_coeff_flag(sig): 1 represents that the absolute value of the coefficient level is greater than 0, otherwise it is 0. abs_level_gtx_flag[0](gt1): 1 indicates that the absolute value of the coefficient level is greater than 1, otherwise it is less than or equal to 1. Optionally, par_level_flag(par): 1 indicates that the absolute value of the coefficient level is odd, otherwise it is even. Optionally, abs_level_gtx_flag[1](gt3): 1 indicates that the absolute value of the coefficient level is greater than 3, otherwise it is less than or equal to 3. abs_remainder: remainder of the absolute value.
[0109] Optionally, the coefficient level absolute value abs_coeff_level = sig + gt1 + par + 2 * (gt3 + remLevel), and the transform coefficient level coeff_level = (1-2 * coeff_sign_flag) * abs_coeff_level. Optionally, the order of syntax elements in the codestream can be sig, gt1, par, gt3, remLevel.
[0110] Optionally, each of the above syntax elements may be entropy coded three times.
[0111] Optionally, for the first time, the syntax elements that may be encoded include sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag. The first entropy encoding ends when the number of bits of context encoding used for encoding is greater than a set threshold or all syntax elements have been encoded.
[0112] Optionally, the second time, the syntax elements encoded include abs_remainder. Optionally, if the number of bits used for context coding in the first encoding is less than a set threshold (i.e., sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag have been completely encoded in the first encoding), Golomb-Rice binarization and bypass coding are performed on abs_remainder. And / or, if the number of bits used in the first encoding reaches a set threshold (i.e., sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag have not been completely encoded in the first encoding), the remainder of the coefficient encoded in the first encoding is recorded as dec_abs_level, and Golomb-Rice binarization and bypass coding are performed on it after abs_remainder.
[0113] Optionally, the third time, the encoded syntax element includes the sign of the non-zero coefficient, coeff_sign_flag. If the sign of the non-zero coefficient is negative, coeff_sign_flag=1 is encoded using the bypass mode, otherwise coeff_sign_flag=0 is encoded.
[0114] Optionally, for the context modeling part of coefficient coding, the choice of probability model for the syntax element related to the absolute value level of the transform coefficient (abs_coeff_level) depends on the absolute value level or partially reconstructed absolute value level in the local neighborhood. For example, the number of absolute value levels greater than 0 in the local neighborhood can be calculated by the number of sig_coeff_flags equal to 1. Context modeling and binarization depend on the following values of the local neighborhood area:
[0115] locNumSig: the sum of the number of non-zero coefficient levels (abs_coeff_level>0) in the neighboring area;
[0116] locSumAbsPass1: the sum of the absolute value levels (AbsLevelPass1) of the coefficients of the partial reconstruction of the local neighborhood after the first encoding;
[0117] locSumAbs: the sum of the absolute values of the coefficients reconstructed in the local neighborhood;
[0118] diagonal position (d): The sum of the horizontal and vertical coordinates of the current scan position within the transform block.
[0119] Optionally, the probability model for encoding sig_coeff_flag, abs_level_gt1_flag, par_level_flag, and abs_level_gt3_flag is selected based on the values of locNumSig, locSumAbsPass1, and d. The Rice parameters for binarizing abs_remainder are selected based on the values of locSumAbs and locNumSig.
[0120] Optionally, in some implementations, since all transform coefficients of all transform blocks are entropy coded using the same transform coefficient representation method, such as the same number of qtx, par parity bits, etc., different transform coefficient positions or neighbor information use different context models. However, the number and amplitude of transform coefficients of different transform blocks are very different. Therefore, the use of the same transform coefficient representation method or context model cannot accurately represent the law of transform coefficients, thereby hindering the improvement of entropy coding efficiency. Optionally, the law of transform coefficients may include amplitude changes, sign changes, context, neighbor coefficients, etc. of transform coefficients. For example, CABAC is constantly adjusting itself to approximate the optimal context environment. The more accurate the context, the better the CABAC compression effect and the higher the coding performance.
[0121] To solve the above technical problems, the technical solution of this embodiment selects different transform coefficient representations for a transform block based on information of different blocks. Optionally, the block information may include neighboring block coefficients, block size, and signaling in the bitstream. Optionally, for a transform coefficient, different transform coefficient representations may be selected based on information of different transform coefficients (such as the coefficient of the previous scanned bit). Optionally, a candidate list is used to express the transform coefficient representation and / or the entropy coding context model of the transform coefficient. Optionally, the context model can also be obtained based on the representation of the transform block or the transform coefficient. Different transform coefficient representations or different transform coefficient context models are used for different transform coefficient features to improve the accuracy of the transform coefficient representation and the context model, thereby improving the entropy coding performance and thus improving the video encoding and / or decoding efficiency.
[0122] Optionally, the above step S10 can be performed on either the encoding side or the decoding side.
[0123] Optionally, the number of transform blocks is at least one.
[0124] Optionally, the number of transform coefficient representation modes is at least one.
[0125] Optionally, the information of the transformed block may include at least one of neighboring block coefficients, block size, signaling in a bitstream, etc. The information may also include at least one of the number of non-zero coefficients, the sum of absolute values of coefficients, the average of absolute values of non-zero coefficients, the sum of syntax elements, and the sum of greater-than-threshold flags.
[0126] Optionally, the transform coefficient representation may include different numbers of syntax elements and / or, when there are multiple syntax elements, the order of the syntax elements. For example, the transform coefficient representation corresponding to a syntax element is represented by 6 syntax elements, and entropy encoding and / or entropy decoding are performed in the order of sig, gt1, par, gt3, remLevel, and coeff_sign_flag.
[0127] Optionally, if at least one of the types of syntax elements, the number of syntax elements, and the order of arrangement of syntax elements is different, the corresponding transform coefficient representations are different. Optionally, there are multiple different transform coefficient representations, and the transform coefficient representations can differ in the types of syntax elements, the number of syntax elements, or the order of arrangement of syntax elements. Optionally, different types of syntax elements correspond to different transform coefficient representations. For example, if there are two transform coefficient representations, namely transform coefficient representation 1 and transform coefficient representation 2, if at least one syntax element in transform coefficient representation 1 has a different type from that in transform coefficient representation 2, then transform coefficient representation 1 and transform coefficient representation 2 can be considered to belong to different transform coefficient representations. For example, sig, gt1, par, remLevel, and coeff_sign_flag are one transform coefficient representation. sig, gt3, par, remLevel, and coeff_sign_flag are another transform coefficient representation.
[0128] Optionally, different numbers of syntax elements correspond to different transform coefficient representations. For example, if one transform coefficient representation corresponds to 6 syntax elements and another transform coefficient representation corresponds to 7 syntax elements, then the two transform coefficient representations may be considered different. For example, sig, gt1, par, remLevel, and coeff_sign_flag may represent one transform coefficient representation, while sig, gt1, par, gt3, remLevel, and coeff_sign_flag may represent another transform coefficient representation.
[0129] Optionally, the order of the syntax elements is different, and the corresponding transform coefficient representation is different, for example, sig, gt1, par, gt3, remLevel and coeff_sign_flag are one transform coefficient representation, and sig, gt1, gt3, par, remLevel and coeff_sign_flag are another transform coefficient representation.
[0130] Optionally, each transform coefficient corresponds to at least one transform coefficient representation.
[0131] Optionally, the transform coefficient representation corresponding to each transform coefficient may be the same or different.
[0132] Optionally, at least two different transform coefficient representations may be determined, and the transform coefficient representation may be determined or obtained from the at least two different transform coefficient representations based on the transform block information. For example, a transform coefficient representation may be selected from the at least two different transform coefficient representations based on the transform block information. A transform coefficient in the current transform block is then represented based on the selected transform coefficient representation.
[0133] Optionally, at least one context model may be selected from at least two context models, and entropy encoding and / or entropy decoding may be performed based on the selected transform coefficient representation and the selected context model. Optionally, the current transform coefficient may be represented based on the selected transform coefficient representation to obtain a syntax element sequence for representing the current transform coefficient. For each syntax element in the syntax element sequence, entropy encoding and / or entropy decoding may be performed based on the selected context model.
[0134] Optionally, step S20 may be performed on both the encoding side and the decoding side. Alternatively, on the encoding side, a transform coefficient representation may be determined or obtained based on information about the transform block, and entropy encoding may be performed based on the transform coefficient representation and a context model. On the decoding side, a transform coefficient representation may be determined or obtained based on information about the transform block, and entropy decoding may be performed based on the transform coefficient representation and a context model.
[0135] Optionally, parameters that may be used in this embodiment or other embodiments are described:
[0136] coeff may represent the original unquantized transform coefficient.
[0137] coeff_level may represent the level of a transform coefficient.
[0138] coeff_sign_flag can be abbreviated as sign, which is the sign bit of the transform coefficient, 0 represents positive, and 1 represents negative.
[0139] abs_coeff_level may indicate the absolute value level of the transform coefficient.
[0140] sig_coeff_flag can be abbreviated as sig, where 1 represents that the absolute value of the coefficient level is greater than 0, otherwise it is 0.
[0141] When abs_level_gtx_flag[j] is 1, it means that the absolute value of the coefficient level is greater than (j<<1)+1, otherwise it is less than or equal to (j<<1)+1.
[0142] Optionally, the threshold calculation formula may be (j<<1)+1, j=0.
[0143] abs_level_gtx_flag[0] can be expressed as equivalent to gt1. A value of 1 indicates that the absolute value of the coefficient level is greater than 1, otherwise it is less than or equal to 1.
[0144] abs_level_gtx_flag[1] can be expressed as equivalent to gt3. A value of 1 indicates that the absolute value of the coefficient level is greater than 3, otherwise it is less than or equal to 3.
[0145] When gtx is 1, it means that the absolute value of the coefficient level is greater than x, otherwise it is less than or equal to x, where x is a non-negative integer.
[0146] When getx is 1, it means that the absolute value of the coefficient level is greater than or equal to x, otherwise it is less than x, and x is a non-negative integer.
[0147] par_level_flag can be abbreviated as par. When it is 1, it means that the absolute value of the coefficient level is an odd number, otherwise it is an even number.
[0148] abs_remainder can be abbreviated as remLevel, the remainder of the absolute value. stx can be 1 to indicate that the absolute value of the coefficient level is less than x, otherwise it is greater than or equal to x, where x is a non-negative integer.
[0149] When setx is 1, it means that the absolute value of the coefficient level is less than or equal to x, otherwise it is greater than x, and x is a non-negative integer.
[0150] Optionally, for the encoding side, reference may be made to the schematic diagram of the transform coefficient entropy coding framework shown in Figure 4. Optionally, the residual block is transformed and quantized to obtain a transform block, and at least one transform coefficient coeff in the transform block is entropy coded to obtain a binary code stream.
[0151] Optionally, the representation acquisition module obtains the representation of the current coefficient (group) based on the input information. For example, if neighbor coefficient information is input, and the number of pixels with sig being 1 exceeds 50% of the total number of pixels, it is considered that the number of pixels with sig being 1 in the current coefficient (group) is also greater than 50%, and (sig, gt1, gt3, gt5, par, gt7, rem) is selected as the representation of abs_coeff_level. For example, if the absolute value level of the previous scan coefficient is input and its value is less than 3, (sig, gt1, par, gt3, rem) is selected as the representation of abs_coeff_level.
[0152] Optionally, the representation acquisition module may acquire the representation corresponding to the transform coefficient based on neighbor coefficient derivation, and / or a representation candidate list, and / or scan coefficient derivation.
[0153] Optionally, the transform coefficients are represented in coefficient representation according to the determined representation mode, for example, the transform coefficients coeff are represented as multiple syntax elements according to the representation mode and the scanning order, such as par, gt1 and gt3.
[0154] Optionally, each syntax element is scanned in sequence, and a corresponding context model is obtained for the scanned syntax element through a context acquisition module, and then the scanned syntax element is arithmetically encoded according to the context model to obtain a binary code stream.
[0155] Optionally, the binary code stream may also include information such as an index, which is used to indicate the transform coefficient representation and / or context model used by the transform coefficient, and / or the index of the transform coefficient representation and / or context model in the candidate list.
[0156] Optionally, each grammatical element corresponds to a corresponding context model.
[0157] Optionally, the context acquisition module may acquire the context model corresponding to the syntax element according to neighbor coefficient derivation, and / or context candidate list, and / or scanning coefficient derivation.
[0158] Optionally, for the decoding side, reference may be made to the schematic diagram of the transform coefficient entropy decoding framework shown in FIG5 .
[0159] Optionally, at the decoding side, the transform coefficient coeff after analytical transformation and quantization may be obtained according to the binary code stream.
[0160] Optionally, a representation acquisition module on the decoding side acquires the representation of the current coefficient (group). For example, if neighbor coefficient information is input, and the number of pixels with sig being 1 exceeds 50% of the total number of pixels, it is considered that the number of pixels with sig being 1 in the current coefficient (group) is also greater than 50%, and (sig, gt1, gt3, gt5, par, gt7, rem) is selected as the representation of abs_coeff_level. For example, if the absolute value level of the previous scan coefficient is input and its value is less than 3, (sig, gt1, par, gt3, rem) is selected as the representation of abs_coeff_level.
[0161] Optionally, the representation acquisition module may acquire the representation corresponding to the transform coefficient based on neighbor coefficient derivation, and / or a representation candidate list, and / or scan coefficient derivation.
[0162] Optionally, for each syntax element, the context acquisition module acquires a context model for the current coefficient (group) based on input information. The input information may be parsed neighbor coefficients, previously scanned coefficients, context candidate list indexes, etc. Optionally, the context acquisition module may acquire the context model corresponding to the syntax element based on neighbor coefficient derivation, and / or context candidate list derivation, and / or scan coefficient derivation.
[0163] Optionally, the arithmetic decoding module parses each syntax element of each coefficient from the binary bitstream in sequence based on the obtained context model, and reassembles them in order, such as par, gt1, and gt3. The transform coefficient is calculated according to the transform coefficient representation, such as: coeff = (sig + gt1 + par + 2*gt3 + 2*rem) * (1-2*sign).
[0164] In this embodiment, a transform coefficient representation is determined or obtained based on transform block information; encoding and decoding are performed based on the context model and the transform coefficient representation. This allows for the use of different transform coefficient representations for transform blocks, rather than being limited to the same transform coefficient representation as other transform blocks. Furthermore, the transform coefficient representation corresponding to each transform block is determined or obtained based on the transform block information, thereby ensuring the accuracy and effectiveness of the transform coefficients while avoiding the situation where all transform blocks use the same transform coefficient representation, thereby improving the accuracy of the transform coefficient representation. Furthermore, after the transform coefficients are determined, entropy encoding and / or decoding are performed based on the context model, thereby improving the performance of entropy encoding and / or decoding based on the context model, thereby improving the efficiency of video encoding and / or decoding.
[0165] Second embodiment
[0166] Based on the first embodiment, a second embodiment is proposed.
[0167] In this embodiment, the method for determining or obtaining the transform coefficient representation method may include at least one of the following methods 1 to 6:
[0168] Method 1: determining or obtaining the coefficients based on the scanned neighbor coefficient information of the transform coefficients;
[0169] Optionally, the scanning neighbor coefficient information may include at least one of the number of non-zero coefficients, the sum of the absolute values of the coefficients, the sum of the absolute values of the weighted numbers, the sum of the syntax elements, the sum of the greater than threshold flags, the coordinates of the coefficient in the block, etc.
[0170] Optionally, the first method may include determining or obtaining at least one transform coefficient representation method based on at least one scanning neighbor coefficient information of the transform coefficient level.
[0171] Optionally, a relationship or rule between the scanned neighbor coefficient information and a preset transform coefficient representation may be established. After determining the scanned neighbor coefficient information of a transform coefficient, at least one transform coefficient representation may be determined or obtained based on the pre-set relationship or rule. For example, the number of non-zero coefficients among all scanned transform coefficients in the neighboring blocks may be determined, and the syntax element used to represent the current transform coefficient level and / or the order of the syntax elements may be determined based on the number of non-zero coefficients.
[0172] Optionally, at least one transform coefficient representation mode may be selected from at least two transform coefficient representation modes according to scanning neighbor coefficient information of the transform coefficient.
[0173] Optionally, the determined or obtained at least one transform coefficient representation may include syntax elements used to represent the transform coefficients, and / or an arrangement order of each syntax element.
[0174] Optionally, at least one transform coefficient representation is determined or obtained based on the scanned neighbor coefficient information of the transform coefficient, and entropy encoding and / or entropy decoding is performed based on the at least one transform coefficient representation and a context model.
[0175] Optionally, the transform coefficient levels corresponding to the transform coefficients are represented as a syntax element sequence according to at least one transform coefficient representation scheme. For example, [sig, gt1, par, gt3, rem, sign] = [1, 0, 1, 0, 2, 0] is a syntax element sequence for a transform coefficient. The encoder performs entropy encoding on the values of the syntax element sequence [sig, gt1, par, gt3, rem, sign], i.e., [1, 0, 1, 0, 2, 0], and writes the values into the bitstream. The decoder obtains the values of the syntax element sequence [sig, gt1, par, gt3, rem, sign], i.e., [1, 0, 1, 0, 2, 0], from the bitstream through entropy decoding.
[0176] Optionally, if the syntax element sequence includes five syntax element values arranged in a certain order, for example, the values of the syntax element sequence [sig, gt1, par, gt3, rem, sign] are [1, 0, 1, 0, 2, 0], entropy encoding and / or entropy decoding may be performed on the value of each syntax element according to at least one context model.
[0177] Optionally, the syntax element sig=1 is entropy encoded according to the context model corresponding to sig (this operation is written into the bitstream), and / or the syntax element sig is entropy decoded according to the context model corresponding to sig to obtain sig=1 (this operation reads data from the bitstream).
[0178] Optionally, the syntax element gt1=0 is entropy encoded according to the context model corresponding to gt1 (this operation is written into the bitstream), and / or the syntax element gt1 is entropy decoded according to the context model corresponding to gt1 to obtain gt1=0 (this operation reads data from the bitstream).
[0179] Optionally, the syntax element par=1 is entropy encoded according to the context model corresponding to par (this operation is written into the bitstream), and / or the syntax element par is entropy decoded according to the context model corresponding to par to obtain par=1 (this operation reads data from the bitstream).
[0180] Optionally, the syntax element gt3=0 is entropy encoded according to the context model corresponding to gt3 (this operation is written into the bitstream), and / or the syntax element gt3 is entropy decoded according to the context model corresponding to gt3 to obtain gt3=0 (this operation reads data from the bitstream).
[0181] Optionally, the syntax element rem=2 is entropy encoded according to the context model corresponding to rem (this operation is written into the bitstream), and / or the syntax element rem is entropy decoded according to the context model corresponding to rem to obtain rem=2 (this operation reads data from the bitstream).
[0182] Optionally, the syntax element sign=0 is entropy encoded according to the context model corresponding to sign (this operation is written into the bitstream), and / or the syntax element sign is entropy decoded according to the context model corresponding to sign to obtain sign=0 (this operation reads data from the bitstream).
[0183] Optionally, the transform coefficient representation is determined or obtained by scanning neighbor coefficient information of the transform coefficient, and then the scanning neighbor coefficient information can be comprehensively considered to make the determined transform coefficient representation more accurate and effective, thereby improving the video encoding and / or decoding efficiency.
[0184] Method 2: determining or obtaining based on coefficient information, and / or position and / or size parameters of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block;
[0185] Optionally, the default block may be a block set in advance, for example, a block with typical transform coefficient characteristics pre-set by the codec.
[0186] Optionally, at the encoding end, the neighbor block may be a block that is adjacent to the transform block and has been transformed, and the non-neighbor block may be a block that is not adjacent to the transform block and has been transformed.
[0187] Optionally, at the decoding end, the neighbor block may be a block adjacent to the transformed block and already decoded / reconstructed, or a block that has been inversely transformed, or a block that has been decoded using context-based arithmetic entropy decoding.
[0188] Alternatively, the non-neighbor block may be a block that is not adjacent to the transformed block and has been decoded / reconstructed, or a block that has been inversely transformed, or a block that has been decoded using context-based arithmetic entropy decoding.
[0189] Optionally, the time domain block may be a block from the time domain, such as a block in a previous codec frame.
[0190] Optionally, the coefficient information of the default block may include at least one of the number of non-zero coefficients of the default block, the sum of absolute values of coefficients, the sum of absolute values of weights, the sum of representation syntax elements, the sum of greater-than-threshold flags, etc.
[0191] Optionally, the coefficient information of the neighboring block may include at least one of the number of non-zero coefficients of the neighboring block, the sum of absolute values of coefficients, the sum of absolute values of weighted numbers, the sum of syntax elements, the sum of greater-than-threshold flags, etc.
[0192] Optionally, the coefficient information of the non-neighboring block may include at least one of the number of non-zero coefficients of the non-neighboring block, the sum of the absolute values of the coefficients, the sum of the absolute values of the weighted numbers, the sum of the representation syntax elements, the sum of the greater-than-threshold flags, etc.
[0193] Optionally, the coefficient information of the co-located block may include at least one of the number of non-zero coefficients of the co-located block, the sum of absolute values of coefficients, the sum of absolute values of weights, the sum of syntax elements, the sum of greater-than-threshold flags, etc.
[0194] Optionally, the coefficient information of the time domain block may include at least one of the number of non-zero coefficients of the time domain block, the sum of absolute values of coefficients, the sum of absolute values of weights, the sum of syntax elements, the sum of greater-than-threshold flags, etc.
[0195] Optionally, the size parameter may include the size of the block.
[0196] Alternatively, the position may comprise the position of the coefficients of the block in the block.
[0197] Optionally, certain rules may be set in advance, for example, when the coefficient information, and / or position, and / or size parameters of a block meet certain conditions, the transform coefficient representation method includes using six syntax elements arranged in a certain order to represent the transform coefficients.
[0198] Optionally, a certain block may be a default block, a neighbor block, a non-neighbor block, a co-located block, and / or a time-domain block.
[0199] Optionally, at least one transform coefficient representation mode can be selected from at least two transform coefficient representation modes based on coefficient information of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block, and / or position and / or size parameters.
[0200] Optionally, at least two available transform coefficient representations may be determined based on coefficient information of at least one of a default block, a neighboring block, a non-neighboring block, a co-located block, and a time-domain block corresponding to the transform block. For example, the transform coefficient representation adopted by the default block, the neighboring block, the non-neighboring block, the co-located block, and the time-domain block is used as the available transform coefficient representation, and then at least one transform coefficient representation is selected from the at least two available transform coefficient representations based on position and / or size parameters corresponding to at least one of the default block, the neighboring block, the non-neighboring block, the co-located block, and the time-domain block corresponding to the transform block. Optionally, at least two available transform coefficient representations may be determined based on coefficient information and / or position and / or size parameters of at least one of the default block, the neighboring block, the non-neighboring block, the co-located block, and the time-domain block corresponding to the transform block, and then at least one transform coefficient representation is selected from the at least two available transform coefficient representations based on scanned neighbor coefficient information of the transform coefficient.
[0201] Optionally, at the encoder, a transform coefficient level corresponding to the transform coefficient may be represented as a syntax element sequence based on coefficient information of at least one of a default block, a neighboring block, a non-neighboring block, a co-located block, and a time-domain block corresponding to the transform block, and / or a transform coefficient representation determined or obtained based on position and / or size parameters. The value of each syntax element in the syntax element sequence is entropy encoded using a context model and written into the bitstream. The decoder obtains the value of each syntax element in the syntax element sequence from the bitstream through entropy decoding, and the value of the syntax element may be obtained by entropy decoding the syntax element based on the context model corresponding to the syntax element.
[0202] Optionally, the decoding end can also determine or obtain at least one transform coefficient representation based on the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or position and / or size parameters.
[0203] Optionally, at least one transform coefficient representation is determined or obtained based on the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or position and / or size parameters, and entropy encoding and / or entropy decoding is performed based on the at least one transform coefficient representation and the context model.
[0204] Optionally, by determining or obtaining a transform coefficient representation based on coefficient information of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block, and / or position and / or size parameters, the defect of low efficiency caused by randomly selecting a transform coefficient representation can be avoided, and the accuracy and effectiveness of the determined or obtained transform coefficient representation is improved, thereby improving the efficiency of video encoding and / or decoding.
[0205] Method three, determining or obtaining according to the position and / or size parameters corresponding to the transformation block;
[0206] Optionally, the third method may include determining at least one transform coefficient representation method according to a position of at least one transform block coefficient in the transform block and / or a size parameter of the transform block.
[0207] Optionally, at least one transform coefficient representation mode may be selected from at least two transform coefficient representation modes according to position and / or size parameters corresponding to the transform block.
[0208] Optionally, at least two available transform coefficient representations can be determined or obtained based on the scanned neighbor coefficient information of the transform coefficient, and / or based on the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or position and / or size parameters. Among the at least two available transform coefficient representations, at least one transform coefficient representation is selected based on the position and / or size parameters corresponding to the transform block.
[0209] Optionally, certain selection rules may be set. For example, when a position corresponding to a transform block satisfies a certain position condition, a transform coefficient representation method corresponding to the position condition may be determined. For example, when the sum of the horizontal and vertical coordinates corresponding to the transform block is greater than a preset value, the transform coefficient representation method includes representing the transform coefficient using six syntax elements arranged in a certain order, that is, representing the transform coefficient as a syntax element sequence.
[0210] Optionally, at the encoder, based on the position and / or size parameters corresponding to the transform block, a transform coefficient representation is determined or obtained, the transform coefficient level corresponding to the transform coefficient is represented as a syntax element sequence, and the value of each syntax element in the syntax element sequence is entropy encoded using a context model and written into the bitstream. The decoder obtains the value of each syntax element in the syntax element sequence by entropy decoding the bitstream, and the value of the syntax element may be obtained by entropy decoding the syntax element according to the context model corresponding to the syntax element.
[0211] Optionally, the decoding end may also determine or obtain at least one transform coefficient mode according to position and / or size parameters corresponding to the transform block.
[0212] Optionally, at least one transform coefficient representation is determined or obtained according to a position and / or size parameter corresponding to the transform block, and entropy encoding and / or entropy decoding is performed according to the at least one transform coefficient representation and a context model.
[0213] Optionally, by determining or obtaining a transform coefficient representation based on the position and / or size parameters corresponding to the transform block, it is possible to ensure that the determined or obtained transform coefficient representation is closely related to the current transform coefficient, thereby improving the accuracy and effectiveness of the determined or obtained transform coefficient representation, and thereby improving video encoding and / or decoding efficiency.
[0214] Method 4: determining or obtaining a candidate representation list based on information of the transform block; determining or obtaining based on the candidate representation list;
[0215] Optionally, the information of the transform block may include correlation coefficient information at the block level, and may also include coefficient information of at least one transform coefficient in the transform block.
[0216] Optionally, the candidate representation list may include at least one transform coefficient representation. Optionally, the candidate representation list stores the representations most likely to be used for the current transform coefficient, also known as a most probable representation list. For example, if there are 10 available representations, the candidate representation list stores the five most likely representations.
[0217] Optionally, when determining or obtaining a candidate representation list based on information of a transform block, if there are at least two transform coefficient representations in the candidate representation list, at least one transform coefficient representation can be selected from the at least two transform coefficient representations in the candidate representation list based on the scanned neighbor coefficient information of the transform coefficient, and / or the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or the position and / or size parameters, and / or the position and / or size parameters corresponding to the transform block.
[0218] Optionally, at least one available transform coefficient representation can be determined based on the information of the transform block, and then a candidate representation list can be constructed based on the at least one available transform coefficient representation, and then a hit transform coefficient representation can be determined from the candidate representation list, and then the transform coefficient can be represented according to the transform coefficient representation, such as representing the transform coefficient as a syntax element arranged in a certain order, or the candidate representation list can be updated, and then a hit transform coefficient representation can be determined from the updated candidate representation list, and then the transform coefficient can be represented according to the transform coefficient representation.
[0219] Optionally, when determining or obtaining at least one transform coefficient representation based on the candidate representation list, the cost of using each transform coefficient representation in the candidate representation list to represent at least one transform coefficient in the transform block can be determined, sorted according to the cost, and at least one transform coefficient representation is selected based on the sorting result, and then at least one transform coefficient in the transform block is represented as a sequence of syntax elements according to the transform coefficient representation.
[0220] Optionally, the syntax element sequence may include syntax elements arranged in a certain order, and the syntax element sequence may represent a representation result of a transform coefficient. For example, [sig, gt1, par, gt3, rem, sign] = [1, 0, 1, 0, 2, 0] is a syntax element sequence of a transform coefficient. The encoder performs entropy encoding on the values of the syntax element sequence [sig, gt1, par, gt3, rem, sign], i.e., [1, 0, 1, 0, 2, 0], and writes it into the bitstream. The decoder obtains the values of the syntax element sequence [sig, gt1, par, gt3, rem, sign], i.e., [1, 0, 1, 0, 2, 0], from the bitstream through entropy decoding.
[0221] Optionally, the encoding end may determine or obtain a candidate representation list based on information of the transform block, determine or obtain at least one transform coefficient representation based on the candidate representation list, and represent at least one transform coefficient in the transform block as a syntax element sequence based on the transform coefficient representation.
[0222] Optionally, the decoding end may determine or obtain a candidate representation list based on information of the transform block, determine or obtain at least one transform coefficient representation based on the candidate representation list, determine at least one transform coefficient representation corresponding to an index of the bitstream in the candidate representation list, and represent at least one transform coefficient in the transform block as a sequence of syntax elements based on the transform coefficient representation.
[0223] Optionally, the decoding end may obtain the value of the syntax element sequence from the bitstream entropy decoding.
[0224] Optionally, a candidate representation list is determined or obtained based on information of the transform block, at least one transform coefficient representation is determined or obtained based on the candidate representation list, and entropy encoding and / or entropy decoding is performed based on the at least one transform coefficient representation and a context model.
[0225] Optionally, by determining or obtaining a candidate representation list based on the information of the transform block, and determining or obtaining the transform coefficient representation method based on the candidate representation list, the candidate representation list can be used to improve the hit rate of the transform coefficient representation method, reduce signaling overhead, and thereby improve video encoding and / or decoding efficiency.
[0226] Method 5: If the transform block is to be entropy coded, the transform coefficients corresponding to the transform block are determined or obtained;
[0227] Optionally, at the encoding end (ie, encoding side), information of the transform coefficient corresponding to the transform block may be determined, such as the transform coefficient of the last scanned bit, the position of the transform coefficient in the transform block, coefficients of neighboring blocks, etc.
[0228] Optionally, at least one transform coefficient representation is determined or obtained from a plurality of preset transform coefficient representations based on the information about the transform coefficients corresponding to the transform block. For example, the costs and / or expenses of the plurality of preset transform coefficient representations are calculated based on the information about the transform coefficients corresponding to the transform block, the plurality of transform coefficient representations are then sorted based on the costs and / or expenses, and at least one transform coefficient representation is selected based on the sorting result, for example, the transform coefficient representation with the lowest cost is selected.
[0229] Optionally, if the transform block is to be entropy coded, at least one transform coefficient representation is selected from at least two transform coefficient representations according to information of the transform coefficients corresponding to the transform block.
[0230] Optionally, if the transform block is to be entropy coded, at least two available transform coefficient representations may be determined or obtained based on scanned neighbor coefficient information of the transform coefficient, and / or based on coefficient information and / or position and / or size parameters of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time-domain block corresponding to the transform block, and / or position and / or size parameters corresponding to the transform block, and then at least one transform coefficient representation may be selected from the at least two available transform coefficient representations based on the transform coefficient information corresponding to the transform block. Optionally, at least one transform coefficient representation may be selected based on the transform coefficient information corresponding to the transform block in a candidate representation list.
[0231] Optionally, if the transform block is to be entropy coded, at least one transform coefficient representation is determined or obtained based on information of the transform coefficient corresponding to the transform block, and entropy coding is performed based on the at least one transform coefficient representation and a context model.
[0232] Optionally, the transform coefficients are represented as a syntax element sequence according to at least one transform coefficient representation mode, and entropy coding is performed on a value of each syntax element in the syntax element sequence according to a context model.
[0233] Optionally, on the encoding side, by determining or obtaining the transform coefficient representation based on the information of the transform coefficient corresponding to the transform block, the low efficiency defect caused by randomly selecting the transform coefficient representation can be avoided, the accuracy and effectiveness of the determined or obtained transform coefficient representation can be improved, and the video encoding and / or decoding efficiency can be improved.
[0234] Method six: if the transformed block is to be entropy decoded, it is determined or obtained according to the index obtained from the bitstream.
[0235] Alternatively, at the decoding end (i.e., the decoding side), when a transform block is to be entropy decoded, an index in the bitstream may be obtained, and a corresponding transform coefficient representation may be searched for in a plurality of preset transform coefficient representations based on the index. Alternatively, a corresponding transform coefficient representation may be searched for in a candidate representation list based on the index.
[0236] Optionally, if the transform block is to be entropy decoded, at least one transform coefficient representation is selected from at least two transform coefficient representations according to an index obtained from the bitstream.
[0237] Optionally, if the transform block is to be entropy decoded, at least two available transform coefficient representations may be determined or obtained based on scanned neighbor coefficient information of the transform coefficient and / or coefficient information and / or position and / or size parameters of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time-domain block corresponding to the transform block, and / or position and / or size parameters corresponding to the transform block. Then, at least one transform coefficient representation may be selected from the at least two available transform coefficient representations based on an index obtained from the bitstream. Alternatively, at least one transform coefficient representation may be selected from a candidate representation list based on an index obtained from the bitstream.
[0238] Optionally, if the transform block is to be entropy decoded, at least one transform coefficient representation is determined or obtained according to an index obtained from the bitstream, and entropy decoding is performed according to the at least one transform coefficient representation and a context model.
[0239] Optionally, entropy decoding may be performed on data in the code stream according to the context model to obtain values of a syntax element sequence.
[0240] Optionally, on the decoding side, by determining or obtaining a transform coefficient representation based on an index obtained from the bitstream, an accurate and effective transform coefficient representation can be quickly determined, thereby improving video encoding and / or decoding efficiency.
[0241] Optionally, determining or obtaining the candidate representation list according to the information of the transform block in the fourth manner may include at least one of the following manners 1 to 6:
[0242] Mode 1: construct or update the candidate representation list based on coefficient information and / or position and / or size parameters of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block;
[0243] Optionally, at least one available transform coefficient representation is determined or obtained based on coefficient information of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time-domain block corresponding to the transform block, and / or position and / or size parameters, and the at least one available transform coefficient representation is stored in a list to construct a candidate representation list. Alternatively, the at least one available transform coefficient representation is updated to the candidate representation list, for example, the at least one available transform coefficient representation is added to the candidate representation list.
[0244] Optionally, the specific steps for determining or obtaining at least one available transform coefficient representation method may be described with reference to the above-mentioned method 2, which will not be repeated here, based on the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or the position and / or size parameters.
[0245] Optionally, a candidate representation list is constructed or updated based on the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or position and / or size parameters, and at least one transform coefficient representation is determined or obtained based on the constructed or updated candidate representation list, and entropy encoding and / or entropy decoding is performed based on the at least one transform coefficient representation and the context model.
[0246] Optionally, by constructing or updating a candidate representation list based on the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or position and / or size parameters, the hit rate of the transform coefficient representation method can be improved by means of the candidate representation list, the signaling overhead can be reduced, and the video encoding and / or decoding efficiency can be improved.
[0247] Method 2: construct or update the candidate representation list based on the scanned neighbor coefficient information of the transform coefficient;
[0248] Optionally, at least one available transform coefficient representation is determined or obtained based on the scanned neighbor coefficient information of the transform coefficient, and the at least one available transform coefficient representation is stored in a list to construct a candidate representation list. Alternatively, the at least one available transform coefficient representation is updated to the candidate representation list, for example, by adding the at least one available transform coefficient representation to the candidate representation list.
[0249] Optionally, the specific steps of determining or obtaining at least one available transform coefficient representation method based on the scanned neighbor coefficient information of the transform coefficient can refer to the above-mentioned method 1 and will not be repeated here.
[0250] Optionally, a candidate representation list is constructed or updated based on the scanned neighbor coefficient information of the transform coefficient, and at least one transform coefficient representation is determined or obtained based on the constructed or updated candidate representation list, and entropy encoding and / or entropy decoding is performed based on the at least one transform coefficient representation and the context model.
[0251] Optionally, by constructing or updating a candidate representation list based on the scanned neighbor coefficient information of the transform coefficient, the hit rate of the transform coefficient representation method can be improved through the candidate representation list, the signaling overhead can be reduced, and the video encoding and / or decoding efficiency can be improved.
[0252] Method 3: construct or update the candidate representation list according to the position and / or size parameters corresponding to the transform block;
[0253] Optionally, at least one available transform coefficient representation is determined or obtained based on a position and / or size parameter corresponding to the transform block, and the at least one available transform coefficient representation is stored in a list to construct a candidate representation list. Alternatively, the at least one available transform coefficient representation is updated to the candidate representation list, for example, the at least one available transform coefficient representation is added to the candidate representation list.
[0254] Optionally, the specific steps of determining or obtaining at least one available transform coefficient representation method according to the position and / or size parameters corresponding to the transform block may refer to the above-mentioned method three and will not be repeated here.
[0255] Optionally, a candidate representation list is constructed or updated based on the position and / or size parameters corresponding to the transform block, and at least one transform coefficient representation is determined or obtained based on the constructed or updated candidate representation list, and entropy encoding and / or entropy decoding is performed based on the at least one transform coefficient representation and the context model.
[0256] Optionally, by constructing or updating a candidate representation list based on the position and / or size parameters corresponding to the transform block, the hit rate of the transform coefficient representation method can be improved by means of the candidate representation list, the signaling overhead can be reduced, and the video encoding and / or decoding efficiency can be improved.
[0257] Method 4: construct or update the candidate representation list according to the default candidate representation method;
[0258] Optionally, the default candidate representation may be an available transform coefficient representation set in advance.
[0259] Alternatively, a default candidate representation may be determined at the encoder and / or decoder, and then added to a preset empty table to construct a default candidate representation. Alternatively, the default candidate representation may be updated to a candidate representation list, for example, by adding the default candidate representation to the candidate representation list. Optionally, the candidate representation list stores at least one transform coefficient representation.
[0260] Optionally, a candidate representation list is constructed or updated according to a default candidate representation, and at least one transform coefficient representation is determined or obtained based on the constructed or updated candidate representation list, and entropy encoding and / or entropy decoding is performed according to the at least one transform coefficient representation and the context model.
[0261] Optionally, by constructing or updating a candidate representation list according to a default candidate representation, the hit rate of the transform coefficient representation can be improved through the candidate representation list, signaling overhead can be reduced, and video encoding and / or decoding efficiency can be improved.
[0262] Method 5: construct or update the candidate representation list according to the coefficient representation of the neighboring block;
[0263] Optionally, the coefficient representation of the neighboring block may include a transform coefficient representation corresponding to at least one scanned transform coefficient in the neighboring block.
[0264] Optionally, transform coefficient representations corresponding to all transform coefficients in at least one neighboring block are determined, and the transform coefficient representations are stored in a spare table to construct a candidate representation list, or the candidate representation list is updated according to the transform coefficient representations.
[0265] Optionally, the candidate representation list is constructed or updated according to coefficient representations corresponding to non-neighboring blocks, co-located blocks, time-domain blocks, or other forms of blocks.
[0266] Optionally, a candidate representation list is constructed or updated according to the coefficient representation of the neighboring block, and at least one transform coefficient representation is determined or obtained based on the constructed or updated candidate representation list, and entropy encoding and / or entropy decoding is performed according to the at least one transform coefficient representation and the context model.
[0267] Optionally, by constructing or updating a candidate representation list based on the coefficient representation of neighboring blocks, the hit rate of the transform coefficient representation can be improved through the candidate representation list, signaling overhead can be reduced, and video encoding and / or decoding efficiency can be improved.
[0268] Method 6: sort at least two candidate representations according to their costs, and construct or update the candidate representation list according to the sorting result.
[0269] Optionally, at least two candidate representations can be obtained, and the candidate representations can be determined by any of the methods described above, such as determining at least two candidate representations based on the position and / or size parameters corresponding to the transform block, calculating the costs corresponding to the at least two candidate representations, such as rate-distortion costs, and then sorting according to the costs of the at least two candidate representations, such as sorting from large to small according to the numerical value of the costs, to obtain a sorting result. At least one candidate representation can be randomly selected based on the sorting result, and at least one candidate representation can be added to an empty table to construct a candidate representation list, or at least one candidate representation can be updated to a candidate representation list having at least one transform coefficient representation.
[0270] Optionally, at least two candidate representations are sorted according to their costs, a candidate representation list is constructed or updated according to the sorting result, and at least one transform coefficient representation is determined or obtained based on the constructed or updated candidate representation list, and entropy encoding and / or entropy decoding is performed according to the at least one transform coefficient representation and the context model.
[0271] Optionally, as shown in FIG6 , an example is given of generating a candidate representation list for a current block. The current block may include one transform block or multiple transform blocks. Optionally, one transform block may include a combination of one or more transform coefficients.
[0272] Optionally, as shown in FIG6 , a corresponding transform coefficient representation is obtained from the coded block. There are three transform coefficient representations for neighboring blocks, i.e., the three representations are numbered 5, 3, and 2. There are three transform coefficient representations for other blocks (e.g., non-neighboring blocks or co-located blocks in a co-located map), i.e., the three representations are numbered 1, 7, and 4. Optionally, a default representation (i.e., a default transform coefficient representation) may be obtained, which corresponds to number 0, and then 7 transform coefficient representations may be obtained for the current block, and the cost of entropy coding may be calculated for the 7 transform coefficient representations, which may be the number of bits required to entropy code the transform coefficients of the current block.
[0273] Optionally, the cost may be calculated by obtaining an average value of the transformation coefficients of the current block from the coefficient values of the neighbor coefficients, and then simulating entropy coding to obtain the cost of entropy coding.
[0274] Optionally, the cost can be calculated by obtaining the average value of the transform coefficients of the current block from the coefficient values of the neighboring coefficients, and then obtaining the entropy coding cost corresponding to each transform coefficient from the lookup table, and accumulating the entropy coding cost of the block. For example, the entropy coding costs for the seven transform coefficient representations shown in Figure 6 are obtained, namely: cost(5)=23043, cost(1)=132454, cost(0)=13232, cost(3)=433433, cost(7)=54545, cost(4)=75973, cost(2)=102366. Then the list shown in Figure 6 is obtained, including the representation number (i.e., the number corresponding to the transform coefficient representation) and the cost:
[0275] For example, the cost of number 5 corresponding to the transform coefficient representation is 23043;
[0276] The cost of number 1 corresponding to the transform coefficient representation is 132454;
[0277] The cost of number 0 corresponding to the transform coefficient representation is 13232;
[0278] The cost of number 3 corresponding to the transform coefficient representation is 433433;
[0279] The cost of number 7 corresponding to the transform coefficient representation is 54545;
[0280] The cost of number 4 corresponding to the transform coefficient representation is 75973;
[0281] The cost corresponding to the number 2 corresponding to the transform coefficient representation is 102366.
[0282] Then, the 7 entropy coding costs are sorted, and the top 5 transform coefficient representations can be taken to obtain a candidate representation list [0, 5, 7, 4, 2].
[0283] Optionally, by sorting according to the costs of at least two candidate representations, constructing or updating a candidate representation list based on the sorting results, the hit rate of the transform coefficient representation can be improved by means of the candidate representation list, the signaling overhead can be reduced, and the video encoding and / or decoding efficiency can be improved.
[0284] Third embodiment
[0285] Based on any of the above embodiments, a third embodiment is proposed.
[0286] In this embodiment, step S20 includes the following steps:
[0287] S21, determining or obtaining a syntax element corresponding to the transform coefficient according to a transform coefficient representation method;
[0288] Optionally, after at least one transform coefficient representation is determined or obtained based on the scanned neighbor coefficient information of the transform coefficient, a syntax element sequence corresponding to the transform coefficient representation is determined, and the transform coefficient is represented according to the syntax element sequence.
[0289] Optionally, the syntax element sequence may include at least one syntax element and the order of each syntax element. For example, [sig, gt1, par, gt3, rem, sign] = [1, 0, 1, 0, 2, 0] is a syntax element sequence of a transform coefficient.
[0290] Optionally, if at least one transform coefficient representation is determined or obtained based on the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or the position and / or size parameters, it is necessary to determine the transform coefficient representation corresponding to the transform block and the current transform coefficient based on the at least one transform coefficient representation (for example, randomly select the transform coefficient representation corresponding to the current transform coefficient, or determine the transform coefficient representation corresponding to the current transform coefficient based on the calculated cost, etc.), determine the syntax element sequence corresponding to the transform coefficient representation, and represent the transform coefficient according to the syntax element sequence.
[0291] Optionally, if at least one transform coefficient representation is determined or obtained based on the position and / or size parameters corresponding to the transform block, the transform coefficient representation corresponding to the at least one transform coefficient can be determined by random selection from the determined at least one transform coefficient representation, or by calculating the cost corresponding to each transform coefficient representation, and a syntax element sequence corresponding to the transform coefficient representation can be determined, and the transform coefficient can be represented according to the syntax element sequence.
[0292] Optionally, if a candidate representation list is determined or obtained based on information of the transform block, at least one transform coefficient representation is determined or obtained based on the candidate representation list, a syntax element sequence corresponding to the transform coefficient representation is determined, and the transform coefficient is represented according to the syntax element sequence.
[0293] Optionally, if the transform block is to be entropy coded, at least one transform coefficient representation is determined or obtained based on information of the transform coefficient corresponding to the transform block, a syntax element sequence corresponding to the transform coefficient representation is determined, and the transform coefficient is represented according to the syntax element sequence.
[0294] Optionally, if the transform block is to be entropy decoded, at least one transform coefficient representation is determined or obtained based on the index obtained in the bitstream, such as determining or obtaining the transform coefficient representation corresponding to the index in a candidate representation list, or determining the transform coefficient representation corresponding to the index in multiple transform coefficient representations, and representing the transform coefficient according to the syntax element sequence corresponding to the determined transform coefficient representation.
[0295] Optionally, step S21 includes: scanning the transform block according to a preset scanning order, and determining or obtaining syntax elements corresponding to transform coefficients in the scanned transform block according to a transform coefficient representation method;
[0296] Optionally, a pre-set scanning order may be obtained, such as reverse diagonal scanning, etc. Then, the transform block is scanned according to the preset scanning order. Optionally, all transform coefficients in the transform block may be scanned according to the preset scanning order.
[0297] Optionally, for the transform coefficients in the scanned transform block, the transform coefficients may be represented by syntax elements according to the scanned transform block or a transform coefficient representation method corresponding to the transform coefficients in the scanned transform block, and arranged in a certain arrangement order.
[0298] Optionally, when the transform coefficient is represented by the transform coefficient representation, the transform coefficient level corresponding to the transform coefficient may be represented by the transform coefficient representation, and the transform coefficient level may be represented as a sequence of syntax elements in a certain arrangement order.
[0299] Optionally, the syntax element includes at least one of the following: a first flag that is smaller than a threshold; a second flag that is larger than a threshold; a third flag that is smaller than or equal to a threshold; and a fourth flag that is larger than or equal to a threshold.
[0300] Optionally, the first flag may be a flag indicating that the transform coefficient representation syntax element includes at least one value that is less than a threshold.
[0301] Optionally, the second flag may be a flag indicating that the transform coefficient representation syntax element includes at least one value greater than a threshold.
[0302] Optionally, the third flag may be a flag indicating that the transform coefficient representation syntax element includes at least one value that is less than or equal to a threshold.
[0303] Optionally, the fourth flag may be a flag indicating that the transform coefficient representation syntax element includes at least one value greater than or equal to a threshold.
[0304] Optionally, the threshold may be any value set in advance.
[0305] Optionally, the threshold corresponding to the first flag, the threshold corresponding to the second flag, the threshold corresponding to the third flag, and the threshold corresponding to the fourth flag may be the same or different, for example, gtx = greater than x, stx = smaller / less than x.
[0306] Optionally, the syntax elements may be sig_coeff_flag, abs_level_gt1_flag, par_level_flag, abs_level_gt3_flag, and the like.
[0307] Optionally, the syntax elements in the transform coefficient representation method may include a coefficient non-zero flag, a parity check flag, a greater than a threshold flag, a remainder, a sign flag, and the like.
[0308] For example, the transform coefficient absolute value level corresponding to the transform coefficient may be represented according to the corresponding transform coefficient representation method, as shown in Table 1 below.
[0309] Table 1
[0310] Optionally, the transform coefficient absolute value level abs_coeff_level is represented using a transform coefficient representation, such as sig, gt1, par, gt3, and rem.
[0311] Optionally, the transform coefficient coeff=abs_coeff_level*(1-2*coeff_sign_flag). Optionally, coeff_sign_flag adopts bypass coding.
[0312] Optionally, the reconstruction process of the transform coefficient representation can be expressed at the decoding end. Optionally, the default values of sig, gt1, par, gt3 and rem are set to 0.
[0313] Optionally, the decoder obtains the context of sig and uses the context to read a bit value from the binary code stream as the value of sig. If the value of sig is 0, it means that abs_coeff_level is equal to 0.
[0314] Optionally, the decoder obtains the context of gt1 and uses the context to read a bit value from the binary stream as the value of gt1. If the value of gt1 is 0, it means that abs_coeff_level is less than or equal to 1.
[0315] Optionally, the decoder obtains the context of par and uses the context to read a bit value from the binary stream as the value of par. If the value of par is 0, it means that abs_coeff_level is an even number, otherwise it is an odd number.
[0316] Optionally, the decoder obtains the context of gt3 and uses the context to read a bit value from the binary stream as the value of gt3. If the value of gt3 is 0, it means that abs_coeff_level is less than or equal to 3.
[0317] Optionally, the decoding end reads a plurality of bypass-coded bits from the binary code stream and performs inverse Golomb-nice binarization as the value of rem.
[0318] Alternatively, bypass coding is a simplification of CABAC, making the probabilities equal.
[0319] Optionally, abs_coeff_level=sig+gt1+par+2*gt3+2*rem is calculated.
[0320] For example, the transform coefficient absolute value level corresponding to the transform coefficient can be represented according to the corresponding transform coefficient representation method, such as shown in the following Table 2. Table 2
[0321] Optionally, the transform coefficient absolute value level abs_coeff_level is represented using a transform coefficient representation, such as sig, gt1, par, gt3, gt5, and rem.
[0322] Optionally, the transformation coefficient coeff=abs_coeff_level*(1-2*coeff_sign_flag).
[0323] Optionally, coeff_sign_flag is bypass coded.
[0324] Optionally, the reconstruction process of the transform coefficient representation may be expressed at the decoding end.
[0325] Optionally, the default values of sig, gt1, par, gt3, gt5, and rem are set to 0.
[0326] Optionally, the decoder obtains the context of sig and uses the context to read a bit value from the binary code stream as the value of sig. If the value of sig is 0, it means that abs_coeff_level is equal to 0.
[0327] Optionally, the decoder obtains the context of gt1 and uses the context to read a bit value from the binary stream as the value of gt1. If the value of gt1 is 0, it means that abs_coeff_level is less than or equal to 1.
[0328] Optionally, the decoder obtains the context of par and uses the context to read a bit value from the binary stream as the value of par. If the value of par is 0, it means that abs_coeff_level is an even number, otherwise it is an odd number.
[0329] Optionally, the decoder obtains the context of gt3 and uses the context to read a bit value from the binary stream as the value of gt3. If the value of gt3 is 0, it means that abs_coeff_level is less than or equal to 3.
[0330] Optionally, the decoder obtains the context of gt5 and uses the context to read a bit value from the binary stream as the value of gt5. If the value of gt5 is 0, it means that abs_coeff_level is less than or equal to 5.
[0331] Optionally, the decoding end reads a plurality of bypass-coded bits from the binary code stream and performs inverse Golomb-nice binarization as the value of rem.
[0332] Alternatively, bypass coding is a simplification of CABAC, making the probabilities equal.
[0333] Optionally, abs_coeff_level=sig+gt1+par+2*gt3+2*gt5+2*rem is calculated.
[0334] For example, the transform coefficient absolute value level corresponding to the transform coefficient may be represented according to the corresponding transform coefficient representation method, such as shown in Table 3 below.
[0335] Table 3
[0336] Optionally, the transform coefficient absolute value level abs_coeff_level is represented by a transform coefficient representation, such as sig, gt1, gt2, gt3, gt4, gt5, par, and rem.
[0337] Optionally, the transformation coefficient coeff=abs_coeff_level*(1-2*coeff_sign_flag).
[0338] Optionally, coeff_sign_flag is bypass coded.
[0339] Optionally, the reconstruction process of the transform coefficient representation may be expressed at the decoding end.
[0340] Optionally, the default values of sig, gt1, gt2, gt3, gt4, gt5, par, and rem are set to 0.
[0341] Optionally, the decoder obtains the context of sig and uses the context to read a bit value from the binary code stream as the value of sig. If the value of sig is 0, it means that abs_coeff_level is equal to 0.
[0342] Optionally, the decoder obtains the context of gt1 and uses the context to read a bit value from the binary stream as the value of gt1. If the value of gt1 is 0, it means that abs_coeff_level is less than or equal to 1.
[0343] Optionally, the decoder obtains the context of gt2 and uses the context to read a bit value from the binary stream as the value of gt2. If the value of gt2 is 0, it means that abs_coeff_level is less than or equal to 2.
[0344] Optionally, the decoder obtains the context of gt3 and uses the context to read a bit value from the binary stream as the value of gt3. If the value of gt3 is 0, it means that abs_coeff_level is less than or equal to 3.
[0345] Optionally, the decoder obtains the context of gt4 and uses the context to read a bit value from the binary stream as the value of gt4. If the value of gt4 is 0, it means that abs_coeff_level is less than or equal to 4.
[0346] Optionally, the decoder obtains the context of gt5 and uses the context to read a bit value from the binary stream as the value of gt5. If the value of gt5 is 0, it means that abs_coeff_level is less than or equal to 5.
[0347] Optionally, the decoder obtains the context of par and uses the context to read a bit value from the binary stream as the value of par. If the value of par is 0, it means that abs_coeff_level is an even number, otherwise it is an odd number.
[0348] Optionally, the decoder reads a plurality of bypass-coded bits from the binary code stream and performs inverse Golomb-nice binarization as the value of rem. Optionally, bypass coding is a special case of CABAC, which performs entropy coding in an equal probability manner without context updating.
[0349] Alternatively, abs_coeff_level=sig+gt1+gt2+gt3+gt4+gt5+par+2*rem is calculated.
[0350] Optionally, the context selection for the transform coefficients may be performed as follows: For example, the context process of gt1, gt3, and par at the (xC, yC) position of a luminance (Luma) block is obtained.
[0351] Optionally, the context of the chroma block or different representation elements, such as sig, is obtained differently.
[0352] Optionally, (xC, yC) is a coordinate indicating the position of the current transform coefficient in the block, for example (2, 2) indicates the transform coefficient in the second row and second column.
[0353] Optionally, locNumSig and locSumAbsPass1 are calculated based on the neighboring transform coefficient information. Calculate ctxOffset=Min(locSumAbsPass1-locNumSig, 4).
[0354] Alternatively, d = xC + xY is calculated. If (xC, yC) is the position of the last non-zero coefficient in the coefficient group / block, then ctxlnc = 0. Otherwise, ctxlnc = 1 + ctxOffset + (d == 0?15: (d < 3?10: (d < 10?5: 0))).
[0355] Optionally, the calculated ctxlnc is the context of par and gt1, and the context index of gt3 is ctxlnc+32.
[0356] Optionally, ctxldx=ctxlnc+ctxOffset.
[0357] Optionally, ctxOffset is determined by whether the currently encoded frame is an I frame, a P frame, or a B frame.
[0358] Optionally, the variable of ctxldx to context of par can be as shown in Figure 7.
[0359] Optionally, d is temporary data, indicating coordinates and ctxldx is the context index.
[0360] Initialization variable is the initialization variable.
[0361] initvalue is the initial value, or initial probability value.
[0362] shiftIdx is the shift value used to derive the state transition process.
[0363] S22: Perform entropy encoding and / or entropy decoding on the syntax elements according to the context model.
[0364] Optionally, on the encoding side, for each syntax element in each transform block, a context model corresponding to the syntax element may be determined, and entropy coding, such as arithmetic coding, may be performed on the syntax element according to the context model.
[0365] Optionally, at the decoding end, for each syntax element in each transform block, a context model corresponding to the syntax element may be determined, and entropy decoding may be performed on the syntax element according to the context model.
[0366] Optionally, the context models corresponding to each grammatical element may be the same or different.
[0367] Optionally, the context model classifies each binary symbol of the CABAC input, such as classifying the number corresponding to each syntax element of the input.
[0368] Optionally, step S22 includes: determining or obtaining the number of syntax elements corresponding to the transform coefficients and the order of the syntax elements; if there are multiple syntax elements, entropy encoding and / or entropy decoding the syntax elements according to the order of the syntax elements and the context model.
[0369] Optionally, during entropy coding, the number of syntax elements corresponding to the transform coefficients and the order of the syntax elements may be determined or obtained based on the transform coefficient representation corresponding to the transform coefficients. For example, if the transform coefficient representation is three syntax elements arranged in order a, then the number of syntax elements may be determined to be three, and the order of the syntax elements may be in order a.
[0370] Optionally, if there are multiple syntax elements corresponding to the transform coefficients, each syntax element can be traversed in the order of the syntax elements, and the traversed syntax elements can be entropy encoded and / or entropy decoded according to the context model corresponding to the traversed syntax elements.
[0371] The following is an example. For example, as shown in FIG8 , a residual block of 8×16 is divided into 8 (2×4) 4×4 coefficient groups, each of which includes multiple transform coefficients, such as r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, and r15.
[0372] Optionally, each coefficient group can be entropy coded as a separate transform coefficient block. The eight coefficient groups in Figure 8 are scanned in a predetermined order, such as the reverse diagonal scan order shown in Figure 9 , starting from the bottom and scanning each 45-degree diagonal line in turn, and scanning each diagonal line from right to left. Optionally, the residual block containing the residual items r0-r15 in Figure 8 is the fifth block to be coded.
[0373] Optionally, the r0-r15 residual items in FIG8 are transformed and quantized to obtain the 4×4 transform coefficient block shown in Table 4.
[0374] Table 4
[0375] Optionally, when performing the transformation and quantization processing, the transformation and quantization processing may be performed according to the following transformation and quantization formula, namely:
[0376] Optionally, ICT is a two-dimensional integer cosine transform, and Q is a quantization operation.
[0377] Alternatively, the 4x4 transform coefficient block shown in Table 4 is scanned in the reverse diagonal scanning order shown in FIG10 to obtain the transform coefficient sequence: 0, 0, 1, 0, 1, 0, -1, -2, -2, -1, -3, 1, 5, -3, -2, -12. Entropy coding of the residual block in FIG8 is equivalent to encoding eight sequences of 16 integers.
[0378] Optionally, the fifth sequence is [0, 0, 1, 0, 1, 0, -1, -2, -2, -1, -3, 1, 5, -3, -2, -12].
[0379] In this embodiment, by determining or obtaining syntax elements corresponding to transform coefficients according to a transform coefficient representation mode, and scanning a transform block according to a preset scanning order, and determining or obtaining syntax elements corresponding to transform coefficients in the scanned transform block according to the transform coefficient representation mode, it is possible to represent the transform coefficients using syntax elements according to the transform coefficient representation mode, and then entropy encoding and / or entropy decoding the syntax elements according to a context model. Furthermore, by determining or obtaining the number of syntax elements corresponding to the transform coefficients and the order of the syntax elements, and when there are multiple syntax elements, entropy encoding and / or entropy decoding are performed on the syntax elements according to the context model based on the order of the syntax elements, it is possible to implement entropy encoding and / or entropy decoding using the context model for each syntax element, thereby improving the performance of entropy encoding and / or entropy decoding based on the context model, and thereby improving the efficiency of video encoding and / or decoding.
[0380] Fourth embodiment
[0381] Based on any of the above embodiments, a fourth embodiment is proposed.
[0382] In this embodiment, the context model is determined or obtained by at least one of the following methods 11 to 17:
[0383] Mode 11, determining or obtaining based on the scanned neighbor coefficient information of the transform coefficient;
[0384] Optionally, determining or obtaining at least one context model based on scanning neighbor coefficient information of the transform coefficient may include determining or obtaining at least one context model based on scanning neighbor coefficient information of the transform coefficient level.
[0385] Optionally, at least one context model may be selected from at least two context models according to scanned neighbor coefficient information of the transform coefficient.
[0386] Optionally, all syntax elements corresponding to the transform coefficients may be determined according to a horizontal representation of the transform coefficients, and for each syntax element, at least one context model may be determined or obtained based on scanned neighbor coefficient information of the transform coefficients.
[0387] Optionally, a relationship or rule between scanned neighbor coefficient information and a preset context model can be established. After determining the scanned neighbor coefficient information of a transform coefficient, at least one context model can be determined or obtained based on the pre-set relationship or rule. For example, the number of non-zero coefficients among all scanned transform coefficients in a neighboring block can be determined, and the corresponding context model can be determined based on the number of non-zero coefficients. For example, if the number of non-zero coefficients is 3, the corresponding context model can be a context autoregressive model.
[0388] Optionally, the transform coefficient level is represented by multiple syntax elements according to the transform coefficient level representation method, and the multiple syntax elements are scanned in a certain scanning order. The context model corresponding to the scanned syntax element is determined or obtained based on the scanned neighbor coefficient information of the transform coefficient, and the scanned syntax element is entropy encoded according to the context model.
[0389] Optionally, the syntax elements may also be entropy decoded according to the context model.
[0390] Optionally, a context model corresponding to at least one syntax element in a syntax element sequence is determined or obtained based on the scanned neighbor coefficient information of the transform coefficient, such as the context model corresponding to the syntax element sig. The encoder can entropy encode the value of the syntax element based on the context model corresponding to the at least one syntax element. The decoder can entropy decode the syntax element based on the context model corresponding to the at least one syntax element to obtain the value of the syntax element. For example, the syntax element sig=1 is entropy encoded based on the context model corresponding to the syntax element sig (this operation is written to the bitstream), and / or the syntax element sig is entropy decoded based on the context model corresponding to sig to obtain sig=1 (this operation is read from the bitstream).
[0391] Optionally, the context model can be determined or obtained by scanning neighbor coefficient information of the transform coefficient, and then the scanning neighbor coefficient information can be comprehensively considered to make the determined context model more accurate and effective, thereby improving the video encoding and / or decoding efficiency.
[0392] Mode 12: determining or obtaining based on coefficient information, and / or position and / or size parameters of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block;
[0393] Optionally, at least one context model can be determined or obtained based on coefficient information of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block, and / or position and / or size parameters.
[0394] Optionally, at least one context model can be selected from at least two context models based on coefficient information of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block, and / or position and / or size parameters.
[0395] Optionally, at least two available context models may be determined based on coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block. For example, the context model adopted by the default block, neighbor block, non-neighbor block, co-located block, and time domain block is used as the available context model, and then at least one context model is selected from the at least two available context models based on position and / or size parameters corresponding to at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block. Optionally, at least two available context models may be determined based on coefficient information and / or position and / or size parameters of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and then at least one context model is selected from the at least two available context models based on scanned neighbor coefficient information of the transform coefficient.
[0396] Optionally, at least one context model may be determined or obtained based on transform coefficients in at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block.
[0397] Optionally, a correspondence between coefficient information of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block, and / or position and / or size parameters and a plurality of preset context models can be set, and based on the correspondence, a context model corresponding to the current transform block and / or a transform coefficient within the transform block and / or a syntax element used to represent the current transform coefficient can be determined, and entropy encoding and / or entropy decoding can be performed on the syntax element according to the context model.
[0398] Optionally, at least one context model is determined or obtained based on the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or the position and / or size parameters. At least one syntax element in the syntax element sequence corresponding to the current transform coefficient is entropy encoded and / or entropy decoded based on the at least one context model. Optionally, the encoder can entropy encode the value of the syntax element based on the context model corresponding to the at least one syntax element. The decoder can entropy decode the syntax element based on the context model corresponding to the at least one syntax element to obtain the value of the syntax element. For example, the syntax element sig=1 is entropy encoded based on the context model corresponding to the syntax element sig (this operation is written into the bitstream), and / or the syntax element sig is entropy decoded based on the context model corresponding to sig to obtain sig=1 (this operation is read from the bitstream).
[0399] Optionally, by determining or obtaining a context model based on the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or position and / or size parameters, the low efficiency defect caused by randomly selecting the context model can be avoided, and the accuracy and effectiveness of the determined or obtained context model can be improved, thereby improving the video encoding and / or decoding efficiency.
[0400] Mode 13, determining or obtaining a candidate context model list based on information of the transform block, and determining or obtaining based on the candidate context model list;
[0401] Optionally, a candidate context model list having at least one context model is determined or obtained based on information of the transform block, and at least one context model is hit in the candidate context model list, and entropy encoding and / or entropy decoding is performed on at least one syntax element corresponding to the currently scanned transform coefficient based on the at least one hit context model.
[0402] Optionally, the candidate context model list stores the context models most likely to be used for the current transform coefficient or syntax element, also known as the most probable context model list. For example, if there are 10 available context models, the candidate context model list stores the five most likely context models to be used.
[0403] Optionally, when determining or obtaining a candidate context model list based on information of a transform block, if there are at least two context models in the candidate context model list, at least one context model can be selected from at least two transform coefficient representations in the candidate context model list based on the scanned neighbor coefficient information of the transform coefficient, and / or the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or position and / or size parameters, and / or position and / or size parameters corresponding to the transform block.
[0404] Optionally, on the encoding side, the cost corresponding to each context model in the candidate context model list can be calculated and filtered based on the cost, for example, filtering in a manner that minimizes cost and maximizes efficiency, and the filtered context model is used as the hit context model. On the decoding side, the index in the bitstream can be obtained, and the context model corresponding to the index in the candidate context model list can be determined and used as the hit context model.
[0405] Optionally, a candidate context model list is constructed or updated based on the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or the position and / or size parameters, and at least one context model corresponding to the current transform block and / or at least one context model corresponding to the current transform coefficient / transform coefficient level and / or at least one context model corresponding to the syntax element used to represent the transform coefficient level is determined or obtained based on the updated candidate context model list.
[0406] Optionally, a candidate context model list is constructed or updated based on the scanned neighbor coefficient information of the transform coefficient, and at least one context model corresponding to the current transform block and / or at least one context model corresponding to the current transform coefficient / transform coefficient level and / or at least one context model corresponding to the syntax element used to represent the transform coefficient level is determined or obtained based on the updated candidate context model list.
[0407] Optionally, a candidate context model list is constructed or updated based on the position and / or size parameters corresponding to the transform block, and at least one context model corresponding to the current transform block and / or at least one context model corresponding to the current transform coefficient / transform coefficient level and / or at least one context model corresponding to the syntax element used to represent the transform coefficient level is determined or obtained based on the updated candidate context model list.
[0408] Optionally, a candidate context model list is constructed or updated based on the default candidate context model, and at least one context model corresponding to the current transform block and / or at least one context model corresponding to the current transform coefficient / transform coefficient level and / or at least one context model corresponding to the syntax element used to represent the transform coefficient level is determined or obtained based on the updated candidate context model list.
[0409] Optionally, a candidate context model list is constructed or updated based on the context model corresponding to the neighboring block, and at least one context model corresponding to the current transform block and / or at least one context model corresponding to the current transform coefficient / transform coefficient level and / or at least one context model corresponding to the syntax element used to represent the transform coefficient level is determined or obtained based on the updated candidate context model list.
[0410] Optionally, at least two candidate context models are sorted according to their costs, a candidate context model list is constructed or updated according to the sorting result, and at least one context model corresponding to the current transform block and / or at least one context model corresponding to the current transform coefficient / transform coefficient level and / or at least one context model corresponding to the syntax element used to represent the transform coefficient level are determined or obtained according to the updated candidate context model list.
[0411] Optionally, a candidate context model list is determined or obtained based on information of the transform block, at least one context model is determined or obtained based on the candidate context model list, and entropy encoding and / or entropy decoding is performed on at least one syntax element in a syntax element sequence corresponding to a current transform coefficient based on the at least one context model.
[0412] Optionally, the encoder may entropy encode the value of at least one syntax element based on the context model corresponding to the syntax element. The decoder may entropy decode the syntax element based on the context model corresponding to the at least one syntax element to obtain the value of the syntax element. For example, the syntax element sig=1 is entropy encoded based on the context model corresponding to the syntax element sig (this operation is written to the bitstream), and / or the syntax element sig is entropy decoded based on the context model corresponding to sig to obtain sig=1 (this operation is read from the bitstream).
[0413] Optionally, by determining or obtaining a candidate context model list based on the information of the transform block, and determining or obtaining the context model based on the candidate context model list, the hit rate of the context model can be improved through the candidate context model list, and the signaling overhead can be reduced, thereby improving the video encoding and / or decoding efficiency.
[0414] Mode 14, determining or obtaining according to the position and / or size parameters of the transform block;
[0415] Optionally, at least one context model corresponding to the current transform block, and / or at least one context model corresponding to the current transform coefficient / transform coefficient level, and / or at least one context model corresponding to the syntax element used to represent the transform coefficient level are determined or obtained based on the position and / or size parameters of the transform block.
[0416] Optionally, at least one context model may be selected from at least two context models according to position and / or size parameters corresponding to the transform block.
[0417] Optionally, at least two available context models can be determined or obtained based on the scanned neighbor coefficient information of the transform coefficient, and / or based on the coefficient information of at least one of the default block, neighbor block, non-neighbor block, co-located block, and time domain block corresponding to the transform block, and / or position and / or size parameters. Among the at least two available context models, at least one context model is selected based on the position and / or size parameters corresponding to the transform block.
[0418] Optionally, certain selection rules can be set. For example, when the position corresponding to the transformed block meets a certain position condition, at least one context model corresponding to the position condition can be determined. For example, when the sum of the horizontal and vertical coordinates corresponding to the transformed block is greater than a preset value, a context model type is selected.
[0419] Optionally, at least one context model is determined or obtained based on the position and / or size parameters of the transform block, and entropy encoding and / or entropy decoding is performed on at least one syntax element in the syntax element sequence corresponding to the current transform coefficient based on the at least one context model.
[0420] Optionally, the encoder may entropy encode the value of at least one syntax element based on the context model corresponding to the syntax element. The decoder may entropy decode the syntax element based on the context model corresponding to the at least one syntax element to obtain the value of the syntax element. For example, the syntax element sig=1 is entropy encoded based on the context model corresponding to the syntax element sig (this operation is written to the bitstream), and / or the syntax element sig is entropy decoded based on the context model corresponding to sig to obtain sig=1 (this operation is read from the bitstream).
[0421] Optionally, by determining or obtaining a context model based on the position and / or size parameters corresponding to the transform block, the determined or obtained context model can be closely related to the current transform coefficient, thereby improving the accuracy and effectiveness of the determined or obtained context model, and thereby improving the video encoding and / or decoding efficiency.
[0422] Mode 15, if the transform block is to be entropy coded, determining or obtaining based on information of transform coefficients corresponding to the transform block;
[0423] On the encoding side, at least one context model corresponding to the current transform block, and / or at least one context model corresponding to the current transform coefficient / transform coefficient level, and / or at least one context model corresponding to the syntax element used to represent the transform coefficient level can be determined or obtained based on the information of the transform coefficient corresponding to the transform block.
[0424] Optionally, information of a transform coefficient corresponding to a transform block may be determined, such as the transform coefficient of a previous scanned bit, the position of the transform coefficient in the transform block, coefficients of neighboring blocks, and the like.
[0425] Optionally, at least one context model is determined or obtained from a plurality of preset context models based on information about transform coefficients corresponding to the transform block. For example, the costs and / or expenses of the plurality of preset context models are calculated based on information about transform coefficients corresponding to the transform block, the plurality of context models are sorted based on the costs and / or expenses, and at least one context model is selected based on the sorting result, for example, the context model with the lowest cost is selected.
[0426] Optionally, if the transform block is to be entropy coded, at least one context model is selected from at least two context models according to information of transform coefficients corresponding to the transform block.
[0427] Optionally, if the transform block is to be entropy coded, at least two available context models may be determined or obtained based on information about scanned neighboring coefficients of the transform coefficients, and / or based on coefficient information and / or position and / or size parameters of at least one of a default block, a neighboring block, a non-neighboring block, a co-located block, and a time-domain block corresponding to the transform block, and / or position and / or size parameters corresponding to the transform block, and then at least one context model may be selected from the at least two available context models based on information about the transform coefficients corresponding to the transform block. Optionally, at least one context model may be selected from a candidate context model list based on information about the transform coefficients corresponding to the transform block.
[0428] Optionally, the encoding end (ie, the encoding side) determines or obtains at least one context model according to information of transform coefficients corresponding to the transform block, and performs entropy encoding on the value of at least one syntax element in the syntax element sequence.
[0429] Optionally, on the encoding side, by determining or obtaining the context model based on the information of the transform coefficients corresponding to the transform block, the low efficiency defect caused by randomly selecting the context model can be avoided, the accuracy and effectiveness of the determined or obtained context model can be improved, and the video encoding and / or decoding efficiency can be improved.
[0430] Mode 16, if the transformed block is to be entropy decoded, then the index is determined or obtained according to the index obtained from the bitstream;
[0431] Optionally, on the decoding side, at least one context model corresponding to the current transform block, and / or at least one context model corresponding to the current transform coefficient / transform coefficient level, and / or at least one context model corresponding to the syntax element used to represent the transform coefficient level can be determined or obtained based on the index obtained in the code stream.
[0432] Optionally, if the transform block is to be entropy decoded, at least one context model is selected from at least two context models according to an index obtained from the bitstream.
[0433] Optionally, if the transform block is to be entropy decoded, at least two available context models may be determined or obtained based on scanned neighbor coefficient information of the transform coefficient and / or coefficient information and / or position and / or size parameters of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time-domain block corresponding to the transform block, and / or position and / or size parameters corresponding to the transform block. At least one context model may then be selected from the at least two available context models based on an index obtained from the bitstream. Alternatively, at least one context model may be selected from a candidate context model list based on an index obtained from the bitstream.
[0434] Optionally, when the transform block is to be entropy decoded, an index in the bitstream may be obtained, and a corresponding context model may be searched for in a plurality of preset context models according to the index, or a corresponding context model may be searched for in a candidate context model list according to the index.
[0435] Optionally, the decoding end (ie, the decoding side) determines or obtains at least one context model based on information of transform coefficients corresponding to the transform block, and performs entropy decoding on at least one syntax element in the syntax element sequence to obtain a value of the syntax element.
[0436] Optionally, on the decoding side, by determining or obtaining a context model based on an index obtained from the bitstream, an accurate and effective context model can be quickly determined, thereby improving video encoding and / or decoding efficiency.
[0437] Method 17, determine or obtain according to the transformation coefficient representation method.
[0438] Optionally, the correspondence between different transform coefficient representation methods and different context models can be set in advance, and based on the correspondence, at least one context model corresponding to the current transform block, and / or at least one context model corresponding to the current transform coefficient / transform coefficient level, and / or at least one context model corresponding to the syntax element used to represent the transform coefficient level can be determined or obtained.
[0439] Optionally, if the transform coefficient representation mode is determined and the transform coefficients are represented as syntax elements according to the transform coefficient representation mode, entropy encoding and / or entropy decoding can be performed on each syntax element represented according to the context model corresponding to the transform coefficient representation mode.
[0440] Optionally, at least one context model is determined according to a transform coefficient representation mode, and entropy encoding and / or entropy decoding is performed on at least one syntax element in a syntax element sequence corresponding to a current transform coefficient according to the at least one context model.
[0441] Optionally, the encoder may entropy encode the value of at least one syntax element based on the context model corresponding to the syntax element. The decoder may entropy decode the syntax element based on the context model corresponding to the at least one syntax element to obtain the value of the syntax element. For example, the syntax element sig=1 is entropy encoded based on the context model corresponding to the syntax element sig (this operation is written to the bitstream), and / or the syntax element sig is entropy decoded based on the context model corresponding to sig to obtain sig=1 (this operation is read from the bitstream).
[0442] Optionally, among the at least two context models, at least one context model is selected according to a transform coefficient representation method.
[0443] Optionally, at least two available context models may be determined or obtained based on scanned neighbor coefficient information of the transform coefficient, and / or based on coefficient information and / or position and / or size parameters of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time-domain block corresponding to the transform block, and / or position and / or size parameters corresponding to the transform block, and then at least one context model may be selected from the at least two available context models based on the transform coefficient representation. Optionally, at least one context model may be selected from a candidate context model list based on the transform coefficient representation.
[0444] Optionally, if the transform block is to be entropy coded, at least two available context models may be determined or obtained based on information about transform coefficients corresponding to the transform block, and at least one context model may be selected from the at least two available context models based on a representation of the transform coefficients. Optionally, if the transform block is to be entropy decoded, at least two available context models may be determined or obtained based on an index obtained from a bitstream, and at least one context model may be selected from the at least two available context models based on a representation of the transform coefficients.
[0445] Optionally, by determining or obtaining a context model based on the transform coefficient representation, the context model is closely associated with the transform coefficient representation, thereby improving the performance of entropy encoding and / or entropy decoding based on the context model, thereby improving the efficiency of video encoding and / or decoding.
[0446] The present application also provides a processing device, referring to FIG11 . FIG11 is a schematic diagram of the functional modules of the processing device of the present application, which can be provided in or on a processing device. The processing device includes:
[0447] The processing module A10 is configured to determine or obtain a transform coefficient representation according to information of the transform block, and to perform entropy coding and / or entropy decoding according to the transform coefficient representation and a context model.
[0448] Optionally, the number of the transform blocks is at least one; and / or the number of the transform coefficient representation methods is at least one.
[0449] Optionally, the method for determining or obtaining the transform coefficient representation includes at least one of the following:
[0450] Determining or obtaining based on scanned neighbor coefficient information of the transform coefficient;
[0451] Determined or obtained based on coefficient information, and / or position and / or size parameters of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block;
[0452] Determine or obtain according to the position and / or size parameters corresponding to the transformation block;
[0453] Determine or obtain a candidate representation list based on information of the transform block, and determine or obtain based on the candidate representation list;
[0454] If the transform block is to be entropy coded, determining or obtaining based on information of transform coefficients corresponding to the transform block;
[0455] If the transformed block is to be entropy decoded, it is determined or obtained according to the index obtained from the bitstream.
[0456] Optionally, determining or obtaining the candidate representation list according to the information of the transform block includes at least one of the following:
[0457] Construct or update a candidate representation list according to coefficient information of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block, and / or position and / or size parameters;
[0458] Construct or update a candidate representation list based on the scanned neighbor coefficient information of the transform coefficient;
[0459] Construct or update a candidate representation list according to position and / or size parameters corresponding to the transformed block;
[0460] Construct or update the candidate representation list according to the default candidate representation mode;
[0461] Construct or update a candidate representation list according to coefficient representations of neighboring blocks;
[0462] The at least two candidate representations are sorted according to their costs, and a candidate representation list is constructed or updated according to the sorting result.
[0463] Optionally, the processing module A10 is configured to:
[0464] Determine or obtain a syntax element corresponding to the transform coefficient according to the transform coefficient representation method;
[0465] Syntax elements are entropy encoded and / or entropy decoded according to the context model.
[0466] Optionally, the processing module A10 is configured to:
[0467] The transform block is scanned according to a preset scanning order, and the syntax elements corresponding to the transform coefficients in the scanned transform block are determined or obtained according to the transform coefficient representation method.
[0468] Optionally, the processing module A10 is configured to:
[0469] Determine or obtain the number of syntax elements corresponding to the transform coefficients and the order of the syntax elements. If there are multiple syntax elements, entropy encode and / or entropy decode the syntax elements according to the order of the syntax elements and the context model.
[0470] Optionally, the syntax element includes at least one of the following:
[0471] A first flag that is less than a threshold;
[0472] a second flag greater than a threshold;
[0473] a third flag that is less than or equal to a threshold;
[0474] A fourth flag greater than or equal to a threshold.
[0475] Optionally, the context model is determined or obtained by at least one of the following methods:
[0476] Determining or obtaining based on scanned neighbor coefficient information of the transform coefficient;
[0477] Determined or obtained based on coefficient information, and / or position and / or size parameters of at least one of a default block, a neighbor block, a non-neighbor block, a co-located block, and a time domain block corresponding to the transform block;
[0478] Determine or obtain a candidate context model list based on information of the transform block, and determine or obtain based on the candidate context model list;
[0479] Determining or obtaining according to position and / or size parameters of the transform block;
[0480] If the transform block is to be entropy coded, the transform coefficient is determined or obtained based on information of the transform coefficient corresponding to the transform block;
[0481] If the transformed block is to be entropy decoded, it is determined or obtained based on the index obtained from the bitstream;
[0482] Determine or obtain according to the transformation coefficient representation method.
[0483] An embodiment of the present application further provides a processing device, including a memory and a processor, wherein a processing program is stored in the memory, and when the processing program is executed by the processor, the steps of the processing method in any of the above embodiments are implemented.
[0484] An embodiment of the present application further provides a storage medium having a processing program stored thereon. When the processing program is executed by a processor, the steps of the processing method in any of the above embodiments are implemented.
[0485] In the embodiments of the processing device, processing equipment and storage medium provided in this application, all technical features of any of the above-mentioned processing method embodiments may be included. The expansion and explanation content of the specification are basically the same as those of the embodiments of the above-mentioned methods and will not be repeated here.
[0486] An embodiment of the present application further provides a computer program product, which includes computer program code. When the computer program code runs on a computer, the computer executes the methods in the various possible implementation modes described above.
[0487] The embodiment of the present application also provides a chip, including a memory and a processor, the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the device equipped with the chip executes the method in the various possible implementation modes as described above. It can be understood that the above scenarios are only examples and do not constitute a limitation on the application scenarios of the technical solutions provided in the embodiments of the present application. The technical solutions of the present application can also be applied to other scenarios. For example, it is known to those skilled in the art that with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0488] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The steps in the method of the embodiment of the present application can be adjusted in order, merged and deleted according to actual needs. The units in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs. In this application, the same or similar terminology, technical solutions and / or application scenario descriptions are generally only described in detail the first time they appear. When they appear again later, for the sake of brevity, they are generally not repeated. When understanding the technical solutions of this application, etc., for the same or similar terminology, technical solutions and / or application scenario descriptions that are not described in detail later, reference can be made to the relevant detailed descriptions before. In this application, the descriptions of each embodiment have their own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. The various technical features of the technical solution of this application can be combined arbitrarily. In order to make the description concise, not all possible combinations of the various technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the description of this application.
[0489] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as mentioned above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the method of each embodiment of the present application.
[0490] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium or transmitted from one storage medium to another storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a storage disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state storage disk Solid State Disk (SSD)).
[0491] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A processing method, characterized in that, Including the steps: S10. Determine or obtain a transform coefficient representation method according to the information of the transform block; S20. Perform entropy encoding and / or entropy decoding according to the transform coefficient representation method and the context model.
2. The processing method according to claim 1, characterized in that, The number of the transform blocks is at least one; and / or, the number of the transform coefficient representation methods is at least one.
3. The processing method according to claim 1, wherein The method for determining or obtaining the transform coefficient representation method includes at least one of the following: Determine or obtain according to the scanned neighbor coefficient information of the transform coefficient; Determine or obtain according to the coefficient information, and / or position and / or size parameters of at least one of the default block, neighbor block, non-neighbor block, co-located block, and temporal block corresponding to the transform block; Determine or obtain according to the position and / or size parameters of the transform block; Determine or obtain a candidate representation list according to the information of the transform block, and determine or obtain according to the candidate representation list; If entropy encoding is to be performed on the transform block, determine or obtain according to the information of the transform coefficient corresponding to the transform block; If entropy decoding is to be performed on the transform block, determine or obtain according to the index obtained from the code stream.
4. The processing method according to claim 3, wherein The determining or obtaining of the candidate representation list according to the information of the transform block includes at least one of the following: Construct or update the candidate representation list according to the coefficient information, and / or position and / or size parameters of at least one of the default block, neighbor block, non-neighbor block, co-located block, and temporal block corresponding to the transform block; Construct or update the candidate representation list according to the scanned neighbor coefficient information of the transform coefficient; Construct or update the candidate representation list according to the position and / or size parameters of the transform block; Construct or update the candidate representation list according to the default candidate representation method; Construct or update the candidate representation list according to the coefficient representation method of the neighbor block; Sort according to the costs of at least two candidate representation methods, and construct or update the candidate representation list according to the sorting result.
5. The processing method according to any one of claims 1 to 4, characterized in that The step S20 includes the steps: S21. Determine or obtain the syntax element corresponding to the transform coefficient according to the transform coefficient representation method; S22. Perform entropy encoding and / or entropy decoding on the syntax element according to the context model.
6. The processing method according to claim 5, characterized in that It further includes at least one of the following: The step S21 includes: Scanning the transform block according to a preset scanning order, and determining or obtaining the syntax element corresponding to the transform coefficient in the scanned transform block according to the transform coefficient representation method; The step S22 includes: Determining or obtaining the number of the syntax elements corresponding to the transform coefficient and the order of the syntax elements. If the number of the syntax elements is multiple, perform entropy encoding and / or entropy decoding on the syntax elements according to the order of the syntax elements according to the context model.
7. The processing method according to claim 5, characterized in that, The syntax element includes at least one of the following: A first flag less than a threshold; A second flag greater than a threshold; A third flag less than or equal to a threshold; A fourth flag greater than or equal to a threshold.
8. The processing method according to any one of claims 1 to 4, characterized in that, The method for determining or obtaining the context model includes at least one of the following: Determine or obtain according to the scanned neighbor coefficient information of the transform coefficient; Determine or obtain according to the coefficient information, and / or position and / or size parameters of at least one of the default block, neighbor block, non-neighbor block, co-located block, and temporal block corresponding to the transform block; Determine or obtain a candidate context model list according to the information of the transform block, and determine or obtain according to the candidate context model list; Determined or obtained according to the position and / or size parameters of the transform block; If the transform block is to be entropy-coded, determined or obtained according to the information of the transform coefficients corresponding to the transform block; If the transform block is to be entropy-decoded, determined or obtained according to the index obtained from the bitstream; Determined or obtained according to the transform coefficient representation.
9. A processing device, characterized in that, Includes: A memory and a processor, wherein a processing program is stored on the memory, and when the processing program is executed by the processor, the steps of the processing method according to any one of claims 1 to 8 are implemented.
10. A storage medium, characterized in that, A computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the processing method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Method and apparatus for entropy coding video and method and apparatus for entropy decoding video
CN104471934A
Methods and Apparatuses for Coding Transform Blocks
US20200244995A1
Rice parameter derivation for transform-skip mode used in lossless / lossy video coding
US20210105491A1
Image decoding method and device using residual information in image coding system
US20210337204A1
Cited By
Processing method, processing equipment and storage medium
CN121691725A