Method and apparatus for encoding and decoding coding unit, and storage medium
Patent Information
- Application Number
- CN202410614571.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-12-03
- Filing Date
- 2020-11-04
- Publication Date
- 2024-08-30
Smart Images

Figure CN118573884A
Abstract
Description
[0001] (This application is a divisional application of an application filed on November 4, 2020, with application number 2020800770503, and invention name “Method, device and system for encoding and decoding coding tree units”.) Technical Field
[0002] The present invention generally relates to digital video signal processing, and more particularly to methods, devices and systems for encoding and decoding blocks of video samples. The present invention also relates to a computer program product comprising a computer readable medium having recorded thereon a computer program for encoding and decoding blocks of video samples. Background Art
[0003] There are currently many applications for video encoding, including applications for transmitting and storing video data. Many video encoding standards have also been developed and other video encoding standards are currently under development. Recent advances in video coding standardization have led to the formation of a group known as the "Joint Video Experts Group" (JVET). The Joint Video Experts Group (JVET) includes members of Study Group 16, Question 6 (SG16 / Q6) of the Telecommunication Standardization Sector (ITU-T) of the International Telecommunication Union (ITU), also known as the "Video Coding Experts Group" (VCEG); and members of the International Organization for Standardization / International Electrotechnical Commission Joint Technical Committee 1 / Subcommittee 29 / Working Group 11 (ISO / IEC JTC1 / SC29 / WG11), also known as the "Moving Picture Experts Group" (MPEG).
[0004] The Joint Video Experts Team (JVET) issued a call for proposals (CfP) and analyzed the responses at its 10th meeting in San Diego, USA. The responses submitted showed that the video compression capabilities are significantly better than those of the current state-of-the-art video compression standard, namely "High Efficiency Video Coding" (HEVC). Based on this excellent performance, it was decided to start a project to develop a new video compression standard named "Versatile Video Coding" (VVC). It is expected that VVC will address the continued demand for even higher compression performance, especially as the capabilities of video formats increase (e.g., with higher resolutions and higher frame rates), and the growing market demand for service provision over WANs (where bandwidth costs are relatively high). Use cases such as immersive video require real-time encoding and decoding of such higher formats, for example, a cube map projection (CMP) can use an 8K format even if the final rendered "viewport" utilizes a lower resolution. VVC must be implementable in contemporary silicon processes and provide an acceptable tradeoff between the achieved performance and the implementation cost. For example, the implementation cost can be considered in one or more of silicon area, CPU processor load, memory utilization, and bandwidth. Higher video formats can be processed by splitting the frame area into parts and processing the parts in parallel. A bitstream constructed from multiple parts of a compressed frame is still suitable for decoding by a "single-core" decoder, i.e., frame-level constraints (including bit rate) are assigned to the parts according to the application needs.
[0005] The video data comprises a sequence of frames of image data, each frame comprising one or more color channels. Typically, one primary color channel and two secondary color channels are required. The primary color channel is often referred to as the "luminance" channel, and the (one or more) secondary color channels are often referred to as the "chrominance" channels. Although video data is often displayed in an RGB (red-green-blue) color space, this color space has a high degree of correlation between the three corresponding components. The video data representation seen by the encoder or decoder often uses a color space such as YCbCr. YCbCr concentrates luminance (mapped to "luminance" according to the transformation equation) in the Y (primary) channel and concentrates chrominance in the Cb and Cr (secondary) channels. Due to the use of decorrelated YCbCr signals, the statistics of the luminance channel are significantly different from those of the chrominance channels. The main difference is that after quantization, the chrominance channel contains relatively fewer significant coefficients for a given block compared to the coefficients of the corresponding luminance channel block. Additionally, the Cb and Cr channels may be spatially sampled at a lower rate than the luma channel, for example, half horizontally and half vertically (referred to as a "4:2:0 chroma format"). The 4:2:0 chroma format is commonly used in "consumer" applications such as Internet video streaming, broadcast television, and Blu-ray. TMStorage on disk. Subsampling the Cb and Cr channels at half rate horizontally but not vertically is known as the "4:2:2 chroma format".
[0006] The 4:2:2 chroma format is commonly used in professional applications, including the capture of footage for filmmaking, etc. The higher sampling rate of the 4:2:2 chroma format makes the resulting video more resilient to editing operations (such as color grading, etc.). Before distribution to consumers, 4:2:2 chroma format material is often converted to 4:2:0 chroma format and then encoded for distribution to consumers. In addition to the chroma format, video is also characterized by resolution and frame rate. Example resolutions are ultra-high definition (UD) with a resolution of 3840×2160 or "8K" with a resolution of 7680×4320, and example frame rates are 60Hz or 120Hz. The luminance sample rate can range from about 500 megasamples / second to several gigasamples / second. For the 4:2:0 chroma format, the sampling rate of each chroma channel is one quarter of the luminance sampling rate, and for the 4:2:2 chroma format, the sampling rate of each chroma channel is half of the luminance sampling rate.
[0007] The VVC standard is a "block-based" codec in which a frame is first partitioned into a square array of regions called "coding tree units" (CTUs). In the case where a frame cannot be partitioned into CTUs integer-wise, the CTUs along the lower left edge may be truncated in size to match the frame size. A CTU typically occupies a relatively large area, such as 128×128 luma samples, etc. However, the CTU at the lower right edge of each frame may be smaller in area. Associated with each CTU is a "coding tree", which may be a single tree (a "common tree") for both the luma channel and the chroma channel, and may include "forks" into separate trees (or "dual trees") for each luma channel and chroma channel. The coding tree defines the decomposition of the region of the CTU into a set of blocks, also called "coding units" (CUs). CBs are processed to be encoded or decoded in a specific order. Separate coding trees for luma and chroma typically start at a 64×64 luma sample granularity, above which there is a common tree. Due to the use of the 4:2:0 chroma format, a separate coding tree structure starting with a 64×64 luma sample granularity includes a collocated chroma coding tree with a 32×32 chroma sample area. The name "unit" indicates the applicability of all color channels of the coding tree spanning the derived block. A single coding tree produces a coding unit with a luma coding block and two chroma coding blocks. The luma branch of the separate coding tree produces coding units each with a luma coding block, and the chroma branch of the separate coding tree produces coding units each with a pair of chroma blocks. The above-mentioned CU is also associated with a "prediction unit" (PU) and a "transform unit" (TU), each of which is applicable to all color channels of the coding tree of the derived CU. Similarly, a coding block is associated with a prediction block (PB) and a transform block (TB), each of which is applicable to a single color channel. A single tree for a CU spanning the color channels of 4:2:0 chroma format video data produces a chroma coding block with half the width and height of the corresponding luma coding block.
[0008] Despite the above distinction between a “unit” and a “block,” the term “block” may be used as a general term for an area or region of a frame to which an operation is applied to all color channels.
[0009] For each CU, a prediction unit (or "PU") is generated for the content (sample values) of the corresponding region of the frame data. In addition, a representation of the difference between the prediction and the region content (or "residual" in the spatial domain) seen at the input of the encoder is formed. The difference between each color channel can be transformed and encoded as a sequence of residual coefficients, thereby forming one or more TUs for a given CU. The applied transform can be a discrete cosine transform (DCT) or other transform applied to each block of residual values. The transform is applied separately, that is, a two-dimensional transform is performed in two passes. The block is first transformed by applying a one-dimensional transform to each row of samples in the block. Then, the partial result is transformed by applying a one-dimensional transform to each column of the partial result to produce a final block of transform coefficients that essentially decorrelate the residual samples. The VVC standard supports transforms of various sizes, including transforms of rectangular blocks (each side size is a power of 2). The transform coefficients are quantized for entropy encoding in the bitstream. Additional inseparable transform levels can also be applied. Finally, the transform application can be bypassed.
[0010] VVC is characterized by intra-frame prediction and inter-frame prediction. Intra-frame prediction involves using previously processed samples in the frame being used to generate a prediction of the current sample block in the frame. Inter-frame prediction involves using a block of samples obtained from a previously decoded frame to generate a prediction of the current sample block in the frame. The block of samples obtained from the previously decoded frame is offset from the spatial position of the current block according to a motion vector, which motion vector usually has filtering applied. The intra-frame prediction block can be (i) a uniform sample value ("DC intra-frame prediction"), (ii) a plane with an offset and horizontal and vertical gradients ("plane intra-frame prediction"), (iii) a group of blocks with neighboring samples applied in a specific direction ("angle intra-frame prediction"), or (iv) the result of a matrix multiplication using neighboring samples and selected matrix coefficients. By encoding the 'residual' in the bitstream, further differences between the predicted block and the corresponding input sample can be corrected to some extent. The residual is usually transformed from the spatial domain to the frequency domain to form residual coefficients (in the "primary transform domain"), and the residual coefficients can be further transformed by applying a "secondary transform" (to produce residual coefficients in the "secondary transform domain"). The residual coefficients are quantized according to a quantization parameter, resulting in a loss of precision in the reconstruction of the samples produced at the decoder, while the bit rate within the bitstream is also reduced.
[0011] The quantization parameter may vary between frames as well as within individual frames. For a "rate controlled" encoder, variation of the quantization parameter within a frame is typical. A rate controlled encoder attempts to produce a bitstream with a substantially constant bitrate regardless of the statistics of the received input samples (such as noise properties, degree of motion, etc.). Since the bitstream is typically transmitted over a network with limited bandwidth, rate control is a common technique to ensure reliable performance over the network regardless of variations in the original frames input to the encoder. Flexibility in the use of rate control is desirable in cases where frames are encoded in parallel segments, since different segments may have different requirements in terms of desired fidelity.
[0012] Implementation cost (eg, any of memory usage, accuracy level, and communication efficiency, etc.) is also important. Summary of the invention
[0013] It is an object of the present invention to substantially overcome or at least ameliorate one or more disadvantages of existing arrangements.
[0014] One aspect of the present invention provides a method for decoding a coding unit of a coding tree from a coding tree unit of an image frame from a video bitstream, the coding unit having a luma color channel and at least one chroma color channel, the method comprising: decoding a luma transform skip flag for a luma transform block of the coding unit from the video bitstream; decoding at least one chroma transform skip flag from the video bitstream, wherein each decoded chroma transform skip flag corresponds to one of the at least one chroma transform blocks of the coding unit; determining a secondary transform index, the determining comprising: decoding a secondary transform index from the video bitstream when at least one of the luma transform skip flag and the at least one chroma transform skip flag indicates that a transform of the corresponding transform block is not skipped, and determining the secondary transform index to indicate that a secondary transform is not applied when both the luma transform skip flag and the at least one chroma transform skip flag indicate that a transform of the corresponding transform block is to be skipped; and transforming the luma transform block and the at least one chroma transform block according to the decoded luma transform skip flag, the at least one chroma transform skip flag, and the determined secondary transform index to decode the coding unit.
[0015] According to another aspect of the present invention, the decoded luma transform skip flag has a different value than the at least one chroma transform skip flag.
[0016] According to another aspect of the present invention, in a case where the decoded luma transform skip flag indicates that transform of a luma block is to be skipped, the secondary transform index is decoded for the at least one chroma transform block based on the decoded at least one chroma skip flag.
[0017] According to another aspect of the invention, the step of transforming comprises one of: skipping application of the secondary transform or selecting one of two secondary transform kernels for application based on the determined secondary transform index.
[0018] Another aspect of the present invention provides a method for decoding a coding unit of a coding tree from a coding tree unit of an image frame from a video bitstream, the coding unit having at least one chroma color channel, the method comprising: decoding at least one chroma transform skip flag from the video bitstream, wherein each chroma transform skip flag corresponds to one of at least one chroma transform blocks of the coding unit; determining a secondary transform index for at least one chroma transform block of the coding unit, the determining comprising: decoding the secondary transform index from the video bitstream when any one of the at least one chroma transform skip flag indicates that a transform is to be applied to the corresponding chroma transform block, and determining the secondary transform index to indicate that a secondary transform is not to be applied when all of the chroma transform skip flags indicate that a transform of the corresponding transform block is to be skipped; and transforming each chroma transform block of the at least one chroma transform block according to the corresponding chroma transform skip flag and the determined secondary transform index to decode the coding unit.
[0019] Another aspect of the present invention provides a method for decoding a coding unit of a coding tree from a coding tree unit of an image frame from a video bitstream, the coding unit having a luma color channel and at least one chroma color channel, the method comprising: decoding a luma transform skip flag for a luma transform block of the coding unit from the video bitstream; decoding at least one chroma transform skip flag from the video bitstream, wherein each decoded chroma transform skip flag corresponds to one of the at least one chroma transform blocks of the coding unit; determining a secondary transform index, the determining comprising: determining the secondary transform index to indicate that a secondary transform is not applied when the luma transform skip flag and the at least one chroma transform skip flag all indicate that a transform of the corresponding transform block is to be skipped, and decoding the secondary transform index from the video bitstream when the luma transform skip flag and the at least one chroma transform skip flag all indicate that a transform of the corresponding transform block is not to be skipped; and transforming the luma transform block and the at least one chroma transform block according to the decoded luma transform skip flag, the at least one chroma transform skip flag and the determined secondary transform index to decode the coding unit.
[0020] Another aspect of the present invention provides a non-transitory computer-readable medium having a computer program stored thereon to implement a method for decoding a coding unit of a coding tree from a coding tree unit of an image frame from a video bitstream, the coding unit having a luma color channel and at least one chroma color channel, the method comprising: decoding a luma transform skip flag for a luma transform block of the coding unit from the video bitstream; decoding at least one chroma transform skip flag from the video bitstream, wherein each decoded chroma transform skip flag corresponds to one of the at least one chroma transform blocks of the coding unit; determining a secondary transform index, the determining comprising: decoding a secondary transform index from the video bitstream if at least one of the luma transform skip flag and the at least one chroma transform skip flag indicates that a transform of the corresponding transform block is not skipped, and determining the secondary transform index to indicate that a secondary transform is not applied if both the luma transform skip flag and the at least one chroma transform skip flag indicate that a transform of the corresponding transform block is to be skipped; and transforming the luma transform block and the at least one chroma transform block according to the decoded luma transform skip flag, the at least one chroma transform skip flag, and the determined secondary transform index to decode the coding unit.
[0021] Another aspect of the present invention provides a system, comprising: a memory; and a processor, wherein the processor is configured to execute code stored on the memory to implement a method for decoding a coding unit of a coding tree from a coding tree unit of an image frame from a video bitstream, the coding unit having at least one chroma color channel, the method comprising: decoding at least one chroma transform skip flag from the video bitstream, wherein each chroma transform skip flag corresponds to one of at least one chroma transform blocks of the coding unit; determining a secondary transform index for at least one chroma transform block of the coding unit, the determining comprising: decoding the secondary transform index from the video bitstream when any one of the at least one chroma transform skip flag indicates that a transform is to be applied to the corresponding chroma transform block, and determining the secondary transform index to indicate that a secondary transform is not to be applied when one or more than one chroma transform skip flags all indicate that a transform of the corresponding transform block is to be skipped; and transforming each chroma transform block of the at least one chroma transform block according to the corresponding chroma transform skip flag and the determined secondary transform index to decode the coding unit.
[0022] Another aspect of the present invention provides a video decoder, which is configured to: receive an image frame from a bitstream; determine a coding unit of a coding tree from a coding tree unit of the image frame, wherein the coding unit has a luma color channel and at least one chroma color channel; decode a luma transform skip flag for a luma transform block of the coding unit from the video bitstream; decode at least one chroma transform skip flag from the video bitstream, wherein each decoded chroma transform skip flag corresponds to one of the at least one chroma transform blocks of the coding unit; determine a secondary transform index, the determining comprising: decoding a secondary transform index from the video bitstream when at least one of the luma transform skip flag and the at least one chroma transform skip flag indicates that a transform of the corresponding transform block is not skipped, and determining the secondary transform index to indicate that a secondary transform is not applied when both the luma transform skip flag and the at least one chroma transform skip flag indicate that a transform of the corresponding transform block is to be skipped; and transform the luma transform block and the at least one chroma transform block according to the decoded luma transform skip flag, the at least one chroma transform skip flag, and the determined secondary transform index to decode the coding unit.
[0023] One aspect of the present invention provides a method for decoding a coding unit of a coding tree unit of an image frame from a video bitstream, the method comprising: determining a scan pattern for a transform block of the coding unit, wherein the scan pattern traverses the transform block by advancing through multiple non-overlapping sets of sub-blocks of residual coefficients, the scan pattern advancing from the current set to the next set of the multiple sets after completing the scan of the current set; decoding residual coefficients from the video bitstream according to the determined scan pattern; determining a multiple transform selection index for the coding unit, the determining comprising: decoding the multiple transform selection index from the video bitstream if the last significant coefficient encountered along the scan pattern is at or within a threshold Cartesian position of the transform block, and determining the multiple transform selection index to indicate that multiple transform selection is not used if the last significant residual coefficient position of the transform block along the scan pattern is outside the threshold Cartesian position; and decoding the coding unit by transforming the decoded residual coefficients by applying a transform according to the multiple transform selection index.
[0024] Another aspect of the present invention provides a non-transitory computer-readable medium having a computer program stored thereon to implement a method of decoding a coding unit from a coding tree unit of an image frame from a video bitstream, the method comprising: determining a scan pattern for a transform block of the coding unit, wherein the scan pattern traverses the transform block by advancing through multiple non-overlapping sets of sub-blocks of residual coefficients, the scan pattern advancing from the current set to the next set of the multiple sets after completing the scan of the current set; decoding residual coefficients from the video bitstream according to the determined scan pattern; determining a multiple transform selection index for the coding unit, the determining comprising: decoding the multiple transform selection index from the video bitstream if the last significant coefficient encountered along the scan pattern is at or within a threshold Cartesian position of the transform block, and determining the multiple transform selection index to indicate that multiple transform selection is not used if the last significant residual coefficient position of the transform block along the scan pattern is outside the threshold Cartesian position; and decoding the coding unit by transforming the decoded residual coefficients by applying a transform according to the multiple transform selection index.
[0025] One aspect of the present invention provides a system, comprising: a memory; and a processor, wherein the processor is configured to execute code stored on the memory to implement a method of decoding a coding unit from a coding tree unit of an image frame from a video bitstream, the method comprising: determining a scan pattern for a transform block of the coding unit, wherein the scan pattern traverses the transform block by advancing through multiple non-overlapping sets of sub-blocks of residual coefficients, and the scan pattern advances from the current set to the next set of multiple sets after completing the scan of the current set; decoding residual coefficients from the video bitstream according to the determined scan pattern; determining a multiple transform selection index for the coding unit, the determining comprising: decoding the multiple transform selection index from the video bitstream if the last significant coefficient encountered along the scan pattern is at or within a threshold Cartesian position of the transform block, and determining the multiple transform selection index to indicate that multiple transform selection is not used if the last significant residual coefficient position of the transform block along the scan pattern is outside the threshold Cartesian position; and decoding the coding unit by transforming the decoded residual coefficients by applying a transform according to the multiple transform selection index.
[0026] One aspect of the present invention provides a video decoder configured to: receive an image frame from a bitstream; determine a coding unit of a coding tree of a coding tree unit of the image frame; determine a scan pattern for a transform block of the coding unit, wherein the scan pattern traverses the transform block by advancing through multiple non-overlapping sets of sub-blocks of residual coefficients, and the scan pattern advances from the current set to the next set of multiple sets after completing the scan of the current set; decode residual coefficients from the video bitstream according to the determined scan pattern; determine a multi-transform selection index for the coding unit, the determination comprising: decoding the multi-transform selection index from the video bitstream if the last significant coefficient encountered along the scan pattern is at or within a threshold Cartesian position of the transform block, and determining the multi-transform selection index to indicate that multi-transform selection is not used if the last significant residual coefficient position of the transform block along the scan pattern is outside the threshold Cartesian position; and transforming the decoded residual coefficients by applying a transform according to the multi-transform selection index to decode the coding unit.
[0027] Other aspects are also disclosed. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] At least one embodiment of the present invention will now be described with reference to the following drawings and appendices, in which:
[0029] Figure 1 is a schematic block diagram illustrating a video encoding and decoding system;
[0030] Figure 2A and 2B Composition can be practiced Figure 1 A schematic block diagram of a general computer system for one or both of the video encoding and decoding systems;
[0031] Figure 3 is a schematic block diagram showing the functional modules of a video encoder;
[0032] Figure 4 is a schematic block diagram showing the functional modules of a video decoder;
[0033] Figure 5 is a schematic block diagram illustrating possible partitioning of a block into one or more blocks in a tree structure for general video coding;
[0034] Figure 6 A schematic diagram of a data flow for implementing a permissible partitioning of a block into one or more blocks in a tree structure of a general video coding;
[0035] Fig. 7A and 7Bshows an example partitioning of a coding tree unit (CTU) into multiple coding units (CUs);
[0036] Fig. 8A , 8B 8C and 8D show forward and reverse inseparable secondary transforms according to different sizes of transform blocks;
[0037] Fig. 9 shows the set of regions where the secondary transform is applied for transform blocks of various sizes;
[0038] Fig.10 shows a syntax structure of a bitstream having multiple slices, each slice comprising multiple coding units;
[0039] Fig.11 shows the syntax structure of a bitstream with a common tree for luma and chroma coding units of a coding tree unit;
[0040] Fig.12 shows the syntax structure of a bitstream with separate trees for luma and chroma coding units for coding tree units;
[0041] Fig.13 A method of encoding a frame in a bitstream comprising one or more than one slice as a sequence of coding units is shown;
[0042] Fig.14 A method of encoding a coding unit in a bitstream is shown;
[0043] Fig.15 A method of decoding a frame from a bitstream as a sequence of coding units arranged into slices is shown;
[0044] Fig.16 A method of decoding a coding unit from a bitstream is shown; and
[0045] Fig.17 A conventional scan pattern for 32×32 TB is shown;
[0046] Fig.18 shows an example scan pattern of 32×32 TB used in the described arrangement;
[0047] Fig.19 shows a TB of size 8x32 partitioned into sets for the described arrangement; and
[0048] Fig. 20 Different example scan patterns for a 32x32 TB used in the described arrangement are shown. DETAILED DESCRIPTION
[0049] Where steps and / or features having the same reference numerals are referenced in any one or more of the accompanying drawings, these steps and / or features have the same function(s) or operation(s) for the purposes of this specification, unless otherwise intended.
[0050] The syntax of the bitstream format of a video compression standard is defined as a hierarchy of "syntactic structures". Each syntax structure defines a set of syntactic elements, some of which may depend on other syntax elements. Compression efficiency is improved when the syntax only allows combinations of syntax elements that correspond to useful combinations of tools. In addition, complexity is also reduced by prohibiting combinations of syntax elements that, although possible, are deemed to provide insufficient compression benefits for the resulting implementation cost.
[0051] Figure 1 is a schematic block diagram illustrating functional modules of the video encoding and decoding system 100. The system 100 signals primary and secondary transform parameters such that compression efficiency gains are achieved.
[0052] The system 100 includes a source device 110 and a destination device 130. A communication channel 120 is used to communicate encoded video information from the source device 110 to the destination device 130. In some configurations, one or both of the source device 110 and the destination device 130 may each include a mobile phone handset or "smart phone", in which case the communication channel 120 is a wireless channel. In other configurations, the source device 110 and the destination device 130 may include video conferencing equipment, in which case the communication channel 120 is typically a wired channel such as an Internet connection. In addition, the source device 110 and the destination device 130 may include any of a wide range of devices, including devices that support over-the-air television broadcasts, cable television applications, Internet video applications (including streaming), and applications that capture encoded video data on some computer-readable storage medium (such as a hard drive in a file server).
[0053] like Figure 1 As shown, source device 110 includes video source 112, video encoder 114, and transmitter 116. Video source 112 typically includes a source of captured video frame data (denoted as 113), such as a camera sensor, a previously captured video sequence stored on a non-transitory recording medium, or a video feed from a remote camera sensor. Video source 112 may also be the output of a computer graphics card (e.g., display operating system and video output of various applications executed on a computing device (e.g., tablet computer)). Examples of source device 110 that may include a camera sensor as video source 112 include smart phones, video camcorders, professional video cameras, and web video cameras.
[0054] The video encoder 114 converts (or "encodes") the captured frame data (indicated by arrow 113) from the video source 112 into a bitstream (indicated by arrow 115). The bitstream 115 is transmitted by a transmitter 116 as encoded video data (or "encoded video information") via a communication channel 120. The bitstream 115 may also be stored in a non-transitory storage device 122, such as a "flash" memory or a hard drive, until or in lieu of subsequent transmission via the communication channel 120. For example, the encoded video data may be supplied to a customer via a wide area network (WAN) for video streaming applications when desired.
[0055] The destination device 130 includes a receiver 132, a video decoder 134, and a display device 136. The receiver 132 receives the encoded video data from the communication channel 120 and passes the received video data to the video decoder 134 as a bit stream (indicated by arrow 133). The video decoder 134 then outputs the decoded frame data (indicated by arrow 135) to the display device 136. The decoded frame data 135 has the same chroma format as the frame data 113. Examples of the display device 136 include a cathode ray tube, a liquid crystal display (such as in a smart phone, a tablet computer, a computer monitor, or a stand-alone television). The functions of the source device 110 and the destination device 130 can also be embodied in a single device, examples of which include a mobile phone handset and a tablet computer. The decoded frame data can be further transformed before being presented to the user. For example, a "viewport" with a specific latitude and longitude can be rendered from the decoded frame data using a projection format to represent a 360o view of the scene.
[0056] Although example devices are described above, source device 110 and destination device 130 may each typically be configured within a general purpose computer system via a combination of hardware and software components. Figure 2ASuch a computer system 200 is shown, which includes: a computer module 201; input devices such as a keyboard 202, a mouse pointer device 203, a scanner 226, a camera 227 that can be configured as a video source 112, and a microphone 280; and output devices including a printer 215, a display device 214 that can be configured as a display device 136, and a speaker 217. The computer module 201 can use an external modulator-demodulator (modem) transceiver device 216 to communicate with a communication network 220 via a connection 221. The communication network 220, which can represent a communication channel 120, can be a WAN, such as the Internet, a cellular telecommunications network, or a private WAN. In the case where the connection 221 is a telephone line, the modem 216 can be a traditional "dial-up" modem. Alternatively, in the case where the connection 221 is a high-capacity (e.g., cable or optical) connection, the modem 216 can be a broadband modem. Wireless modems can also be used to make wireless connections to the communication network 220. The transceiver device 216 may provide the functionality of the transmitter 116 and the receiver 132 , and the communication channel 120 may be embodied in the wiring 221 .
[0057] The computer module 201 typically includes at least one processor unit 205 and a memory unit 206. For example, the memory unit 206 may have a semiconductor random access memory (RAM) and a semiconductor read-only memory (ROM). The computer module 201 also includes a plurality of input / output (I / O) interfaces, wherein the plurality of input / output (I / O) interfaces include: an audio-video interface 207 connected to a video display 214, a speaker 217, and a microphone 280; an I / O interface 213 connected to a keyboard 202, a mouse 203, a scanner 226, a camera 227, and an optional joystick or other human-machine interface device (not shown); and an interface 208 for an external modem 216 and a printer 215. The signal from the audio-video interface 207 to the computer monitor 214 is typically the output of a computer graphics card. In some implementations, the modem 216 may be built into the computer module 201, such as built into the interface 208. The computer module 201 also has a local network interface 211, which allows the computer system 200 to be connected to a local area communication network 222, known as a local area network (LAN), via a connection 223. Figure 2A As shown, the local area communication network 222 can also be connected to the wide area network 220 via the connection 224, wherein the local area communication network 222 usually includes a so-called "firewall" device or a device with similar functions. The local network interface 211 may include an Ethernet (Ethernet TM )Circuit card, Bluetooth TM) wireless configuration or IEEE 802.11 wireless configuration; however, for the interface 211, a variety of other types of interfaces can be implemented. The local network interface 211 can also provide the functions of the transmitter 116 and the receiver 132, and the communication channel 120 can also be embodied in the local communication network 222.
[0058] I / O interfaces 208 and 213 may provide either or both serial and parallel connections, the former of which is typically implemented in accordance with the Universal Serial Bus (USB) standard and having a corresponding USB connector (not shown). A storage device 209 is provided, and the storage device 209 typically includes a hard disk drive (HDD) 210. Other storage devices (not shown) such as floppy disk drives and tape drives may also be used. An optical disk drive 212 is typically provided to serve as a non-volatile source of data. For example, an optical disk (e.g., CD-ROM, DVD, Blu-ray Disc) may be used. TM )), portable memory devices such as USB-RAM, portable external hard drives and floppy disks, etc., as suitable sources of data for computer system 200. Generally, any of HDD 210, optical drive 212, networks 220 and 222 may also be configured to operate as video source 112, or as a destination for decoded video data to be stored for reproduction via display 214. Source device 110 and destination device 130 of system 100 may be embodied in computer system 200.
[0059] The components 205-213 of the computer module 201 typically communicate via an interconnect bus 204 and in a manner that results in conventional operating modes of the computer system 200 known to those skilled in the relevant art. For example, the processor 205 is connected to the system bus 204 using a connection 218. Similarly, the memory 206 and the optical drive 212 are connected to the system bus 204 via a connection 219. Examples of computers that can practice the described configuration include IBM-PC and compatible machines, Sun SPARCstation, Apple Mac TM or similar computer system.
[0060] Where appropriate or desired, the video encoder 114 and the video decoder 134 and the methods described below may be implemented using the computer system 200. In particular, the video encoder 114, the video decoder 134 and the methods to be described may be implemented as one or more software applications 233 executable within the computer system 200. In particular, instructions 231 (see instructions 231 and 233) executed within the computer system 200 may be used to implement the video encoder 114 and the video decoder 134 and the methods to be described. Figure 2B) to implement the video encoder 114, the video decoder 134 and the steps of the method. The software instructions 231 may be formed into one or more code modules, each for performing one or more specific tasks. The software may also be split into two separate parts, with a first part and corresponding code modules performing the method, and a second part and corresponding code modules managing a user interface between the first part and a user.
[0061] For example, the software may be stored in a computer readable medium including a storage device as described below. The software is loaded from the computer readable medium into the computer system 200 and then executed by the computer system 200. A computer readable medium with such software or a computer program recorded on the computer readable medium is a computer program product. The use of the computer program product in the computer system 200 preferably implements an advantageous device for implementing the video encoder 114, the video decoder 134 and the method.
[0062] The software 233 is typically stored in the HDD 210 or the memory 206. The software is loaded into the computer system 200 from a computer readable medium and executed by the computer system 200. Thus, for example, the software 233 may be stored on an optically readable disk storage medium (e.g., a CD-ROM) 225 read by the optical drive 212.
[0063] In some examples, the application 233 is provided to the user in a manner encoded on one or more CD-ROMs 225 and read via corresponding drives 212, or alternatively, the application 233 can be read by the user from the network 220 or 222. Furthermore, the software can also be loaded into the computer system 200 from other computer-readable media. Computer-readable storage media refers to any non-transitory tangible storage medium that provides recorded instructions and / or data to the computer system 200 for execution and / or processing. Examples of such storage media include floppy disks, magnetic tapes, CD-ROMs, DVDs, Blu-ray Discs, and the like. TM ), a hard disk drive, a ROM or integrated circuit, a USB memory, a magneto-optical disk, or a computer readable card such as a PCMCIA card, etc., regardless of whether these devices are internal or external to the computer module 201. Examples of temporary or non-tangible computer-readable transmission media that can also participate in providing software, applications, instructions and / or video data or encoded video data to the computer module 401 include: radio or infrared transmission channels and network connections to other computers or networked devices, and the Internet or intranet including email transmission and information recorded on websites.
[0064] The second part of the above-mentioned application program 233 and the corresponding code module can be executed to implement one or more graphical user interfaces (GUIs) to be drawn or otherwise presented on the display 214. Users and applications of the computer system 200 can operate the interface in a functionally applicable manner by typically operating the keyboard 202 and the mouse 203 to provide control commands and / or input to the applications associated with these (one or more) GUIs. Other forms of user interfaces that are functionally applicable can also be implemented, such as audio interfaces that utilize voice prompts output via the speaker 217 and user voice commands input via the microphone 280, etc.
[0065] Figure 2B is a detailed schematic block diagram of the processor 205 and the "memory" 234. The memory 234 represents Figure 2A A logical aggregation of all memory modules (including HDD 209 and semiconductor memory 206) that can be accessed by computer module 201 in.
[0066] When the computer module 201 is initially powered on, a power-on self-test (POST) program 250 is executed. The POST program 250 is usually stored in Figure 2A 249 of the semiconductor memory 206. Hardware devices such as ROM 249 that store software are sometimes referred to as firmware. POST program 250 checks the hardware within computer module 201 to ensure proper operation, and typically checks processor 205, memory 234 (209, 206), and basic input-output system software (BIOS) module 251, which is also typically stored in ROM 249, for correct operation. Once POST program 250 runs successfully, BIOS 251 starts Figure 2A The hard disk drive 210 is started so that the boot loader 252 residing on the hard disk drive 210 is executed via the processor 205. This loads the operating system 253 into the RAM memory 206, where the operating system 253 starts to work on the RAM memory 206. The operating system 253 is a system-level application executable by the processor 205 to implement various high-level functions including processor management, memory management, device management, storage management, software application interface, and general user interface.
[0067] The operating system 253 manages the memory 234 (209, 206) to ensure that each process or application running on the computer module 201 has sufficient memory to execute without conflicting with memory allocated to other processes. In addition, the appropriate use of Figure 2AThe different types of memory available in the computer system 200 are described so that each process can run efficiently. Therefore, the aggregate memory 234 is not intended to illustrate how to allocate specific segments of memory (unless otherwise specified), but rather to provide an overview of the memory accessible to the computer system 200 and how to use it.
[0068] like Figure 2B As shown, the processor 205 includes a plurality of functional modules, wherein the plurality of functional modules include a control unit 239, an arithmetic logic unit (ALU) 240, and a local or internal memory 248 sometimes referred to as a cache memory. The cache memory 248 typically includes a plurality of storage registers 244-246 in a register section. One or more internal buses 241 functionally interconnect these functional modules. The processor 205 also typically has one or more interfaces 242 for communicating with external devices via the system bus 204 using a connection 218. The memory 234 is connected to the bus 204 using a connection 219.
[0069] The application program 233 includes an instruction sequence 231 that may include conditional branch instructions and loop instructions. The program 233 may also include data 232 used when executing the program 233. The instructions 231 and data 232 are stored in memory locations 228, 229, 230 and 235, 236, 237, respectively. Depending on the relative size of the instructions 231 and the memory locations 228-230, a particular instruction may be stored in a single memory location, as described by the instruction shown in memory location 230. Alternatively, the instruction may be split into multiple parts, each stored in a separate memory location, as described by the instruction segments shown in memory locations 228 and 229.
[0070] Typically, a processor 205 is given a set of instructions, which are executed within the processor 205. The processor 205 awaits a subsequent input, which the processor 205 reacts to by executing another set of instructions. Each input may be provided from one or more of a plurality of sources, including data generated by one or more of the input devices 202, 203, data received from an external source via one of the networks 220, 202, data retrieved from one of the storage devices 206, 209, or data retrieved from a storage medium 225 inserted into a corresponding reader 212 (all of which are described in detail in the accompanying drawings). Figure 2A Execution of a set of instructions may result in outputting data in some cases. Execution may also involve storing data or variables to memory 234.
[0071] The video encoder 114, the video decoder 134, and the method may use input variables 254 stored in corresponding memory locations 255, 256, 257 within the memory 234. The video encoder 114, the video decoder 134, and the method produce output variables 261 stored in corresponding memory locations 262, 263, 264 within the memory 234. Intermediate variables 258 may be stored in memory locations 259, 260, 266, and 267.
[0072] refer to Figure 2B The processor 205, registers 244, 245, 246, arithmetic logic unit (ALU) 240 and control unit 239 work together to perform micro-operation sequences required to perform a "fetch, decode and execute" cycle for each instruction in the instruction set that constitutes the program 233. Each fetch, decode and execute cycle includes:
[0073] A fetch operation for fetching or reading an instruction 231 from a memory location 228 , 229 , 230 ;
[0074] a decode operation in which the control unit 239 determines which instruction was fetched; and
[0075] An execution operation, wherein in the execution operation, the control unit 239 and / or the ALU 240 executes the instruction.
[0076] Thereafter, further fetch, decode and execute cycles for the next instruction may be performed. Likewise, a store cycle may be performed, whereby the control unit 239 stores or writes a value to the memory location 232 .
[0077] To be explained Figures 13 to 16 Each step or sub-process in the method is associated with one or more segments of program 233, and is typically performed by the register units 244, 245, 247, ALU 240 and control unit 239 in the processor 205 working together to perform fetch, decode and execute cycles for each instruction in the instruction set of the segment of program 233.
[0078] Figure 3 is a schematic block diagram illustrating the functional modules of the video encoder 114 . Figure 4 1 is a schematic block diagram showing the functional modules of the video decoder 134. Typically, data is transferred between the functional modules within the video encoder 114 and the video decoder 134 in groups of samples or coefficients (such as partitioning of a block into fixed-size sub-blocks, etc.) or as an array. Figure 2A and 2BAs shown, the video encoder 114 and the video decoder 134 may be implemented using a general purpose computer system 200, wherein various functional modules may be implemented using dedicated hardware within the computer system 200, using software executable within the computer system 200 (such as one or more software code modules of a software application 233 residing on a hard drive 205 and controlled by a processor 205 for execution, etc.). Alternatively, the video encoder 114 and the video decoder 134 may be implemented using a combination of dedicated hardware and software executable within the computer system 200. The video encoder 114, the video decoder 134 and the method may alternatively be implemented in dedicated hardware such as one or more integrated circuits that perform the functions or sub-functions of the method. Such dedicated hardware may include a graphics processing unit (GPU), a digital signal processor (DSP), an application specific standard product (ASSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or one or more microprocessors and associated memory. In particular, the video encoder 114 includes modules 310 - 386 , and the video decoder 134 includes modules 420 - 496 , where each of these modules may be implemented as one or more software code modules of the software application 233 .
[0079] although Figure 3 The video encoder 114 is an example of a universal video coding (VVC) video encoding pipeline, but other video codecs may also be used to perform the processing stages described herein. The video encoder 114 receives captured frame data 113, such as a series of frames (each frame including one or more color channels). The frame data 113 may include a two-dimensional array of luminance ("luminance channel") and chrominance ("chrominance channel") samples arranged in a "chroma format" (e.g., 4:0:0, 4:2:0, 4:2:2, or 4:4:4 chroma format). The block partitioner 310 first divides the frame data 113 into CTUs, which are generally square in shape and are configured so that a specific size of the CTU is used. For example, the size of the CTU may be 64×64, 128×128, or 256×256 luminance samples.
[0080] The block partitioner 310 further partitions each CTU into one or more CUs corresponding to the common coding tree or the luma coding tree or the chroma coding tree at the point where the common coding tree is split into a luma branch and a chroma branch. The luma channel may also be referred to as a primary color channel. Each chroma channel may also be referred to as a secondary color channel. The CU has various sizes and may include both square and non-square aspect ratios. Reference Fig.13 and Fig.14The operation of the block partitioner 310 is further described. However, in the VVC standard, CU / CB, PU / PB, and TU / TB always have side lengths that are powers of 2. Thus, the current CU (denoted as 312) is output from the block partitioner 310, thereby advancing according to iterations of one or more blocks of the CTU, according to a common tree of the CTU, or a luma coding tree and a chroma coding tree. The following references Figure 5 and 6 To further illustrate the options for partitioning a CTU into CBs.
[0081] The CTUs resulting from the first partitioning of the frame data 113 may be scanned in raster scan order and may be grouped into one or more "slices". A slice may be an "intra" (or "I") slice. An intra slice (I slice) does not contain an inter-predicted CU, e.g., only intra prediction is used. Optionally, a slice may be uni-predicted or bi-predicted ("P" or "B" slices, respectively), indicating the additional availability of one or two reference blocks for predicting the CU, known as "uni-prediction" and "bi-prediction", respectively.
[0082] In an I slice, the coding tree for each CTU may diverge below the 64×64 level into two separate coding trees, one for luma and the other for chroma. Using separate trees allows different block structures to exist between luma and chroma within the luma 64×64 region of the CTU. For example, a large chroma CB may be co-located with many smaller luma CBs, and vice versa. In a P or B slice, a single coding tree for a CTU defines a block structure common to luma and chroma. The resulting blocks of a single tree may be intra-predicted or inter-predicted.
[0083] For each CTU, the video encoder 114 operates in two stages. In the first stage (referred to as the "search" stage), the block partitioner 310 tests various potential configurations of the coding tree. Each potential configuration of the coding tree has an associated "candidate" CU. The first stage involves testing various candidate CUs to select a CU that provides relatively high compression efficiency and relatively low distortion. This testing typically involves Lagrangian optimization, whereby candidate CUs are evaluated based on a weighted combination of rate (coding cost) and distortion (error with respect to the input frame data 113). The "best" candidate CU (the CU with the lowest evaluated rate / distortion) is selected for subsequent encoding in the bitstream 115. The evaluation of candidate CUs includes the following options: use the CU for a given region, or split the region according to various splitting options and use other CUs to encode each smaller resulting region or further split the region. As a result, both the coding tree and the CU itself are selected in the search stage.
[0084] The video encoder 114 generates a prediction block (PU) indicated by arrow 320 for each CU (e.g., CU 312). PU 320 is a prediction of the content of the associated CU 312. Subtractor module 322 generates a difference (or "residual", which means that the difference is in the spatial domain) between PU 320 and CU 312, represented as 324. Difference 324 is a block-sized array of differences between corresponding samples in PU 320 and CU 312, and is generated for each color channel of CU 312. When a primary and (optionally) secondary transform is to be performed, difference 324 is transformed in modules 326 and 330 to be passed to quantizer module 334 via multiplexer 333 for quantization. When the transform is skipped, difference 324 is passed directly to quantizer module 334 via multiplexer 333 for quantization. The selection between transform and transform skip is made independently for each TB associated with CU 312. The resulting quantized residual coefficients are represented as TBs (for each color channel of CU 312), indicated by arrow 336. PU 320 and associated TB 336 are typically selected from one of a plurality of possible candidate CUs (eg, based on evaluated cost or distortion).
[0085] A candidate CU is a CU derived from one of the prediction modes available to the video encoder 114 for the associated PB and the resulting residual. When combined with the predicted PB in the video decoder 114, adding the TB 336 after conversion back to the spatial domain reduces the difference between the decoded CU and the original CU 312 at the expense of additional signaling in the bitstream.
[0086] Thus, each candidate coding block (CU) (i.e., a combination of a prediction block (PU) and a transform block (TB) for each color channel of the CU) has an associated coding cost (or "rate") and an associated difference (or "distortion"). The distortion of a CU is typically estimated as a difference in sample values, such as a sum of absolute differences (SAD) or a sum of squared differences (SSD), etc. The mode selector 386 can use the difference 324 to determine the estimates obtained from each candidate PU to determine a prediction mode 387. The prediction mode 387 indicates the decision to use a specific prediction mode (e.g., intra prediction or inter prediction) for the current CU. For an intra-predicted CU belonging to a common coding tree, independent intra-prediction modes are specified for luma PB vs chroma PB. For an intra-predicted CU belonging to the luma or chroma branch of a dual coding tree, one intra-prediction mode is applied to the luma PB or chroma PB, respectively. The estimation of the coding cost associated with each candidate prediction mode and the corresponding residual encoding can be performed at a significantly lower cost than entropy encoding of the residual. Therefore, even in a real-time video encoder, multiple candidate modes can be evaluated to determine the best mode in terms of rate-distortion.
[0087] A Lagrangian or similar optimization process may be employed for both the selection of the best partition of a CTU into a CB (using the block partitioner 310) and the selection of the best prediction mode from a plurality of possible prediction modes. By applying the Lagrangian optimization process of the candidate modes in the mode selector module 386, the intra prediction mode 387, secondary transform index 388, main transform type 389, and transform skip flag 390 (one for each TB) with the lowest cost measure are selected.
[0088] In the second stage of the operation of the video encoder 114, referred to as the "encoding" stage, iterations of the determined coding tree(s) for each CTU are performed in the video encoder 114. For CTUs using separate trees, the luma coding tree is first encoded, followed by the chroma coding tree, for each 64x64 luma region of the CTU. Only luma CBs are encoded within the luma coding tree, and only chroma CBs are encoded within the chroma coding tree. For CTUs using a common tree, a single tree describes the CU, i.e., luma CBs and chroma CBs, according to the common block structure of the common tree.
[0089] The entropy encoder 338 supports both variable length encoding of syntax elements and arithmetic encoding of syntax elements. Portions of the bitstream such as "parameter sets" (e.g., sequence parameter sets (SPS), picture parameter sets (PPS), and picture headers (PH)) use a combination of fixed length codewords and variable length codewords. A slice (also referred to as a continuous portion) has a slice header using variable length encoding, followed by slice data using arithmetic encoding. The picture header defines parameters specific to the current slice, such as picture-level quantization parameter offsets, etc. The slice data includes syntax elements for each CTU in the slice. The use of variable length encoding and arithmetic encoding requires sequential parsing within the various portions of the bitstream. These portions can be described with start codes to form "network abstraction layer units" or "NAL units". Arithmetic coding is supported using context-adaptive binary arithmetic coding processing. Arithmetic coded syntax elements consist of a sequence of one or more "bins". Like bits, bin values are "0" or "1". However, bins are not encoded as discrete bits in the bitstream 115. A bin has an associated predicted (or "likely" or "maximum probability") value and an associated probability (called a "context"). When the actual bin to be encoded matches the predicted value, a "maximum probability symbol" (MPS) is encoded. Encoding the maximum probability symbol is relatively cheap in terms of consumed bits in the bitstream 115 (including a total cost of less than one discrete bit). When the actual bin to be encoded does not match the possible value, a "minimum probability symbol" (LPS) is encoded. Encoding the minimum probability symbol has a relatively high cost in terms of consumed bits. Bin encoding techniques enable efficient encoding of bins with skewed probabilities of "0" vs "1". For syntactic elements with two possible values (i.e., "flag"), a single bin is sufficient. For syntactic elements with many possible values, a sequence of bins is required.
[0090] The presence of a later bin in the sequence may be determined based on the value of an earlier bin in the sequence. In addition, each bin may be associated with more than one context. A particular context may be selected based on, for example, an earlier bin in a syntax element and the bin values of adjacent syntax elements (i.e., bin values from adjacent blocks). Each time a context coding bin is encoded, the context selected for that bin (if any) is updated to reflect the new bin value. In this way, the binary arithmetic coding scheme is considered to be adaptive.
[0091] The video encoder 114 also supports bins lacking context ("bypass bins"). Bypass bins are encoded assuming an equal probability distribution between "0" and "1". Thus, each bin has an encoding cost of one bit in the bitstream 115. The absence of context saves memory and reduces complexity, so bypass bins where the distribution of values for a particular bin is not skewed are used. An example of an entropy encoder that employs context and adaptation is known in the art as CABAC (Context Adaptive Binary Arithmetic Coder), and many variations of this encoder are employed in video encoding.
[0092] The entropy encoder 338 uses a combination of context-coded bins and bypass-coded bins and an intra-prediction mode 387 to encode a primary transform type 389, a transform skip flag (i.e., 390) for each TB of the current CU, and, if used for the current CB, a secondary transform index 388. The secondary transform index 388 is signaled when the residual associated with the transform block includes significant residual coefficients only in those coefficient positions that are transformed into primary coefficients by applying a secondary transform.
[0093] The multiplexer module 384 outputs the PB 320 from the intra prediction module 364 according to the determined best intra prediction mode selected from the test prediction modes of each candidate CB. The candidate prediction modes do not need to include every conceivable prediction mode supported by the video encoder 114. Intra prediction is divided into three types. "DC intra prediction" involves filling the PB with a single value representing the average of nearby reconstructed samples. "Plane intra prediction" involves filling the PB with samples according to a plane, where the DC offset and vertical and horizontal gradients are derived from nearby reconstructed neighboring samples. Nearby reconstructed samples typically include a row of reconstructed samples above the current PB (extending to a certain extent to the right of the PB) and a column of reconstructed samples on the left side of the current PB (extending to a certain extent downward outside the PB). "Angle intra prediction" involves filling the PB with reconstructed neighboring samples, which are filtered and propagated across the PB in a specific direction (or "angle"). In VVC, 65 angles are supported, where rectangular blocks can use additional angles that are not available to square blocks to produce a total of 87 angles. A fourth type of intra prediction can be used for chroma PBs, generating PBs from collocated luma reconstruction samples according to a "cross component linear model" (CCLM) mode. Three different CCLM modes are available, each using a different model derived from adjacent luma and chroma samples. The derived model is used to generate a block of samples for a chroma PB from collocated luma samples.
[0094] In cases where previously reconstructed samples are not available (e.g., at the edge of a frame), a default halftone value of half the sample range is used. For example, for 10-bit video, a value of 512 is used. Since no previous samples are available for a CB located at the top left position of the frame, the angular and planar intra prediction modes produce the same output as the DC prediction mode, i.e., a flat plane of samples with halftone values as amplitudes.
[0095] For inter-frame prediction, a prediction block 382 is generated by a motion compensation module 380 using samples from one or two frames preceding the current frame in the order of coded frames in the bitstream and output as a PB 320 by a multiplexer module 384. In addition, for inter-frame prediction, a single coding tree is typically used for both the luminance channel and the chrominance channel. The order of coded frames in the bitstream may be different from the order of frames when captured or displayed. When one frame is used for prediction, the block is called "single prediction" and has two associated motion vectors. When two frames are used for prediction, the block is called "double prediction" and has two associated motion vectors. For P slices, each CU can be intra-predicted or single-predicted. For B slices, each CU can be intra-predicted, single-predicted, or double-predicted. Frames are typically encoded using a "picture group" structure, thereby achieving a temporal hierarchical structure of frames. Frames can be divided into multiple slices, each encoding a portion of a frame. The temporal hierarchical structure of frames allows frames to reference previous and subsequent pictures in the order in which the frames are displayed. Images are encoded in the order necessary to ensure that the dependencies for decoding each frame are met.
[0096] Samples are selected based on the motion vector 378 and the reference picture index. The motion vector 378 and the reference picture index apply to all color channels, so inter prediction is described primarily in terms of operations on PUs rather than PBs, i.e., a single coding tree is used to describe the decomposition of each CTU into one or more inter prediction blocks. Inter prediction methods may vary in the number of motion parameters and their precision. The motion parameters typically include a reference frame index (which indicates which reference frames from a reference frame list will be used plus their respective spatial translations), but may include more frames, special frames, or complex affine parameters such as scaling and rotation. In addition, a predetermined motion refinement process may be applied to generate a dense motion estimate based on a block of reference samples.
[0097] When PU 320 is determined and selected and subtracted from the original sample block at subtractor 322, a residual with the lowest coding cost (denoted as 324) is obtained and lossy compressed. The lossy compression process includes the steps of transform, quantization and entropy coding. The forward main transform module 326 applies a forward transform to the difference 324, thereby converting the difference 324 from the spatial threshold to the frequency domain according to the main transform type 389 and producing the main transform coefficients represented by arrow 328. The maximum main transform size in one dimension is a 32-point DCT-2 or a 64-point DCT-2 transform. If the CB being encoded is larger than the maximum supported main transform size (i.e., 64×64 or 32×32) represented as a block size, the main transform 326 is applied in a block manner to transform all samples of the difference 324. In the case where the respective transform applications operate on a difference 324 TB that is larger than 32×32 (e.g., 64×64), all resulting main transform coefficients 328 outside the upper left 32×32 region of the TB are set to zero, i.e., discarded. For TBs of size up to 32×32, the main transform type 389 may indicate that a combination of DST-7 and DCT-8 transforms are applied horizontally and vertically. The remaining main transform coefficients 328 are passed to the forward secondary transform module 330.
[0098] The secondary transform module 330 generates secondary transform coefficients 332 according to the secondary transform index 388. The secondary transform coefficients 332 are quantized by module 334 according to the quantization parameters associated with the CB to generate residual coefficients 336. When the transform skip flag 390 indicates that transform skip is enabled for the TB, the difference 324 is passed to the quantizer 334 via the multiplexer 333.
[0099] The forward main transform of module 326 is typically separable, transforming a set of rows of each TB and then a set of columns. Depending on the main transform type 389, the forward main transform module 326 uses a type II discrete cosine transform (DCT-2) in the horizontal and vertical directions, or a combination of a type VII discrete sine transform (DST-7) and a type VIII discrete cosine transform (DCT-8) in the horizontal or vertical directions for the luma TB. The use of a combination of DST-7 and DCT-8 is referred to as a "multiple transform selection set" (MTS) in the VVC standard. When DCT-2 is used, the maximum TB size is 32×32 or 64×64, which can be configured in the video encoder 114 and signaled in the bitstream 115. Regardless of the configured maximum DCT-2 transform size, only the coefficients in the upper left 32×32 region of the TB are encoded in the bitstream 115. Any significant coefficients outside the upper left 32×32 region of the TB are discarded (or "zeroed") and not encoded in the bitstream 115. MTS is available only for CUs of size up to 32x32, and encodes only coefficients in the upper left 16x16 region of the associated luma TB. Individual TBs of a CU are transformed or bypassed according to the corresponding transform skip flag 390 .
[0100] The forward secondary transform of module 330 is typically a non-separable transform that is only applied to the residual of the intra-predicted CU and can still be bypassed. The forward secondary transform operates on 16 samples (arranged as the upper left 4×4 sub-block of the main transform coefficients 328) or 48 samples (arranged as three 4×4 sub-blocks in the upper left 8×8 coefficients of the main transform coefficients 328) to produce a set of secondary transform coefficients. The number of sets of secondary transform coefficients can be less than the number of sets of main transform coefficients from which they are derived. Since the secondary transform is only applied to sets of coefficients that are adjacent to each other and include the DC coefficient, the secondary transform is called a "low-frequency non-separable secondary transform" (LFNST).
[0101] The residual coefficients 336 are supplied to an entropy encoder 338 for encoding in the bitstream 115. Typically, the residual coefficients of each TB of a TU having at least one valid residual coefficient are scanned to produce an ordered list of values according to a scan pattern. The scan pattern typically scans the TBs as a sequence of 4×4 "sub-blocks", providing a regular scan operation at a granularity of 4×4 groups of residual coefficients, where the arrangement of the sub-blocks depends on the size of the TB. The scanning within each sub-block and the progression from one sub-block to the next typically follows a backward diagonal scan pattern.
[0102] As described above, the video encoder 114 needs access to a frame representation that corresponds to the encoded frame representation seen in the video decoder 134. Thus, the residual coefficients 336 are passed to the dequantizer 340 to produce dequantized residual coefficients 342. The dequantized residual coefficients 342 are passed through the inverse secondary transform module 344 (operating according to the secondary transform coefficients 388) to produce intermediate inverse transform coefficients represented by arrows 346. The intermediate inverse transform coefficients 346 are passed to the inverse main transform module 348 to produce residual samples of the TU represented by arrows 399. If the transform skip 390 indicates that a transform bypass is to be performed, the dequantized residual coefficients 342 are output by the multiplexer 349 as residual samples 350. Otherwise, the multiplexer 349 outputs the residual samples 399 as residual samples 350.
[0103] The inverse transform module 344 performs a type of inverse transform that corresponds to the type of forward transform performed by the forward secondary transform module 330. The inverse transform module 348 performs a type of inverse transform that corresponds to the type of main transform performed by the main transform module 326. A summation module 352 adds the residual samples 350 and the PU 320 to produce reconstructed samples of the CU (indicated by arrow 354).
[0104] The reconstructed samples 354 are passed to the reference sample cache 356 and the in-loop filter module 368. The reference sample cache 356, which is typically implemented using static RAM on an ASIC (thus avoiding expensive off-chip memory accesses), provides the minimum sample storage required to satisfy the dependencies used to generate intra PBs for subsequent CUs in the frame. The minimum dependencies typically include a "line buffer" of samples along the bottom of a row of CTUs for use by the next row of CTUs and a column buffer with a range set by the height of the CTU. The reference sample cache 356 supplies reference samples (represented by arrow 358) to the reference sample filter 360. The sample filter 360 applies a smoothing operation to produce filtered reference samples (indicated by arrow 362). The filtered reference samples 362 are used by the intra prediction module 364 to produce an intra prediction block of samples represented by arrow 366. For each candidate intra prediction mode, the intra prediction module 364 produces a sample block, namely 366. The sample block 366 is generated by module 364 according to the intra prediction module 387 using techniques such as DC, planar or angular intra prediction.
[0105] The in-loop filter module 368 applies several filtering stages to the reconstructed samples 354. The filtering stages include a "deblocking filter" (DBF), which applies smoothing aligned with CU boundaries to reduce artifacts caused by discontinuities. Another filtering stage present in the in-loop filter module 368 is an "adaptive loop filter" (ALF), which applies a Wiener-based adaptive filter to further reduce distortion. Another available filtering stage in the in-loop filter module 368 is a "sample adaptive offset" (SAO) filter. The SAO filter works by first classifying the reconstructed samples into one or more categories and applying an offset at the sample level according to the assigned category.
[0106] Filtered samples, represented by arrow 370, are output from the in-loop filter module 368. The filtered samples 370 are stored in a frame buffer 372. The frame buffer 372 typically has the capacity to store several (e.g., up to 16) pictures and is therefore stored in the memory 206. Due to the large memory consumption required, the frame buffer 372 is typically not stored using on-chip memory. As such, access to the frame buffer 372 is expensive in terms of memory bandwidth. The frame buffer 372 provides a reference frame (represented by arrow 374) to the motion estimation module 376 and the motion compensation module 380.
[0107] The motion estimation module 376 estimates a plurality of "motion vectors" (denoted as 378), each of which is a Cartesian spatial offset relative to the position of the current CB, thereby referencing a block in one of the reference frames in the frame buffer 372. A filtered block of reference samples (denoted as 382) is generated for each motion vector. The filtered reference samples 382 form a further candidate mode for potential selection by the mode selector 386. In addition, for a given CU, the PB 320 may be formed using one reference block ("uni-prediction"), or may be formed using two reference blocks ("bi-prediction"). For the selected motion vector, the motion compensation module 380 generates the PU 320 according to a filtering process that supports sub-pixel precision in the motion vector. In this way, the motion estimation module 376 (which operates on many candidate motion vectors) can perform a simplified filtering process compared to the motion compensation module 380 (which operates only on the selected candidate) to achieve reduced computational complexity. When the video encoder 114 selects inter-frame prediction for the CU, the motion vector 378 is encoded in the bitstream 115.
[0108] Although the reference to Versatile Video Coding (VVC) describes Figure 3 114, but other video coding standards or implementations may also use the processing stages of modules 310-386. Frame data 113 (and bit stream 115) may also be obtained from memory 206, hard drive 210, CD-ROM, Blue-ray diskTM ) or other computer-readable storage medium (or written to memory 206, hard drive 210, CD-ROM, Blu-ray disc or other computer-readable storage medium). In addition, frame data 113 (and bit stream 115) can be received from (or sent to) an external source (such as a server or radio frequency receiver connected to communication network 220).
[0109] exist Figure 4 The video decoder 134 is shown in FIG. Figure 4 The video decoder 134 of FIG. 1 is an example of a Versatile Video Coding (VVC) video decoding pipeline, but other video codecs may also be used to perform the processing stages described herein. Figure 4 As shown, the bitstream 133 is input to the video decoder 134. The bitstream 133 can be read from the memory 206, the hard disk drive 210, the CD-ROM, the Blu-ray disc or other non-transitory computer-readable storage medium. Alternatively, the bitstream 133 can be received from an external source (such as a server or a radio frequency receiver connected to the communication network 220). The bitstream 133 contains the encoding syntax elements representing the captured frame data to be decoded.
[0110] The bitstream 133 is input to the entropy decoder module 420. The entropy decoder module 420 extracts the syntax elements from the bitstream 133 by decoding the "bin" sequence and passes the values of the syntax elements to other modules in the video decoder 134. The entropy decoder module 420 uses variable length and fixed length decoding to decode SPS, PPS or slice headers, and uses an arithmetic decoding engine to decode the syntax elements of slice data into a sequence of one or more bins. Each bin can use one or more "contexts", and the context description is used to encode the probability level of "one" and "zero" values for the bin. In the case where multiple contexts can be used for a given bin, a "context modeling" or "context selection" step is performed to select one of the available contexts to decode the bin.
[0111] The entropy decoder module 420 applies an arithmetic coding algorithm, such as "context adaptive binary arithmetic coding" (CABAC), to decode syntax elements from the bitstream 133. The decoded syntax elements are used to reconstruct parameters within the video decoder 134. The parameters include residual coefficients (represented by arrow 424), quantization parameters (not shown), secondary transform indexes 474, and mode selection information (represented by arrow 458) such as intra prediction modes. The mode selection information also includes information such as motion vectors, and partitioning of each CTU into one or more CUs. The parameters are used to generate PBs, typically in combination with sample data from previously decoded CBs.
[0112] The residual coefficients 424 are passed to a dequantizer module 428. The dequantizer module 428 inverse quantizes (or "scales") the residual coefficients 424 (i.e., in the main transform coefficient domain) to create reconstructed transform coefficients represented by arrows 432. The reconstructed transform coefficients 432 are passed to an inverse secondary transform module 436. The inverse secondary transform module 436 generates the residual coefficients 424 according to the reference 432 encoded by the entropy decoder 420. Fig.15 and 16 The described method applies a secondary transform or does not operate (bypass) the secondary transform type 474 decoded from the bitstream 113. The inverse secondary transform module 436 produces reconstructed transform coefficients 440, which are primary transform domain coefficients.
[0113] The reconstructed transform coefficients 440 are passed to an inverse main transform module 444. Module 444 transforms the coefficients 440 from the frequency domain back to the spatial domain according to the main transform type 476 (or "mts_idx") decoded from the bitstream 133 by the entropy decoder 420. The result of the operation of module 444 is a block of residual samples represented by arrow 499. When the transform skip flag 478 for a given TB of the CU indicates that the transform is bypassed, the multiplexer 449 outputs the reconstructed transform coefficients 432 as residual samples 488 to the summation module 450. Otherwise, the multiplexer 449 outputs the residual samples 499 as residual samples 488. The block of residual samples 448 is equal in size to the corresponding CB. The block of residual samples 448 is supplied to the summation module 450. At the summation module 450, the residual samples 448 are added to the decoded PB represented as 452 to produce a block of reconstructed samples represented by arrow 456. The reconstructed samples 456 are supplied to a reconstructed sample cache 460 and an in-loop filtering module 488. The in-loop filtering module 488 produces a reconstructed block of frame samples indicated as 492. The frame samples 492 are written to a frame buffer 496 which later outputs the frame data 135.
[0114] The reconstructed sample cache 460 operates in a manner similar to the reconstructed sample cache 356 of the video encoder 114. The reconstructed sample cache 460 provides storage for the reconstructed samples needed for intra prediction of subsequent CBs without having to resort to accessing the memory 206 (e.g., by using the data 232, which is typically on-chip memory, instead). Reference samples, represented by arrows 464, are obtained from the reconstructed sample cache 460 and are supplied to a reference sample filter 468 to produce filtered reference samples, represented by arrows 472. The filtered reference samples 472 are supplied to an intra prediction module 476. The module 476 produces a block of intra prediction samples, represented by arrows 480, based on the intra prediction mode parameters 458 represented in the bitstream 133 and decoded by the entropy decoder 420. The block of samples 480 is generated based on the intra prediction mode 458 using a mode such as DC, planar or angular intra prediction.
[0115] When the prediction mode of the CB is indicated in the bitstream 133 to use intra prediction, the intra prediction samples 480 form the decoded PB 452 via the multiplexer module 484. Intra prediction produces a prediction block (PB) of samples, i.e., a block in one color component derived using "neighboring samples" in the same color component. Neighboring samples are samples that are adjacent to the current block and have been reconstructed because they are at the front in the block decoding order. In the case where luma and chroma blocks are juxtaposed, luma and chroma blocks can use different intra prediction modes. However, the two chroma channels share the same intra prediction mode.
[0116] When the prediction mode of the CB is indicated in the bitstream 133 as intra prediction, the motion compensation module 434 uses the motion vector (decoded from the bitstream 133 by the entropy decoder 420) and the reference frame index to select and filter a block of samples 498 from the frame buffer 496 to produce a block of inter-prediction samples indicated as 438. The block of samples 498 is obtained from a previously decoded frame stored in the frame buffer 496. For bi-prediction, two blocks of samples are generated and blended together to produce samples of the decoded PB 452. The frame buffer 496 is populated with filter block data 492 from the in-loop filtering module 488. Like the in-loop filtering module 368 of the video encoder 114, the in-loop filtering module 488 applies any of the DBF, ALF, and SAO filtering operations. Typically, the motion vector is applied to both the luma and chroma channels, but the filtering process for sub-sample interpolation in the luma and chroma channels is different.
[0117] Figure 5 is a schematic block diagram showing a set 500 of possible partitions or splits of a region into one or more sub-regions in each node of a coding tree structure for general video coding. Figure 3 As described, the partitioning shown in set 500 may be utilized by the block partitioner 310 of the encoder 114 to partition each CTU into one or more than one CU or CB according to the coding tree as determined by Lagrangian optimization.
[0118] Although set 500 only shows the partitioning of a square region into other possible non-square sub-regions, it should be understood that set 500 is showing the potential partitioning of a parent node in the coding tree to a child node in the coding tree, and there is no requirement that the parent node corresponds to a square region. If the containing region is non-square, the size of the block resulting from the partition is scaled according to the aspect ratio of the containing block. Once a region is not further split, that is, at a leaf node of the coding tree, a CU occupies the region.
[0119] The process of subdividing a region into subregions is terminated when the resulting subregions reach a minimum CU size (typically 4×4 luma samples). In addition to constraining the CU to prohibit block regions from being smaller than a predetermined minimum size of, for example, 16 samples, the CU is constrained to have a minimum width or height of four. Other minimum values are also possible in terms of width and height or in terms of both width or height. The subdivision process can also be terminated before the deepest level of decomposition, resulting in a CU larger than the minimum CU size. It is possible that no splitting occurs, resulting in a single CU occupying the entire CTU. A single CU occupying the entire CTU is the maximum available coding unit size. Due to the use of subsampled chroma formats (such as 4:2:0, etc.), the arrangement of the video encoder 114 and the video decoder 134 can terminate the splitting of regions in the chroma channel earlier than in the luma channel, including the case of a common coding tree that defines the block structure of the luma and chroma channels. When separate coding trees are used for luma and chroma, the constraints on the available splitting operations ensure a minimum chroma CU area of 16 samples, even if such a CU is collocated with a larger luma area (e.g., 64 luma samples).
[0120] There are CUs at the leaf nodes of the coding tree. For example, leaf node 510 contains a CU. At non-leaf nodes of the coding tree, there are splits to two or more other nodes, where each node can be a leaf node forming a CU, or a non-leaf node containing further splits to smaller areas. At each leaf node of the coding tree, there is a CB for each color channel of the coding tree. The split that terminates at the same depth for both brightness and chrominance of the common tree results in a CU with three juxtaposed CBs.
[0121] like Figure 5 As shown, quadtree split 512 splits the containing area into four equal-sized areas. Compared to HEVC, Versatile Video Coding (VVC) achieves additional flexibility through additional splits, including horizontal binary split 514 and vertical binary split 516. Splits 514 and 516 each split the containing area into two equal-sized areas. The splits are along horizontal boundaries (514) or vertical boundaries (516) within the containing block.
[0122] Further flexibility is achieved in general video coding by adding ternary horizontal split 518 and ternary vertical split 520. Ternary split 518 and 520 divide the block into three regions that form boundaries in the horizontal direction (518) or vertical direction (520) along 1 / 4 and 3 / 4 of the width or height of the containing region. The combination of quadtree, binary tree and ternary tree is called "QTBTTT". The root of the tree includes zero or more quadtree splits (the "QT" part of the tree). Once the QT part is terminated, zero or more binary or ternary splits ("multi-tree" or "MT" part of the tree) may occur, eventually ending in a CB or CU at the leaf node of the tree. In the case where the tree describes all color channels, the leaf node of the tree is a CU. In the case where the tree describes a luminance channel or a chrominance channel, the leaf node of the tree is a CB.
[0123] Compared to HEVC, which only supports quadtrees and therefore only square blocks, QTBTTT, in particular, allows for more possible CU sizes by taking into account possible recursive applications of binary and / or ternary tree splits. When only quadtree splits are available, each increase in the coding tree depth corresponds to a reduction in the CU size to one-quarter the size of the parent region. In VVC, the availability of binary and ternary splits means that the coding tree depth no longer corresponds directly to the CU region. The possibility of abnormal (non-square) block sizes can be reduced by constraining the split options to eliminate splits that will result in block widths or heights less than four samples or that will result in splits that are not multiples of four samples.
[0124] Figure 6 6 is a schematic flow diagram showing a data flow 600 of a QTBTTT (or "coding tree") structure used in general video coding. The QTBTTT structure is used for each CTU to define the partitioning of the CTU into one or more CUs. The QTBTTT structure for each CTU is determined by the block partitioner 310 in the video encoder 114 and encoded into the bitstream 115 or decoded from the bitstream 133 by the entropy decoder 420 in the video decoder 134. Figure 5 As shown partitioned, data flow 600 further features permitted combinations that may be used by block partitioner 310 to partition a CTU into one or more CUs.
[0125] Starting from the top level of the hierarchy, i.e., at the CTU, zero or more quadtree partitions are first performed. Specifically, a quadtree (QT) split decision 610 is made by the block partitioner 310. The decision at 610 returns a "1" symbol, which indicates a decision to split the current node into four child nodes according to the quadtree split 512. The result is that four new nodes are generated, such as at 620, and for each new node, recursively return to the QT split decision 610. Each new node is considered in raster (or Z-scan) order. Alternatively, if the QT split decision 610 indicates that no further splitting is to be performed (returns a "0" symbol), the quadtree partitioning stops, and multi-tree (MT) splitting is then considered.
[0126] First, an MT split decision 612 is made by the block partitioner 310. At 612, a decision to perform an MT split is indicated. A "0" symbol is returned at the decision 612, indicating that no further splitting of the node into child nodes will be performed. If no further splitting of the node will be performed, the node is a leaf node of the coding tree and corresponds to a CU. The leaf node is output at 622. Alternatively, if the MT split 612 indicates a decision to perform an MT split (a "1" symbol is returned), the block partitioner 310 proceeds to a direction decision 614.
[0127] Direction decision 614 indicates the direction of the MT split as horizontal ("H" or "0") or vertical ("V" or "1"). If decision 614 returns "0" indicating a horizontal direction, block partitioner 310 proceeds to decision 616. If decision 614 returns "1" indicating a vertical direction, block partitioner 310 proceeds to decision 618.
[0128] In each of decisions 616 and 618, the number of partitions into which the MT is split is indicated as two (binary split or "BT" nodes) or three (ternary split or "TT") in the case of a BT / TT split. That is, the BT / TT split decision 616 is made by the block partitioner 310 when the direction indicated from 614 is horizontal, and the BT / TT split decision 618 is made by the block partitioner 310 when the direction indicated from 614 is vertical.
[0129] The BT / TT split decision 616 indicates whether the horizontal split is a binary split 514 indicated by returning “0” or a ternary split 518 indicated by returning “1”. When the BT / TT split decision 616 indicates a binary split, at a generate HBT CTU node step 625, the block partitioner 310 generates two nodes according to the binary horizontal split 514. When the BT / TT split 616 indicates a ternary split, at a generate HTT CTU node step 626, the block partitioner 310 generates three nodes according to the ternary horizontal split 518.
[0130] The BT / TT split decision 618 indicates whether the vertical split is a binary split 516 indicated by returning "0" or a ternary split 520 indicated by returning "1". When the BT / TT split 618 indicates a binary split, at step 627 of generating VBT CTU nodes, the block partitioner 310 generates two nodes according to the vertical binary split 516. When the BT / TT split 618 indicates a ternary split, at step 628 of generating VTT CTU nodes, the block partitioner 310 generates three nodes according to the vertical ternary split 520. For each node obtained from steps 625-628, the recursion of the data flow 600 back to the MT split decision 612 is applied in a left-to-right or top-to-bottom order according to the direction 614. As a result, binary and ternary tree splits can be applied to generate CUs of various sizes.
[0131] Fig. 7A and 7B An example partition 700 of a CTU 710 into multiple CUs or CBs is provided. Fig. 7A An example CU 712 is shown in FIG. Fig. 7A 7 shows the spatial arrangement of CUs in a CTU 710. Example partitioning 700 in Figure 7B Also shown in FIG. 7 is a coding tree 720 .
[0132] exist Fig. 7A At each non-leaf node (e.g., nodes 714, 716, and 718) in the CTU 710 of the coding tree 720, the contained nodes (which may be further partitioned or may be CUs) are scanned or traversed in "Z order" to create a list of nodes represented as columns in the coding tree 720. For quadtree splits, the Z order scan results in an order from top left to right followed by a bottom left to right order. For horizontal and vertical splits, the Z order scan (traversal) is simplified to a scan from top to bottom and a scan from left to right, respectively. Figure 7B The coding tree 720 lists all nodes and CUs sorted according to the Z-order traversal of the coding tree. Each split generates a list of two, three or four new nodes at the next level of the tree until a leaf node (CU) is reached.
[0133] In reference Figure 3 Where the image is decomposed into CTUs and further into CUs using block partitioner 310, and the CUs are used to generate respective residual blocks (324), the residual blocks are forward transformed and quantized using video encoder 114. The resulting TBs 336 are then scanned to form a sequential list of residual coefficients as part of the operation of entropy encoding module 338. Equivalent processing is performed in video decoder 134 to obtain the TBs from bitstream 133.
[0134] Fig. 8A , 8B, 8C and 8D show examples of forward and inverse inseparable secondary transforms according to different sizes of transform blocks (TBs). Fig. 8A A set of relationships 800 between primary transform coefficients 802 and secondary transform coefficients 804 for a 4×4 TB size is shown. Primary transform coefficients 802 consist of 4×4 coefficients, while secondary transform coefficients 804 consist of eight coefficients. The eight secondary transform coefficients are arranged in a pattern 806. Pattern 806 corresponds to eight positions adjacent to and including the DC (upper left) position in a backward diagonal scan of the TB. Fig. 8A The remaining eight positions in the backward diagonal scan shown in are not filled by performing a forward secondary transform and therefore remain zero values. Thus, the forward inseparable secondary transform 810 for 4×4 TB receives sixteen primary transform coefficients and produces eight secondary transform coefficients as output. Thus, the forward secondary transform 810 for 4×4 TB can be represented by an 8×16 weight matrix. Similarly, the inverse secondary transform 812 can be represented by a 16×8 weight matrix.
[0135] Figure 8B A set of relationships 818 between the primary transform coefficients and the secondary transform coefficients for 4×N and N×4 TB sizes is shown, where N is greater than 4. In both cases, the upper left 4×4 sub-block of primary coefficients 820 is associated with the upper left 4×4 sub-block of secondary transform coefficients 824. In the video encoder 114, a forward non-separable secondary transform 830 takes sixteen primary transform coefficients and produces sixteen secondary transform coefficients as output. The remaining primary transform coefficients 822 are not filled by the forward secondary transform and therefore remain at zero values. After the forward non-separable secondary transform 830 is performed, the coefficient position 826 associated with the coefficient 822 is not filled and therefore remains at a zero value.
[0136] The forward secondary transform 830 for 4×N or N×4 TB can be represented by a 16×16 weight matrix. The matrix representing the forward secondary transform 830 is defined as A. Similarly, the corresponding inverse secondary transform 832 can be represented by a 16×16 weight matrix. The matrix representing the inverse secondary transform 832 is defined as B.
[0137] The storage requirements of the non-separable transform core are further reduced by reusing portions of A for the 4×4 TB forward secondary transform 810 and inverse secondary transform 812. The first eight rows of A are used for the forward secondary transform 810 and the transpose of the first eight rows of A are used for the inverse secondary transform 812.
[0138] Figure 8CA relationship 855 is shown between the main transform coefficients 840 and the secondary transform coefficients 842 for a TB of size 8×8. The main transform coefficients 840 consist of 8×8 coefficients, while the secondary transform coefficients 842 consist of eight transform coefficients. The eight secondary transform coefficients 842 are arranged in a pattern corresponding to eight consecutive positions in the backward diagonal scan of the TB, and the eight consecutive positions include the DC (upper left) coefficient of the TB. The remaining secondary transform coefficients in the TB are all zero and therefore do not need to be scanned. The forward inseparable secondary transform 850 for the 8×8 TB takes the forty-eight main transform coefficients corresponding to the three 4×4 sub-blocks as input and produces eight secondary transform coefficients. The forward secondary transform 850 for the 8×8 TB can be represented by an 8×48 weight matrix. The corresponding inverse secondary transform 852 for the 8×8 TB can be represented by a 48×8 weight matrix.
[0139] Fig.8D The relationship 875 between the main transform coefficients 860 and the secondary transform coefficients 862 for TBs of size greater than 8×8 is shown. The upper left 8×8 block of the main coefficients 860 (arranged as four 4×4 sub-blocks) is associated with the upper left 4×4 sub-block of the secondary transform coefficients 862. In the video encoder 114, the forward inseparable secondary transform 870 operates on the forty-eight main transform coefficients to produce sixteen secondary transform coefficients. The remaining main transform coefficients 864 are zeroed. The secondary transform coefficient positions 866 outside the upper left 4×4 sub-block of the secondary transform coefficients 862 are not filled and remain zero.
[0140] The forward secondary transform 870 for TBs of size greater than 8×8 may be represented by a 16×48 weight matrix. The matrix representing the forward secondary transform 870 is defined as F. Similarly, the corresponding inverse secondary transform 832 may be represented by a 48×16 weight matrix. The matrix representing the inverse secondary transform 872 is defined as G. As described above with reference to matrices A and B, F desirably has the property of orthogonality. The property of orthogonality means that G=F T And only F needs to be stored in the video encoder 114 and the video decoder 134. An orthogonal matrix can be described as a matrix whose rows have orthogonality.
[0141] The storage requirements of the non-separable transform core are further reduced by reusing portions of F for the 8×8 TB forward secondary transform 850 and inverse secondary transform 852. The first eight rows of F are used for the forward secondary transform 810, and the transpose of the first eight rows of F is used for the inverse secondary transform 812.
[0142] The inseparable secondary transform can achieve coding improvements over using the separable main transform alone because the inseparable secondary transform can sparse two-dimensional features in the residual signal, such as angle features. Since the angle features in the residual signal can depend on the type of the selected intra-frame prediction mode 387, it is advantageous to adaptively select the inseparable secondary transform matrix according to the intra-frame prediction mode. As described above, the intra-frame prediction mode consists of "intra-frame DC", "intra-plane", "intra-angle" mode and "matrix intra-frame prediction" mode. When intra-frame DC prediction is used, the intra-frame prediction mode parameter 458 takes a value of 0. When intra-plane prediction is used, the intra-frame prediction mode parameter 458 takes a value of 1. When intra-frame angle prediction on a square TB is used, the intra-frame prediction mode parameter 458 takes a value between 2 and 66, including 2 and 66.
[0143] Fig. 9 A set 900 of transform blocks available in the Versatile Video Coding (VVC) standard is shown. Fig. 9 Also shown is the application of a secondary transform to a subset of the residual coefficients of the transformed blocks from set 900 . Fig. 9 TBs are shown with widths and heights ranging from 4 to 32. However, TBs with a width and / or height of 64 are possible but not shown for ease of reference.
[0144] A 16-point secondary transform 952 (shown in darker shading) is applied to a 4×4 set of coefficients. The 16-point secondary transform 952 is applied to TBs with a width or height of 4, such as 4×4 TB 910, 8×4 TB 912, 16×4 TB 914, 32×4 TB 916, 4×8 TB 920, 4×16 TB 930, and 4×32 TB 940. The 16-point secondary transform 952 is also applied to TBs of size 4×64 and 64×4 ( Fig. 9 For a TB with a width or height of four but with more than 16 main coefficients, the 16-point secondary transform is applied only to the top left 4×4 sub-block of the TB, and other sub-blocks are required to have zero-valued coefficients to apply the secondary transform. Figures 8A to 8D As described above, applying the 16-point secondary transform obtains 8 or 16 secondary transform coefficients. The secondary transform coefficients are packed into a TB to be encoded in the upper left sub-block of the TB.
[0145] For transform sizes with width and height greater than four, such as Fig. 9As shown, a 48-point secondary transform 950 (shown with lighter shading) may be applied to three 4×4 sub-blocks of residual coefficients in the upper left 8×8 region of the transform block. In each case in the region shown with light shading and dashed outline, the 48-point secondary transform 950 is applied to an 8×8 transform block 922, a 16×8 transform block 924, a 32×8 transform block 926, an 8×16 transform block 932, a 16×16 transform block 934, a 32×16 transform block 936, an 8×32 transform block 942, a 16×32 transform block 944, and a 32×32 transform block 946. The 48-point secondary transform 950 is also applicable to TBs (not shown) of sizes 8×64, 16×64, 32×64, 64×64, 64×32, 64×16, and 64×8. Application of the 48-point secondary transform kernel typically results in the generation of fewer than 48 secondary transform coefficients. For example, as shown in reference Figures 8B to 8D As described, 8 or 16 secondary transform coefficients may be generated. The main transform coefficients that have not been subjected to the secondary transform ("main coefficients only") (e.g., coefficient 966 of TB 934) need to be zero values in order to apply the secondary transform. After applying the 48-point secondary transform 950 in the forward direction, the region that may contain significant coefficients is reduced from 48 coefficients to 16 coefficients, thereby further reducing the number of coefficient positions that may contain significant coefficients. For the inverse secondary transform, the decoded significant coefficients are transformed to produce any coefficients that may be significant in the region, and then a main inverse transform is performed on these coefficients. When the secondary transform reduces one or more sub-blocks to a set of 16 secondary transform coefficients, only the upper left 4×4 sub-block may contain significant coefficients. The last significant coefficient position located at any coefficient position that can store a secondary transform coefficient indicates that a secondary transform or only a main transform is applied.
[0146] When the last significant coefficient position indicates a secondary transform coefficient position in the TB, the signaled secondary transform index (i.e., 388 or 474) is needed to distinguish between applying the secondary transform kernel or bypassing the secondary transform. Although the application of the secondary transform to the TB has been described from the perspective of the video encoder 114, Fig. 9 474. The inverse process is performed in the video decoder 134. The video decoder 134 first decodes the last significant coefficient position. If the decoded last significant coefficient position indicates a potential application of a secondary transform, the secondary transform index 474 is decoded to determine whether to apply or bypass the inverse secondary transform.
[0147] Fig.10A syntactic structure 1000 of a bitstream 1001 with multiple slices is shown. Each slice in the slice contains multiple coding units. The bitstream 1001 can be generated by the video encoder 114 as, for example, a bitstream 115, or can be parsed by the video decoder 134 as, for example, a bitstream 133. The bitstream 1001 is divided into multiple parts, such as network abstraction layer (NAL) units, where the depiction is achieved by setting a NAL unit header (such as 1008) before each NAL unit. The sequence parameter set (SPS) 1010 defines sequence-level parameters such as the profile (tool set) for encoding and decoding the bitstream, the chroma format, the sample bit depth, and the frame resolution. Also included in the set 1010 are parameters that constrain the application of different types of splits in the coding tree of each CTU.
[0148] A picture parameter set (PPS) 1012 defines a set of parameters applicable to zero or more frames. A picture header (PH) 1015 defines parameters applicable to the current frame. The parameters of the PH 1015 may include a list of CU chroma QP offsets, one of which may be applied at the CU level to derive the quantization parameter used by the chroma blocks from the quantization parameter of the collocated luma CB.
[0149] A picture header 1015 and a sequence of slices forming one picture are called an access unit (AU), such as AU 0 1014. AU 0 1014 includes three slices, such as slices 0 to 2. Slice 1 is labeled 1016. Slice 1 (1016) includes a slice header 1018 and slice data 1020 like other slices.
[0150] Fig.11A syntax structure 1100 of slice data (such as slice data 1104 corresponding to 1020) of a bitstream 1001 (e.g., 115 or 133) is shown, which has a common coding tree for luma and chroma coding units of a coding tree unit (such as CTU 1110). CTU 1110 includes one or more CUs. An example is labeled CU 1114. CU 1114 includes a signaled prediction mode 1116, followed by a transform tree 1118. When the size of CU 1114 does not exceed the maximum transform size (32×32 or 64×64 in the luma channel), the transform tree 1118 includes one transform unit, shown as TU 1124. When a 4:2:0 chroma format is used, the corresponding maximum chroma transform size is half the luma maximum transform size in each direction. That is, a maximum luma transform size of 32x32 or 64x64 results in a maximum chroma transform size of 16x16 or 32x32, respectively. When using a 4:4:4 chroma format, the chroma maximum transform size is the same as the luma maximum transform size. When using a 4:2:2 chroma format, the chroma maximum transform size is half the luma transform size horizontally and the same as the luma transform size vertically, i.e., the maximum chroma transform sizes are 16x32 and 32x64 for maximum luma transform sizes of 32x32 and 64x64, respectively.
[0151] If the prediction mode 1116 indicates that intra prediction is used for CU 1114, the luma intra prediction mode and the chroma intra prediction mode are specified. For the luma CB of CU 1114, the primary transform type is also signaled horizontally and vertically as (i) DCT-2, (ii) transform skip, or (iii) a combination of DST-7 and DCT-8 according to MTS index 1122. If the signaled luma transform type is DCT-2 horizontally and vertically (option (i)), then the luma transform type is signaled horizontally and vertically as shown in the reference 1122. Figures 8A to 8D and Figures 13 to 16 Under the described conditions, an additional luma secondary transform index 1120 (also called "low frequency non-separable transform" (LFNST) index) is signaled in the bitstream.
[0152] The use of a common coding tree results in a TU 1124 including TBs for each color channel, shown as luma TB Y 1128, a first chroma TB Cb 1132, and a second chroma TB Cr 1136. The presence of each TB depends on a corresponding "coded block flag" (CBF), i.e., one of the coded block flags 1123. When a TB is present, the corresponding CBF is equal to 1 and at least one residual coefficient in the TB is non-zero. When a TB is not present, the corresponding CBF is equal to zero and all residual coefficients in the TB are zero. The luma TB 1128, the first chroma TB 1134, and the second chroma TB 1136 can each use a transform skip as signaled by the transform skip flags 1126, 1130, and 1134, respectively. A coding mode that sends a single chroma TB to specify the chroma residuals for both the Cb and Cr channels is available, referred to as a "joint CbCr" coding mode. When the joint CbCr coding mode is enabled, a single chroma TB is encoded.
[0153] Regardless of the color channel, each encoded TB includes a last position followed by one or more residual coefficients. For example, the luma TB 1128 includes a last position 1140 and a residual coefficient 1144. The last position 1140 indicates the last valid residual coefficient position in the TB when considering the diagonal scan mode (which is used to serialize the coefficient array of the TB in the forward direction (i.e., from the DC coefficient forward)). The two TBs 1132 and 1136 for the chroma channels each have a corresponding last position syntax element used in the same manner as described for the luma TB 1128. If the last position of each TB for a CU (i.e., 1128, 1132, and 1136) indicates that for each TB in the CU, only coefficients in the secondary transform domain (such that all remaining coefficients that are only subjected to the main transform are zero) are valid, then a secondary transform index 1120 can be signaled to specify whether a secondary transform is applied. Reference Fig.14 and Fig.16 Further adjustments to signaling the secondary transform index 1120 are described.
[0154] If a secondary transform is to be applied, the secondary transform index 1120 indicates which core is selected. Typically, two cores are available in the "candidate set" of cores. Typically, there are four candidate sets, where the intra prediction mode of the block is used to select a candidate set. Luma intra prediction mode is used to select a candidate set for luma blocks, and chroma intra prediction mode is used to select a candidate set for two chroma blocks. As shown in reference Figures 8A to 8DAs described, the selected kernel also depends on the TB size, with different kernels for 4×4, 4×N / N×4 and other sized TBs. When using a 4:2:0 chroma format, the chroma TB is typically half the width and height of the corresponding luma TB, resulting in different selected kernels for chroma blocks when using a luma TB of width or height 8. For luma blocks of size 4×4, 4×8, 8×4, the one-to-one correspondence of luma and chroma blocks in the common coding tree is changed to avoid the presence of small sized chroma blocks such as 2×2, 2×4 or 4×2.
[0155] The secondary transform index 1120 indicates, for example, the following: index value 0 (not applied), 1 (apply the first kernel of the candidate set), or 2 (apply the second kernel of the candidate set). For chroma, the selected secondary transform kernel of the candidate set derived in consideration of the chroma TB size and the chroma intra prediction mode is applied to each chroma channel, so the residuals of the Cb block 1224 and the Cr block 1226 only need to include the valid coefficients in the positions subjected to the secondary transform, as shown in the reference Figures 8A-8D If joint CbCr coding is used, the requirement to include only significant coefficients in positions that are subject to the secondary transform applies only to the single coded chrominance TB, since the resulting Cb and Cr residuals contain significant coefficients only in positions that correspond to significant coefficients in the jointly coded TB.
[0156] Fig.12 A syntactic structure 1200 of slice data 1204 (e.g., 1020) for a bitstream (e.g., 115, 133) is shown, which has separate coding trees for luma and chroma coding units of the coding tree units. Separate coding trees may be used for "I slices". Slice data 1204 includes one or more CTUs, such as CTU 1210, etc. CTU 1210 is typically sized 128×128 luma samples and starts with a common tree that includes one quadtree split common to both luma and chroma. At each of the resulting 64×64 nodes, separate coding trees begin for luma and chroma. At Fig.12An example node 1214 is marked in . Node 1214 has a luma node 1214a and a chroma node 1214b. The luma tree starts from luma node 1214a, and the chroma tree starts from chroma node 1214b. The trees continuing from node 1214a and node 1214b are independent between luma and chroma, so different split options can produce the resulting CU. Luma CU 1220 belongs to the luma coding tree and includes a luma prediction mode 1221, a luma transform tree 1222, and a secondary transform index 1224. The luma transform tree 1222 includes a TU 1230. Since the luma coding tree only encodes samples of the luma channel, TU 1230 contains a luma TB 1234, and a luma transform skip flag 1232 indicates that the luma residual will be transformed or not. The luma TB 1234 includes a last position 1236 and a residual coefficient 1238.
[0157] The chroma CU 1250 belongs to the chroma coding tree and includes a chroma prediction mode 1251, a chroma transform tree 1252, and a secondary transform index 1254. The chroma transform tree 1252 includes a TU 1260. Since the chroma tree includes chroma blocks, the TU 1260 includes a Cb TB 1264 and a Cr TB 1268. Application of a bypass of transforms for the Cb TB 1264 and the Cr CB 1268 is signaled using a Cb transform skip flag 1262 and a Cr transform skip flag 1266, respectively. Each TB includes a last position and a residual coefficient, for example, a last position 1270 and a residual coefficient 1272 are associated with the Cb TB 1264. Reference Fig.14 and 16 Signaling a secondary transform index 1254 for a chroma TB applicable to a chroma tree is described.
[0158] Fig.17 A 32×32 TB 1700 is shown. A conventional scan pattern 1710 is shown applied to TB 1700. Scan pattern 1710 progresses in a backward diagonal manner through TB 1700, starting at the last significant coefficient position and progressing toward the DC (upper left) coefficient position. This progression divides TB 1700 into 4×4 sub-blocks. As shown in several sub-blocks of TB 1700 (e.g., sub-block 1750), each sub-block is scanned in a backward diagonal manner internally. Other sub-blocks are scanned in the same manner. However, for ease of reference, the sub-blocks are scanned in a backward diagonal manner. Fig.17 A limited number of sub-blocks are shown in a full scan in . The progression from one 4×4 sub-block to the next also follows a backward diagonal scan across the entire TB 1700 .
[0159] If MTS is to be used, only the coefficients in the upper left 16×16 portion 1740 of TB 1700 may be significant. The upper left 16×16 portion forms a threshold Cartesian position ((15, 15) in this example) at or within which MTS may be applied, and MTS may not be applied if the last significant coefficient is outside the threshold Cartesian position, either in terms of X or Y coordinates. That is, if the X or Y coordinate of the last significant coefficient position exceeds 15, MTS may not be applied and DCT-2 is applied (or the transform is skipped). The last significant coefficient position is represented as a Cartesian coordinate relative to the DC coefficient position in TB 1700. For example, the last significant coefficient position 1730 is 15, 15. The scan pattern 1710 starting at position 1730 and proceeding toward the DC coefficient results in scan sub-blocks 1720 and 1721 (identified by shading), which are zeroed in the video encoder 114 when MTS is applied and not used by the video decoder 134. The video decoder 134 needs to decode the residual coefficients in the sub-blocks 1720 and 1721 because 1720 and 1721 are included in the scan, however, when MTS is applied, the decoded residual coefficients of the sub-blocks 1720 and 1721 are not used. At least, for MTS to be applied, it may be necessary for the residual coefficients in the sub-block 1720 to be zero-valued, thereby reducing the associated coding cost when MTS is applied and preventing the bitstream from encoding the significant residual coefficients in the sub-block. That is, the parsing of the "mts_idx" syntax element can be adjusted not only at the last significant position within the portion 1740, but also at the sub-blocks 1720 and 1721 that contain only zero-valued residual coefficients.
[0160] Fig.18 Scan pattern 1810 is shown for a 32x32 TB 1800 using the described arrangement. Scan pattern 1810 groups 4x4 sub-blocks into several "sets", such as set 1840.
[0161] In the context of the present disclosure, with respect to a scan mode, a set provides a non-overlapping set of sub-blocks that (i) form a region or area of a size suitable for an MTS or (ii) form a region or area surrounding a region suitable for an MTS. The scan mode traverses a transform block by advancing multiple non-overlapping sets of sub-blocks of residual coefficients, advancing from a current set to a next set after completing the scan of the current set.
[0162] exist Fig.18In the example of , each set is a two-dimensional array of 4×4 sub-blocks with a width and height of at most four sub-blocks (option (i) of the set). Set 1840 corresponds to the area of potentially significant coefficients when MTS is in use, i.e., a 16×16 area of TB1800. The scan pattern 1810 advances from one set to the next without re-entry, i.e., once all residual coefficients in one set have been scanned, the scan pattern 1810 advances to the next set. The scan 1810 effectively completes the scan pattern for the current set before advancing to scan the next set. The sets are non-overlapping, and each residual coefficient position is scanned once, starting with the last position and proceeding towards the DC (top left) coefficient position.
[0163] Scan mode 1810 also partitions TU 1800 into 4×4 sub-blocks, as does scan mode 1710. Due to the monotonic progression from one set to the next, once the scan reaches the upper left set 1840, no further scanning of residual coefficients outside set 1840 occurs. In particular, if the last position is within set 1840, such as at last position 1830 at the 15,15 position, all residual coefficients outside set 1840 are not valid. When MTS is in use, the zeroing of residual coefficients outside 1840 aligns with the zeroing performed in the video encoder 114. Therefore, the video decoder 134 only needs to check that the last position is within set 1840 to enable parsing of the mts_idx syntax element (1122 when the CU belongs to a single coding tree and 1226 when the CU belongs to the luma branch of a separate coding tree). The use of scan mode 1810 eliminates the need to ensure that any residual coefficients outside set 1840 are zero-valued. Whether coefficients outside the set 1840 are already apparent by means of a scan pattern 1810 having a set size aligned with the MTS transform coefficient region. Scan pattern 1810 can also achieve reduced memory consumption compared to scan pattern 1710 by partitioning TB 1800 into a set of sets, each of which is the same size. Memory reduction can be achieved because a scan on TB 1800 can consist of a scan on one set. For TBs of size 16×32 and 32×16, the same method of a set of size 16×16 can be used, where two sets are used. For a TB of size 32×8, partitioning into sets is possible, where the set size is constrained to 16×8 due to the TB size. Partitioning into sets of 32×8 TBs results in the same scan pattern as a regular diagonal progression on an 8×2 array of 4×4 sub-blocks comprising the 32×8 TB. Therefore, the properties of the significant coefficients in the 8×16 region of coefficients subjected to MTS transformation for the 32×8 TB are satisfied by checking that the last position is within the left half of the 32×8 TB.
[0164] Fig.19TB 1900 of size 8×32 is shown. For TB 1900, partitioning into sets is possible. Fig.19 In the example of , due to the TB size (such as set 1940, etc.), the set size is constrained to 8×16. Compared with the conventional diagonal progression on a 2×8 array of 4×4 sub-blocks including 8×32TB (e.g., Fig.18 The partitioning into 8×32 TB 1900 sets results in a different sub-block order compared to the 8×16 set size shown in FIG. 1900. Using an 8×16 set size ensures that significant coefficients are only possible in the MTS transform coefficient region if the last significant coefficient position is within the set 1940 (e.g., at the last significant position 1930 at 7,15).
[0165] Fig.18 and Fig.19 The scanning mode scans the residual coefficients in each sub-block in a backward diagonal manner. Fig.18 and Fig.19 In the example of , the sub-blocks in each set are scanned in a backward diagonal manner. Fig.18 and Fig.19 In , the scan between sets is performed in a backward diagonal manner.
[0166] Fig. 20An alternative scanning order 2010 for a 32×32 TB 2000 is shown. The scanning order (scanning pattern) 2010 is divided into portions 2010a to 2010f. The scanning orders 2010 to 2010e relate to the option of (ii) a set of sub-blocks forming a region or area surrounding a region suitable for MTS. The scanning pattern 2010f relates to (i) a set covering a region 2040 forming a region suitable for MTS. The scanning order 2010a to 2010f is defined so that a backward diagonal progression from one sub-block to the next occurs on the TB 2000, except for region 2040, which is then scanned using a backward diagonal scan progression. Region 2040 corresponds to an MTS transform coefficient region. TB 2000 is divided into a scan on sub-blocks outside the MTS transform coefficient region, followed by a scan on sub-blocks within the MTS transform coefficient region, which results in a progression on sub-blocks as shown by 2010a, 2010b, 2010c, 2010d, 2010e, and 2010f. Scan pattern 2010 identifies two sets, namely the set defined by 2010a to 2010e and the set defined by the region 2040 scanned by 2010f. The scanning is performed in a manner that allows all sub-blocks bordering set 2040 to be scanned before the lower right corner (2030) of set 2040. Scan pattern 2010 scans the set of sub-blocks formed using scans 2010a to 2010e. Upon completion of the set covered by 2010a to 2010e, scan pattern 2010 continues to the next set 2040 scanned according to 2010f. The property of checking that the last significant coefficient position (such as 2030 ) is within region 2040 enables the presence of signaled mts_idx without also checking that any residual coefficients outside region 2040 are zero-valued.
[0167] exist Fig. 20 The scanning of the residual coefficients is performed in a variant of the backward diagonal scanning in . Fig. 20 The medium scan mode scans the collection in a raster manner. Fig.18 and Fig.19 In a variation of the pattern, the collection may be scanned in a backward raster order.
[0168] and Fig.17 Compared with the scanning mode 1710, Figures 18 to 20The scan patterns shown in (i.e., 1810, 1910, and 2010a-2010f) substantially preserve the property of progressing from the highest frequency coefficient of the TB toward the lowest frequency coefficient of the TB. Therefore, the arrangement of the video encoder 114 and the video decoder 134 using scan patterns 1810, 1910, and 2010a-2010f achieves compression efficiency similar to that achieved when using scan pattern 1710, while enabling MTS index signaling to depend on the last significant coefficient position without further checking for zero-valued residual coefficients outside the MTS transform coefficient region.
[0169] Fig.13 A method 1300 is shown for encoding frame data 113 in a bitstream 115, the bitstream 115 including one or more slices as a sequence of coding tree units. The method 1300 may be embodied by a device such as a configured FPGA, ASIC, or ASS. In addition, the method 1300 may be performed by the video encoder 114 under execution of the processor 205. Thus, the method 1300 may be implemented as a module of the software 233 stored on a computer-readable storage medium and / or in the memory 206.
[0170] The method 1300 begins at an encode SPS / PPS step 1310. At step 1310, the video encoder 114 encodes the SPS 1010 and PPS 1012 in the bitstream 115 as a sequence of fixed and variable length coding parameters. Parameters of the frame data 113, such as resolution and sample bit depth, are encoded. Parameters of the bitstream are also encoded, such as flags indicating the use of specific coding tools, etc. The picture parameter set includes parameters that specify the frequency of the "delta QP" syntax element present in the bitstream 113, the offset of the chroma QP relative to the luma QP, etc.
[0171] From step 1310, the method 1300 proceeds to step 1320 of encoding a picture header. In performing step 1320, the processor 205 encodes a picture header (e.g., 1015) in the bitstream 113, wherein the picture header 1015 applies to all slices in the current frame. The picture header 1015 may include partition constraints that signal the maximum allowed depths for binary, ternary, and quadtree splits, overriding similar constraints included as part of the SPS 1010.
[0172] From step 1320 , the method 1300 proceeds to step 1330 of encoding a slice header. At step 1330 , the entropy encoder 338 encodes the slice header 1118 in the bitstream 115 .
[0173] From step 1330, the method 1300 continues to step 1340 of partitioning the slice into CTUs. In performing step 1340, the video encoder 114 partitions the slice 1016 into a sequence of CTUs. The slice boundaries are aligned with the CTU boundaries, and the CTUs in the slice are ordered according to a CTU scan order (usually a raster scan order). The partitioning of the slice into CTUs determines the order in which portions of the frame data 113 will be processed by the video encoder 113 when encoding each current slice.
[0174] From step 1340, the method 1300 continues to a determine coding tree step 1350. At step 1350, the video encoder 114 determines a coding tree for the currently selected CTU in the slice. The method 1300 starts with the first CTU in the slice 1016 on the first invocation of step 1350 and proceeds to subsequent CTUs in the slice 1016 on subsequent invocations. Various combinations of quadtree, binary, and ternary splits are generated and tested by the block partitioner 310 when determining the coding tree for the CTU.
[0175] From step 1350, the method 1300 continues to step 1360 of determining the coding unit. At step 1360, the video encoder 114 performs to determine the encoding of the CU obtained from the various coding trees under evaluation using known methods. Determining the encoding involves determining a prediction mode (e.g., intra prediction with a specific mode or inter prediction with motion vectors 387) and a main transform selection 389. If the main transform type 389 is determined to be DCT-2 and all quantized main transform coefficients that are not subjected to a forward secondary transform are valid, then the secondary transform index 388 is determined and can indicate the application of the secondary transform (e.g., encoded as 1120, 1224, or 1254). Otherwise, the secondary transform index 388 indicates bypassing the secondary transform. In addition, a transform skip flag 390 is determined for each TB in the CU, indicating the application of the main (and optionally secondary) transform or bypassing the transform completely (e.g., 1126 / 1130 / 1134 or 1232 / 1262 / 1266). For the luma channel, the main transform type is determined to be one of DCT-2, transform skip, or MTS options, and for the chroma channel, DCT-2 or transform skip are available transform types. Determining the encoding may also include determining a quantization parameter that may change the QP, i.e., an "incremental QP" syntax element will be encoded in the bitstream 115. When determining the individual coding units, the optimal coding tree is also determined in a joint manner. When intra-frame prediction is used to encode coding units in a common coding tree, the luma intra-frame prediction mode and the chroma intra-frame prediction are determined at step 1360. When intra-frame prediction is used to encode coding units in separate coding trees, the luma intra-frame prediction mode or the chroma intra-frame prediction mode is determined at step 1360, respectively, depending on whether the branch of the coding tree is luma or chroma.
[0176] The step 1360 of determining the coding unit may prohibit testing the application of the secondary transform when there are no "AC" residual coefficients in the main domain residual resulting from applying the DCT-2 main transform by the forward main transform module 326. The AC residual coefficients are residual coefficients in positions other than the upper left position of the transform block. The prohibition of testing the secondary transform when only the DC main coefficient is present spans the blocks to which the secondary transform index 388 applies, i.e., the Y, Cb, and Cr of the common tree (only the Y channel when the Cb and Cr blocks are two samples wide or high). Regardless of whether the coding unit is for a common coding tree or a separate tree coding tree, the video encoder 114 also tests the selection of a non-zero secondary transform index value 388 (i.e., the application of the secondary transform) assuming that there is at least one valid AC main coefficient.
[0177] From step 1360, method 1300 proceeds to step 1370 of encoding the coding unit. At step 1370, video encoder 114 encodes the determined coding unit of step 1360 in bitstream 115. Fig.14 An example of how to encode a coding unit is described in more detail.
[0178] From step 1370, method 1300 continues to step 1380 of the last coding unit test. At step 1380, processor 205 tests whether the current coding unit is the last coding unit in the CTU. If not ("No" at step 1380), control in processor 205 returns to step 1360 of determining the coding unit. Otherwise, if the current coding unit is the last coding unit ("Yes" at step 1380), control in processor 205 proceeds to step 1390 of the last CTU test.
[0179] At step 1390 of the last CTU test, the processor 205 tests whether the current CTU is the last CTU in the slice 1016. If the current CTU is not the last CTU in the slice 1016 ("No" at step 1390), control in the processor 205 returns to step 1350 of determining the coding tree. Otherwise, if the current CTU is the last ("Yes" at step 1390), control in the processor 205 proceeds to step 13100 of the last slice test.
[0180] At the last slice test step 13100, the processor 205 tests whether the current slice being encoded is the last slice in the frame. If the current CTU is not the last slice ("No" at step 13100), control in the processor 205 returns to the step 1330 of encoding the slice header. Otherwise, if the current slice is the last slice and all slices have been encoded ("Yes" at step 13100), the method 1300 terminates.
[0181] Fig.14 Shown with Fig.13 The method 1400 of encoding the coding unit in the bitstream 115 corresponding to step 1370 is described. The method 1400 may be embodied by a device such as a configured FPGA, ASIC, or ASSP. In addition, the method 1400 may be performed by the video encoder 114 under the execution of the processor 205. Therefore, the method 1400 may be stored as a module of the software 233 on a computer-readable storage medium and / or in the memory 206.
[0182] The method 1400 improves compression efficiency by encoding the secondary transform index 1254 only when it can be applied to the chroma TB of the TU 1260, and encoding the secondary transform index 1120 only when it can be applied to any TB of the TU 1124. When a common coding tree is used, for each CU in the coding tree (e.g., Fig.11 Method 1400 is called for each CU (e.g., 1220) in luma branch 1214a, where Y, Cb, and Cr color channels are encoded. When separate coding trees are used, method 1400 is first called for each CU (e.g., 1220) in luma branch 1214a, and method 1400 is also called for each chroma CU (e.g., 1250) in chroma branch 1214b.
[0183] The method 1400 begins at step 1410 of generating a prediction block. At step 1410, the video encoder 114 generates a prediction block 320 according to the prediction mode (e.g., intra prediction mode 387) of the CU determined at step 1360. The entropy encoder 338 encodes the intra prediction mode 387 of the coding unit determined at step 1360 in the bitstream 115. The "pred_mode" syntax element is encoded to distinguish the use of intra prediction, inter prediction, or other prediction modes for the coding unit. If intra prediction is used for the coding unit, if the luma PB is applicable to the CU, the luma intra prediction mode is encoded, and if the chroma PB is applicable to the CU, the chroma intra prediction mode is encoded. That is, for an intra-predicted CU belonging to a common tree (such as CU 1114, etc.), the prediction mode 1116 includes a luma intra prediction mode and a chroma intra prediction mode. For an intra-predicted CU belonging to a luma branch of a separate coding tree, such as CU 1220, prediction mode 1221 includes a luma intra prediction mode. For an intra-predicted CU belonging to a chroma branch of a separate coding tree, such as CU 1250, prediction mode 1251 includes a chroma intra prediction mode. The main transform type 389 is encoded to select between using DCT-2 horizontally and vertically, using transform skip horizontally and vertically, or using a combination of DCT-8 and DST-7 horizontally and vertically for the luma TB of the coding unit.
[0184] From step 1410 , method 1400 proceeds to step 1420 of determining a residual. Prediction block 320 is subtracted from a corresponding block of frame data 312 by difference module 322 to produce difference 324 .
[0185] From step 1420, method 1400 continues to step 1430 of transforming the residual. At step 1430 of transforming the residual, video encoder 114, under execution of processor 205, bypasses the primary transform and secondary transform of the residual of step 1420 for each TB of the CU, or transforms according to the primary transform type 389 and the secondary transform index 388. The transform of difference 324 may be performed or bypassed according to the transform skip flag 390, and if transformed, the secondary transform may also be applied as determined at step 1350 to produce the reference image. Figure 3 Residual samples 350 are depicted. After the operation of quantization module 334, residual coefficients 336 are available.
[0186] From step 1430, the method 1400 continues to step 1440 of encoding a luma transform skip flag. At step 1440, the entropy encoder 338 encodes the context-coded transform skip flag 390 in the bitstream 115, indicating that the residual of the luma TB will be transformed according to the primary transform and possibly the secondary transform, or that the primary transform and the secondary transform will be bypassed. Step 1440 is performed when the CU includes a luma TB (i.e., in a common coding tree (encoded 1126)) or a luma branch of a dual tree (encoded 1232).
[0187] From step 1440, method 1400 proceeds to step 1450 of encoding the luma residual. At step 1450, entropy encoder 338 encodes the residual coefficients 336 of the luma TB in bitstream 115. Step 1450 is used to select an appropriate scan mode based on the size of the coding unit. Fig.17 (Normal Scan Mode) and Figures 18 to 20 (Additional Scan Mode for Determining MTS Flags) describes an example of a scan mode. In the example described herein, the following example is used: Figures 18 to 20 The residual coefficients 336 are typically scanned into the list in 4×4 subblocks according to a backward diagonal scan pattern. For TBs with a width or height greater than 16 samples, the scan pattern is as in reference Fig.18 , 19 and 20. The position of the first non-zero residual coefficient in the list is encoded in the bitstream 115 as a Cartesian coordinate relative to the upper left coefficient of the transform block, i.e., 1140. The remaining residual coefficients are encoded as residual coefficients 1144 in order from the coefficient at the last position to the DC (upper left) residual coefficient. Step 1450 is performed when the CU includes a luma TB, i.e., in a common coding tree (encoded 1128), or when the CU belongs to the luma branch of a dual tree (encoded 1234).
[0188] From step 1450, method 1400 continues to step 1460 of encoding a chroma transform skip flag. At step 1460, entropy encoder 338 encodes two additional context-coded transform skip flags 390 (one for each chroma TB) in bitstream 115, indicating whether the corresponding TB will be subjected to a DCT-2 transform, and optionally a secondary transform, or whether the transform will be bypassed. Step 1460 is performed when the CU includes a chroma TB (i.e., in a common coding tree (encodings 1130 and 1134)), or when the CU belongs to the chroma branch of a dual tree (encodings 1262 and 1266).
[0189] From step 1460, method 1400 continues to step 1470 of encoding the chroma residual. At step 1470, entropy encoder 338 encodes the residual coefficients of the chroma TBs as described with reference to step 1450 in the bitstream 115. Step 1460 is performed when the CU includes a chroma TB (i.e., in a common coding tree (codings 1132 and 1136)) or a chroma branch of a dual tree (codings 1264 and 1268). For chroma TBs with a width or height greater than 16 samples, the scanning mode is as described with reference to Fig.18 , 19 and 20. For the luminance TB and the chrominance TB, use Figures 18 to 20 The scan pattern avoids the need to define different scan patterns between luma and chroma for TBs of the same size.
[0190] From step 1470, method 1400 continues to step 1480, which signals a LFNST test. At step 1480, processor 205 determines whether a secondary transform is applicable to any TB of the CU. If all TBs of the CU use transform skipping, the secondary transform index 388 does not need to be encoded (step 1480 is "No"), and method 1400 proceeds to step 14100, which signals an MTS test. For a common coding tree, for example, the luma TB and the two chroma TBs are each transform skipped to return "No" for step 1480. For separate coding trees, the luma TB in the luma branch of the coding tree is transform skipped, or both chroma TBs in the chroma branch of the coding tree are transform skipped to return "No" for calls to step 1480 related to luma and chroma, respectively. For a secondary transform to be performed, the applicable TBs need to include valid residual coefficients only in the positions of the TBs that are subject to the secondary transform. That is, all other residual coefficients must be zero, which is when the last position of the TB is in the position for Figures 8A to 8DThe condition is achieved when the last position of any TB in the CU is within 806, 824, 842, or 862 of the TB size being considered. If the last position of any TB in the CU is outside 806, 824, 842, or 862 of the TB size being considered, no secondary transformation is performed (step 1480 is "No"), and the method 1400 proceeds to step 14100 of signaling the MTS test.
[0191] For chroma TBs, a width or height of 2 may occur. TBs with a width or height of 2 are not subject to secondary transform because no kernel is defined for TBs of this size (step 1480 is "no"), and the method 1400 proceeds to step 14100 of signaling an MTS test. An additional condition for performing secondary transform is that there is at least one AC residual coefficient in the applicable TB. That is, if the only valid residual coefficient is in the DC (upper left) position of each applicable TB, secondary transform is not performed (step 1480 is "no"), and the method 1400 proceeds to step 14100 of signaling an MTS test. If at least one TB of a CU is subject to main transform (the transform skip flag indicates non-skipping for at least one TB of the CU), the last position constraint on the TBs subject to main transform is satisfied, and at least one AC coefficient is included in one or more of the TBs subject to main transform (step 1480 is "yes"), and control in the processor 205 proceeds to step 1490 of encoding LFNST indexes. At step 1490 of encoding the LFNST index, the entropy encoder 338 encodes a truncated unary codeword indicating three possible choices for applying the secondary transform. The choices are zero (not applied), one (apply the first kernel of the candidate set), and two (apply the second kernel of the candidate set). The codeword uses at most two bins, each of which is context-coded. By means of the test performed at step 1480, step 1490 is performed only when the secondary transform can be applied, that is, for a non-zero index to be encoded. For example, step 1490 encodes 1120 or 1224 or 1225.
[0192] In fact, the operation of steps 1480 and 1490 allows the secondary transform index 1254 of the chroma in the separate tree structure to be encoded only when the secondary transform can be applied to the chroma TB of TU 1260. In the shared tree structure, steps 1480 and 1490 operate to encode the secondary transform index 1120 only when the secondary transform can be applied to any TB of TU 1124. When the relevant secondary transform indexes (such as 1254 and 1120) are excluded, the method 1400 operates to improve the coding efficiency. In particular, in the case of a shared or dual tree, unnecessary flags are avoided, thereby reducing the required number of bits and improving the coding efficiency. In the case of a separate tree, if the corresponding luminance transform block is skipped by the transform, it is not necessary to suppress the secondary transform for the chroma.
[0193] From step 1490, method 1400 proceeds to step 14100 of signaling the MTS test.
[0194] At step 14100 of signaling MTS, video encoder 114 determines whether the MTS index needs to be encoded in bitstream 115. If DCT-2 transform is selected at step 1360, the last significant coefficient position can be any position in the upper left 32x32 region of the TB. If the last significant coefficient position is outside the upper left 16x16 region of the TB and DCT-2 transform is selected at step 1360, the last significant coefficient position can be any position in the upper left 32x32 region of the TB. Fig.18 and 19 Scanning (rather than Fig.17 ), then mts_idx need not be explicitly signaled in the bitstream. In this case, mts_idx does not need to be signaled in the bitstream because the use of MTS does not produce a last significant coefficient outside the top-left 16×16 region. Step 14100 returns “no” and method 1400 terminates, with the use of DCT-2 implied by the last significant coefficient position.
[0195] The non-DCT-2 selection for the primary transform type is only available when the TB width and height are less than or equal to 32. Therefore, for TBs with a width or height exceeding 32, step 14100 returns "No" and the method 1400 terminates at step 14100. The non-DCT-2 selection is also only available if no secondary transform is applied, so if it is determined at step 1360 that the secondary transform type 388 is non-zero, then step 14100 returns "No" and the method 1400 terminates at step 14100.
[0196] When using Fig.18 and 19 When scanning the TB, the presence of the last significant coefficient position within the upper left 16×16 region of the TB may result from the application of the DCT-2 main transform or the MTS combination of DST-7 and / or DCT-8, thereby requiring explicit signaling of mts_idx to encode the selection made at step 1360. Therefore, when the last significant coefficient position is within the upper left 16×16 region of the TB, step 14100 returns "yes" and method 1400 proceeds to step 14110 of encoding the MTS index.
[0197] At step 14110 of encoding the MTS index, the entropy encoder 338 encodes the truncated unary bin string representing the primary transform type 389. For example, step 14110 may encode 1122 or 1226. The method 1400 terminates when step 14110 is executed.
[0198] Fig.15A method 1500 is shown for decoding a bitstream 133 to generate frame data 135, the bitstream 133 including one or more slices as a sequence of coding tree units. The method 1500 may be embodied by a device such as a configured FPGA, ASIC, or ASSP. In addition, the method 1500 may be performed by the video decoder 134 under execution of the processor 205. Therefore, the method 1500 may be stored as one or more modules of the software 233 on a computer-readable storage medium and / or in the memory 206.
[0199] The method 1500 begins at a decode SPS / PPS step 1510. At step 1510, the video decoder 134 decodes the SPS 1010 and PPS 1012 from the bitstream 133 into a sequence of fixed and variable length coding parameters. Parameters of the frame data 113, such as resolution and sample bit depth, are decoded. Parameters of the bitstream, such as flags indicating the use of specific coding tools, etc., are also decoded. The default partition constraints signal the maximum allowed depths for binary, ternary, and quadtree splits, and are also decoded by the video decoder 134 as part of the SPS 1010.
[0200] From step 1510, the method 1500 continues to a decode picture header step 1520. In performing step 1520, the processor 205 decodes the picture header 1015 from the bitstream 113, which applies to all slices in the current frame. The picture parameter set includes parameters that specify the frequency at which the "delta QP" syntax element is present in the bitstream 133, the offset of the chroma QP relative to the luma QP, etc. The optional override partition constraint signals the maximum allowed depth for binary, ternary, and quadtree splits, and can also be decoded by the video decoder 134 as part of the picture header 1015.
[0201] From step 1520 , the method 1500 continues to a decode slice header step 1530 . At step 1530 , the entropy decoder 420 decodes the slice header 1018 from the bitstream 133 .
[0202] From step 1530, the method 1500 continues to step 1540 of partitioning the slice into CTUs. In performing step 1540, the video encoder 114 partitions the slice 1016 into a sequence of CTUs. The slice boundaries are aligned with the CTU boundaries, and the CTUs in the slice are ordered according to a CTU scan order (usually a raster scan order). Partitioning the slice into CTUs establishes which portion of the frame data 133 will be processed by the video encoder 133 when decoding the current slice.
[0203] From step 1540, the method 1500 continues to a decode coding tree step 1550. At step 1550, the video decoder 134 decodes the coding tree for the currently selected CTU in the slice. The method 1500 starts at the first CTU in the slice 1016 on the first invocation of step 1550 and advances to subsequent CTUs in the slice 1016 on subsequent invocations. When decoding the coding tree for the CTU, a flag indicating a combination of quadtree, binary, and ternary splits as determined in the video encoder 114 at step 1350 is decoded.
[0204] From step 1550, method 1500 proceeds to step 1570 of decoding the coding unit. At step 1570, video decoder 134 decodes the determined coding unit of step 1560 from bitstream 133. Fig.16 An example of how to decode a coding unit is described in more detail.
[0205] From step 1570, method 1500 continues to a last coding unit test step 1580. At step 1580, processor 205 tests whether the current coding unit is the last coding unit in the CTU. If not ("No" at step 1580), control in processor 205 returns to decoding the coding unit step 1560. Otherwise, if the current coding unit is the last coding unit ("Yes" at step 1580), control in processor 205 proceeds to a last CTU test step 1590.
[0206] At the last CTU test step 1590, the processor 205 tests whether the current CTU is the last CTU in the slice 1016. If it is not the last CTU in the slice 1016 ("No" at step 1590), control in the processor 205 returns to the decoding coding tree step 1550. Otherwise, if the current CTU is the last ("Yes" at step 1590), control in the processor proceeds to the last slice test step 15100.
[0207] At the last slice test step 15100, the processor 205 tests whether the current slice being decoded is the last slice in the frame. If the current slice is not the last slice ("No" at step 15100), control in the processor 205 returns to the decode slice header step 1530. Otherwise, if the current slice is the last slice and all slices have been decoded ("Yes" at step 15100), the method 1500 terminates.
[0208] Fig.16 A method 1600 for decoding a coding unit from a bitstream 133 is shown, which corresponds to Fig.15Step 1570 of the embodiment of the present invention. The method 1600 may be embodied by a device such as a configured FPGA, ASIC, or ASSP. In addition, the method 1600 may be performed by the video decoder 134 under the execution of the processor 205. Therefore, the method 1600 may be stored on a computer-readable storage medium and / or as one or more modules of the software 233 in the memory 206.
[0209] When a common coding tree is used, for each CU in the coding tree (e.g., Fig.11 Method 1600 is called for each CU (e.g., 1220) in luma branch 1214a, where Y, Cb, and Cr color channels are encoded in a single call. When separate coding trees are used, method 1600 is first called for each CU (e.g., 1220) in luma branch 1214a, and method 1600 is also called separately for each chroma CU (e.g., 1250) in chroma branch 1214b.
[0210] Method 1600 begins at step 1610 of decoding a luma transform skip flag. At step 1610, entropy decoder 420 decodes a context-coded transform skip flag 478 (eg, encoded in the bitstream as Fig.11 1126 or Fig.12 1232 in). The skip flag indicates whether the transform is applied to the luma TB. The transform skip flag 478 indicates that the residual of the luma TB will be transformed according to (i) the primary transform, (ii) the primary transform and the secondary transform, or (iii) the primary transform and the secondary transform will be bypassed. When the CU includes a luma TB in a common coding tree, step 1610 (e.g., decoding 1126) is performed. When the CU belongs to the luma branch of the dual tree (decoding 1232) for a separate coding tree CTU, step 1610 is performed.
[0211] From step 1610, method 1600 proceeds to decode luma residual step 1620. At step 1620, entropy decoder 420 decodes residual coefficients 424 of luma TBs from bitstream 115. Residual coefficients 424 are assembled into TBs by applying a scan to the list of decoded residual coefficients. Step 1620 is used to select an appropriate scan mode based on the size of the coding unit. Fig.17 (Normal Scan Mode) and Figures 18 to 20 (Additional Scanning Modes That Can Be Used to Determine MTS Flags) describes examples of scanning modes. In the examples described herein, a scanning mode based on Figures 18 to 20 The scanning is usually performed using a backward diagonal scanning pattern of 4×4 sub-blocks, as shown in reference Fig.18 and 19The position of the first non-zero residual coefficient in the list is decoded from the bitstream 133 as a Cartesian coordinate relative to the top left coefficient of the transform block, i.e. 1140. The remaining residual coefficients are decoded as residual coefficients 1144 in order from the coefficient at the last position to the DC (top left) residual coefficient.
[0212] For each sub-block except the upper left sub-block of the TB and the sub-block containing the last valid residual coefficient, the "encoded sub-block flag" is decoded to indicate that there is at least one valid residual coefficient in the corresponding sub-block. If the encoded sub-block flag indicates that there is at least one valid residual coefficient in the sub-block, the "significance map" (a set of flags) indicating the significance of each residual coefficient in the sub-block is decoded. If the decoded encoded sub-block flag indicates that the sub-block includes at least one valid residual coefficient and the scan reaches the last scan position of the sub-block without encountering a valid residual coefficient, it is inferred that the residual coefficient at the last scan position in the sub-block is valid. The encoded sub-block flag and the significance map (each flag is named "sig_coeff_flag") are encoded using the context-encoded bin. For each valid residual coefficient in the sub-block, "abs_level_gtx_flag" is decoded to indicate whether the size of the corresponding residual coefficient is greater than 1. For each residual coefficient whose magnitude is greater than 1 in a sub-block, "par_level_flag" and "abs_level_gtx_flag2" are decoded to further determine the magnitude of the residual coefficient according to equation (1):
[0213] AbsLevelPass1=sig_coeff_flag+par_level_flag+abs_level_gtx_flag+2×abs_level_gtx_flag2. (1)
[0214] The abs_level_gtx_flag and abs_level_gtx_flag2 syntax elements are encoded using the context-encoded bin. For each residual coefficient where abs_level_gtx_flag2 is equal to one, the bypass-encoded syntax element "abs_remainder" is decoded using Rice-Golomb encoding. The size of the decoded residual coefficient is determined as: AbsLevel=AbsLevelPass1+2×abs_remainder. The sign bit is decoded for each valid residual coefficient to derive the residual coefficient value from the residual coefficient size. The Cartesian coordinates of each sub-block in the scan pattern can be derived from the scan pattern by adjusting (right shifting) the X and Y residual coefficient Cartesian coordinates by the log2 of the sub-block width and height, respectively. For luma TBs, the sub-block size is always 4×4, resulting in X and Y being shifted right by two bits. Figures 18 to 20The scan mode can also be applied to the chroma TB to avoid storing different scan modes for blocks of the same size but different color channels. When the CU includes a luma TB (i.e., in a common coding tree (decoding 1128)), or for a call to the luma branch of a dual tree (e.g., decoding 1234), step 1620 is performed.
[0215] From step 1620, method 1600 proceeds to decode chroma transform skip flag step 1630. At step 1630, entropy decoder 420 decodes context coding flags from bitstream 133 for each chroma TB. For example, the context coding flag may have been encoded as Fig.11 1130 and 1134 or Fig.12 1262 and 1266 in step 1630. At least one flag is decoded, one for each chroma TB. The flag decoded at step 1630 indicates whether a transform is applied to the corresponding chroma TB, in particular whether the corresponding chroma TB will be subjected to a DCT-2 transform and optionally a secondary transform, or whether all transforms for the corresponding chroma TB will be bypassed. Step 1630 is performed when the CU includes a chroma TB (i.e., the CU belongs to a common coding tree (decoding 1130 and 1134)) or a chroma branch of a dual tree (decoding 1262 and 1266).
[0216] From step 1630, method 1600 proceeds to decode chroma residual step 1640. At step 1640, entropy decoder 420 decodes residual coefficients of chroma TBs from bitstream 133. Step 1640 is performed in a manner similar to that described with reference to step 1620 and according to Fig.18 and 19 When the CU includes a chroma TB, that is, when the CU belongs to the chroma branch of a common coding tree (decoding 1132 and 1136) or a dual tree (decoding 1264 and 1268), step 1640 is performed.
[0217] From step 1640, the method 1600 continues to step 1650 of signaling the LFNST test. At step 1650, the processor 205 determines whether the secondary transform is applicable to any TB of the CU. The luma transform skip flag may have a different value from the chroma transform skip flag. If all TBs of the CU use transform skipping, the secondary transform is not applicable and the secondary transform index does not need to be encoded (step 1650 is "No"), and the method 1600 proceeds to step 1660 of determining the LFNST index. For example, for a common coding tree, at step 1650, the luma TB and the two chroma TBs are each transformed skipped to return "No". For a CU belonging to a luma branch of a separate coding tree (e.g., 1220), when the luma TB is transformed skipped, step 1650 returns "No". For a CU belonging to a chroma branch of a separate coding tree (e.g., 1250), when both chroma TBs are transformed skipped, step 1650 returns "No". For a CU (e.g., 1250) that belongs to a chroma branch of a separate coding tree and has a width or height of less than four samples, step 1650 returns "no". For the secondary transform to be performed, the applicable TBs need only include valid residual coefficients in the positions of the TBs that are subject to the secondary transform. That is, all other residual coefficients must be zero, which is the case when the last position of the TB is in the range specified for the TB. Figures 8A to 8D The condition is achieved when the TB size is within 806, 824, 842 or 862 of the TB size shown. If the last position of any TB in the CU is outside 806, 824, 842 or 862 of the TB size under consideration, the secondary transform is not performed (step 1650 is "No"), and the method 1600 proceeds to step 1660 of determining the LFNST index. For chroma TBs, a width or height of 2 may occur. TBs with a width or height of 2 are not subject to secondary transform because there is no kernel defined for TBs of this size. An additional condition for performing the secondary transform is that there is at least one AC residual coefficient in the applicable TB. That is, if the only significant residual coefficient is in the DC (upper left) position of each TB, the secondary transform is not performed (step 1650 is "No"), and the method 1600 proceeds to step 1660 of determining the LFNST index. The constraints on the last significant coefficient position and the presence of non-DC residual coefficients only apply to TBs of applicable size (i.e., with a width and height greater than two samples). Assuming at least one applicable TB is transformed, the last position constraint is satisfied, and the non-DC coefficient requirement is met ("yes" at step 1650), control in processor 205 proceeds to step 1670 where the LFNST index is decoded.
[0218] When the secondary transform is not applicable to any TB associated with the CU, a determine LFNST index step 1660 is implemented. At step 1660, the processor 205 determines that the secondary transform index has a zero value, indicating that the secondary transform is not applied. Control in the processor 205 proceeds from step 1660 to a signal MTS step 1672.
[0219] At step 1670 of decoding the LFNST index, the entropy decoder 420 decodes the truncated unary codeword into a secondary transform index 474 indicating three possible choices for applying the secondary transform. The choices are zero (not applied), one (apply the first kernel of the candidate set), and two (apply the second kernel of the candidate set). The codeword uses at most two bins, each of which is context encoded. With the help of the test performed at step 1650, step 1670 is performed only when the secondary transform can be applied (i.e., a non-zero index to be decoded). When method 1600 is called as part of a common coding tree, step 1670 decodes 1120 from the bitstream 133. When method 1600 is called as part of the luma branch of a separate coding tree, step 1670 decodes 1224 from the bitstream 133. When step 1670 is called as part of the chroma branch of a separate coding tree, step 1670 decodes 1254 from the bitstream 133. Control in processor 205 proceeds from step 1670 to signal MTS step 1672.
[0220] Steps 1650, 1660, and 1670 are used to determine the LFNST index, i.e., 474. If at least one of the luma transform skip flag and the chroma transform skip flag applicable to the CU indicates that the transform of the corresponding transform block is not skipped, the LFNST index is decoded from the video bitstream (e.g., decoded 1120, 1224, or 1254) (step 1650 is "yes", and step 1670 is performed). If all luma transform skip flags and chroma transform skip flags applicable to the CU indicate that the transform of the corresponding transform block is to be skipped, it is determined that the LFNST index indicates that the secondary transform is not applied (step 1650 is "no", and step 1660 is performed). In the case of a shared tree, the luma and chroma skip values and the LFNST index may be different. For example, even if the decoded luma transform skip flag, for example, in the collocated block indicates that the transform of the luma block is to be skipped, the first index decoded for the chroma transform block can also be based on the decoded chroma skip flag. Encoding steps 1480 and 1490 operate in a similar manner.
[0221] At the signaling MTS step 1672, the video decoder 114 determines whether the MTS index needs to be decoded from the bitstream 133. If the DCT-2 transform is selected at step 1360, the last significant coefficient position can be any position in the upper left 32x32 region of the TB when encoding the bitstream. If the last significant coefficient position decoded at step 1620 is outside the upper left 16x16 region of the TB and the DCT-2 transform is selected at step 1360, the last significant coefficient position can be any position in the upper left 32x32 region of the TB when encoding the bitstream. Fig.18 and 19 , then there is no need to explicitly decode mts_idx, because the use of any non-DCT-2 main transform will not produce the last significant coefficient outside this region. Step 1672 returns "no", and the method 1600 proceeds from step 1672 to determine MTS index step 1674. Non-DCT2 main transforms are only available when the TB width and height are less than or equal to 32. Therefore, for TBs with a width or height exceeding 32, step 1672 returns "no", and the method 1600 proceeds to determine MTS index step 1674.
[0222] The non-DCT-2 main transform is only available when the secondary transform type 474 indicates to bypass the application of the secondary transform core, so when the secondary transform type 474 has a non-zero value, the method 1600 proceeds from step 1672 to step 1674. Fig.18 and 19 When scanning the TB, the presence of the last significant coefficient position within the upper left 16×16 region of the TB may result from the application of the DCT-2 main transform or the MTS combination of DST-7 and / or DCT-8, thereby requiring explicit signaling of mts_idx to encode the selection made at step 1360. Therefore, when the last significant coefficient position is within the upper left 16×16 region of the TB, step 1672 returns “yes” and the method 1600 proceeds to step 1676 of decoding the MTS index.
[0223] At determine MTS index step 1674, the video decoder 134 determines that DCT-2 is to be used as the primary transform. The primary transform type 476 is set to zero. From step 1674, the method 1400 proceeds to a transform residual step 1680.
[0224] At step 1676 of decoding the MTS index, the entropy decoder 420 decodes the truncated unary bin string from the bitstream 133 to determine the primary transform type 476. The truncated string is, for example, Fig.11 1122 or Fig.12 1226 in the bitstream. From step 1676, method 1400 proceeds to step 1680 of transforming the residual.
[0225] Steps 1670, 1672, and 1674 are used to determine the MTS index for the coding unit. If the last significant coefficient is at or within the threshold coordinates (15, 15), the MTS index is decoded from the video bitstream ("yes" in step 1672 and step 1676). If the last significant coefficient is outside the threshold coordinates, the MTS index is determined to indicate that MTS is not applied ("no" in step 1672 and step 1674). Encoding steps 14100 and 14110 operate in a similar manner.
[0226] In an alternative arrangement of the video encoder 114 and the video decoder 134, according to reference Fig.17 The scanning mode described in the embodiment of the present invention is used to scan the chroma TB of appropriate size (MT is not applicable to the chroma TB), while the luma TB is scanned using the scanning mode described in the embodiment of the present invention. Fig.18 and 19 The DST-7 / DCT-8 combination is only applicable to the luminance TB.
[0227] At the transform residual step 1680, the video decoder 134, under the execution of the processor 205, bypasses the inverse main transform and the inverse secondary transform on the residual of step 1420, or performs an inverse transform according to the main transform type 476 and the secondary transform index 474. Figure 4The decoded transform skip flag 478 of each TB in the described CU is used to transform each TB of the CU. The main transform type 476 selects between using DCT-2 horizontally and vertically or using a combination of DCT-8 and DST-7 horizontally and vertically for the luma TB of the coding unit. In practice, step 1680 transforms the luma transform block of the CU according to the decoded luma transform skip flag, the main transform type 476, and the secondary transform index determined by the operations of steps 1610 and 1650 to 1670 to decode the coding unit. Step 1680 can also transform the chroma transform block of the CU according to the corresponding decoded chroma transform skip flag and secondary transform index determined by the operations of steps 1630 and 1650 to 1670 to decode the coding unit. For TBs belonging to chroma channels (e.g., 1132 and 1136 in the case of a shared coding tree or 1264 and 1268 in the chroma branch in the case of a separate coding tree), secondary transforms are only performed when the width and height of the TB are greater than or equal to four samples, because there are no available secondary transform cores for TBs with a width or height less than four samples. For TBs belonging to chroma channels, since it is difficult to process such small-sized TBs at the required block throughput required to support video formats such as UHD and 8K, restrictions on split operations are appropriate in the VVC standard to prohibit intra-prediction CUs with TB sizes of 2×2, 2×4, and 4×2. Further restrictions prohibit intra-prediction CUs with TBs of width 2 due to memory access difficulties of on-chip memories that are typically used to generate reconstructed samples as part of intra-prediction operations. Therefore, the chroma TB sizes (in chroma samples) for which secondary transforms are not applied are shown in Table 1.
[0228]
[0229] Table 1: Chroma TB sizes (in chroma samples) where the secondary transform is not applicable.
[0230] As described above, different scanning modes may be used in encoding and decoding. Step 1680 transforms the transform blocks of the CU according to the MTS index to decode the coding unit.
[0231] From step 1680, method 1600 proceeds to step 1690 of generating a prediction block. At step 1690, video decoder 134 generates prediction block 452 according to the prediction mode of the CU determined at step 1360 and decoded from bitstream 113 by entropy decoder 420. Entropy decoder 420 decodes the prediction mode for the coding unit as determined at step 1360 from bitstream 133. The "pred_mode" syntax element is decoded to distinguish the use of intra prediction, inter prediction, or other prediction modes for the coding unit. If intra prediction is used for the coding unit, then if luma PB is applicable to the CU, the luma intra prediction mode is decoded, and if chroma PB is applicable to the CU, the chroma intra prediction mode is decoded.
[0232] From step 1690, the method 1600 proceeds to step 16100 of reconstructing the coding unit. At step 16100, the prediction block 452 is added to the residual samples 424 of each color channel of the CU to generate reconstructed samples 456. Before the reconstructed samples 456 are output as the frame data 135, additional in-loop filtering steps (such as deblocking, etc.) may be applied to the reconstructed samples 456. The method 1600 terminates when step 16100 is performed.
[0233] As described above, for a separate coding tree, the method 1600 is first called for each CU (e.g., 1220) in the luma branch 1214a, and the method 1600 is also called separately for each chroma CU (e.g., 1250) in the chroma branch 1214b. The method 1600 is called for chroma to determine the LFNST index 1254 at steps 1650 to 1670 for whether all chroma transform skip flags of the CU 1250 are set. Similarly, in calling the method 1600 for luma, the luma LFNST index 1224 is determined only for the luma transform skip flag of the CU 1220 at steps 1650 to 1670.
[0234] and Fig.17 Compared to the scanning mode 1710, as implemented at steps 1450 and 1620 Figures 18 to 20 The scan patterns shown in (i.e., 1810, 1910, and 2010a-2010f) substantially preserve the property of proceeding from the highest frequency coefficient of the TB toward the lowest frequency coefficient of the TB. Thus, the arrangement of the video encoder 114 and the video decoder 134 using scan patterns 1810, 1910, and 2010a-2010f achieves compression efficiency similar to that achieved when using scan pattern 1710, while enabling the signaling of the MTS index to depend on the last significant coefficient position without further needing to check for zero-valued residual coefficients outside the MTS transform coefficient region. Figures 18 to 20The last position used together with the scan mode of TB allows MTS to be used only when all significant coefficients are present in the appropriate upper left region (such as the upper left 16×16 region, etc.). The following burden is removed: the decoder 134 checks the flag outside the appropriate region (for example, outside the 16×16 coefficient region of the TB) to ensure that there are no additional non-significant coefficients. No specific changes are required in the behavior of the decoder to implement MTS. In addition, as described above, that is, for transform blocks of size 16×32, 32×16, and 32×32, the 16×16 scan can be copied Fig.18 and 19 The use of scan mode in the FPGA reduces memory requirements.
[0235] Industrial Applicability
[0236] The described arrangement is suitable for use in the computer and data processing industries and is particularly suitable for use in digital signal processing for encoding or decoding signals such as video and image signals, thereby achieving high compression efficiency.
[0237] Some arrangements described herein improve compression efficiency by signaling a secondary transform index when the available choices include at least one option other than bypassing the secondary transform. Improved compression efficiency is achieved both when the CTU is partitioned into CUs spanning all color channels (the "common coding tree" case) and when the CTU is partitioned into a luma CU set and a chroma CU set (the "separate coding tree" case). Redundant signaling of secondary transform indexes when the secondary transform index cannot be used is avoided in the case of separate trees. For the shared tree, the LFNST index can be signaled for the chroma DCT-2 main case even if transform skipping is used for luma. Other arrangements maintain compression efficiency while enabling the signaling of the MTS index to depend on the last significant coefficient position without further needing to check for zero-valued residual coefficients outside the MTS transform coefficient region of the TB.
[0238] The foregoing describes only some embodiments of the present invention, and modifications and / or changes may be made to the present invention without departing from the scope and spirit of the present invention, wherein the embodiments are intended to be illustrative and not restrictive.
[0239] Citation of Related Applications
[0240] This application claims the benefit of priority under 35 U.S.C. §119 to Australian Patent Application No. 2019275552, filed on December 3, 2019, the entire contents of which are hereby incorporated by reference for all purposes.
Claims
1. A method for decoding a coding unit from a bitstream, wherein the coding unit is obtained by segmenting a coding tree unit of an image using a tree structure, wherein the coding unit can have at least a luminance component or a chrominance component, and the chrominance component includes a Cb component and a Cr component, the method comprising: In a case where the coding unit has the luma component, decoding a luma transform skip flag for the luma component from the bit stream, wherein the luma transform skip flag is used to indicate whether to skip a luma transform process for the luma component; In a case where the coding unit has the chroma component, decoding a first chroma transform skip flag for the Cb component and a second chroma transform skip flag for the Cr component from the bitstream, wherein the first chroma transform skip flag is used to indicate whether to skip a first chroma transform process for the Cb component, and the second chroma transform skip flag is used to indicate whether to skip a second chroma transform process for the Cr component; determining, for the coding unit, whether to decode an index for a specific transform process from the bitstream; as well as decoding, for the coding unit, an index for the specific transform process from the bitstream according to a determination result in the determining, Wherein, in a case where the coding tree unit has a size of 128×128 and the coding tree structure for the luma component in the coding tree unit is to be separated from the coding tree structure for the chroma component in the coding tree unit, (a) the coding tree unit is divided into four regions each having a size of 64×64, similarly to the luma component and the chroma component, (b) a dual tree structure for the luma component and a dual tree structure for the chroma component start for each of the four regions, and (c) before determining whether to decode the index for each coding unit, i.e., each CU, which is partitioned from a given region of the four regions using the dual tree structure for the chroma component, a determination is made as to whether to decode the index for each CU partitioned from the given region using the dual tree structure for the luma component, wherein, in a case where the coding unit is obtained by partitioning the coding tree unit using a single tree structure and each transform block in the coding unit includes significant coefficients only at a DC position, an index for the coding unit is not always decoded from the bitstream, wherein, when (i) the luma transform process, the first chroma transform process, and the second chroma transform process are skipped and (ii) the coding unit is partitioned from the coding tree unit using the single tree structure, even if a transform block in the coding unit includes a non-zero coefficient at a position other than the DC position, an index for the coding unit is not decoded from the bitstream and a value of the index for the coding unit is inferred to be 0, wherein, in a case where (i) the luma transform process is skipped and (ii) the coding unit is partitioned from the coding tree unit using a dual-tree structure for the luma component, even if a transform block in the coding unit contains a non-zero coefficient at a position other than the DC position, an index for the coding unit is not decoded from the bitstream and a value of the index for the coding unit is inferred to be 0, and In which, when (i) the first chroma transform processing and the second chroma transform processing are skipped and (ii) the coding unit is obtained by partitioning from the coding tree unit using a dual tree structure for the chroma component, even if the transform block in the coding unit contains a non-zero coefficient at a position other than the DC position, the index for the coding unit is not decoded from the bitstream, and the value of the index for the coding unit is inferred to be 0.
2. The method according to claim 1, wherein: The image has a 4:2:0 chroma format.
3. The method according to claim 1, wherein: In case of using intra prediction and the single tree structure, chroma blocks with sizes of 2x2, 2x4 and 4x2 are not allowed.
4. The method according to claim 1, wherein: The index having a value of 0 indicates that the particular transform process is not used.
5. The method according to claim 1, wherein: The DC position in the transform block is the upper left position of the transform block.
6. The method according to claim 1, wherein: The dual-tree structure for the luma component is decoded for the given region before the dual-tree structure for the chroma component is decoded for the given region.
7. The method according to claim 1, wherein: In a case where a transform block in the coding unit includes a non-zero coefficient, a flag indicating whether a size of the non-zero coefficient is greater than 1 is decoded, and the size of the non-zero coefficient is determined by using the decoded flag.
8. The method according to claim 7, wherein: Use context-encoded bins for the flags.
9. The method according to claim 7, wherein: Information of the sign of the non-zero coefficient is decoded.
10. A method for encoding a coding unit in a bitstream, wherein the coding unit is obtained by segmenting a coding tree unit of an image using a tree structure, the coding unit can have at least a luminance component or a chrominance component, and the chrominance component includes a Cb component and a Cr component, the method comprising: When the coding unit has the luma component, encoding a luma transform skip flag for the luma component in the bitstream, wherein the luma transform skip flag is used to indicate whether to skip luma transform processing for the luma component; In a case where the coding unit has the chroma component, encoding a first chroma transform skip flag for the Cb component and a second chroma transform skip flag for the Cr component in the bitstream, wherein the first chroma transform skip flag is used to indicate whether to skip a first chroma transform process for the Cb component, and the second chroma transform skip flag is used to indicate whether to skip a second chroma transform process for the Cr component; determining, for the coding unit, whether to encode an index for a particular transform process in the bitstream; as well as encoding, for the coding unit, an index for the specific transform process in the bitstream according to a determination result in the determining, Wherein, in a case where the coding tree unit has a size of 128×128 and the coding tree structure for the luma component in the coding tree unit is to be separated from the coding tree structure for the chroma component in the coding tree unit, (a) the coding tree unit is divided into four regions each having a size of 64×64, similarly to the luma component and the chroma component, (b) a dual tree structure for the luma component and a dual tree structure for the chroma component start for each of the four regions, and (c) before determining whether to encode the index for each coding unit, i.e., each CU, which is partitioned from a given region of the four regions using the dual tree structure for the chroma component, a determination is made as to whether to encode the index for each CU partitioned from the given region using the dual tree structure for the luma component, Wherein, in a case where the coding unit is obtained by partitioning the coding tree unit using a single tree structure and each transform block in the coding unit includes significant coefficients only at a DC position, an index for the coding unit is not always encoded in the bitstream, wherein, when (i) the luma transform process, the first chroma transform process, and the second chroma transform process are skipped and (ii) the coding unit is partitioned from the coding tree unit using the single tree structure, even if a transform block in the coding unit contains a non-zero coefficient at a position other than the DC position, an index for the coding unit is not encoded in the bitstream and a value of the index for the coding unit is inferred to be 0, wherein, when (i) the luma transform process is skipped and (ii) the coding unit is partitioned from the coding tree unit using a dual-tree structure for the luma component, even if a transform block in the coding unit contains a non-zero coefficient at a position other than the DC position, an index for the coding unit is not encoded in the bitstream and a value of the index for the coding unit is inferred to be 0, and In which, when (i) the first chromaticity transform processing and the second chromaticity transform processing are skipped and (ii) the coding unit is obtained by partitioning from the coding tree unit using a dual tree structure for the chromaticity component, even if the transform block in the coding unit contains non-zero coefficients at positions other than the DC position, the index for the coding unit is not encoded in the bitstream, and the value of the index for the coding unit is inferred to be 0.
11. The method according to claim 10, wherein: The image has a 4:2:0 chroma format.
12. The method according to claim 10, wherein: In case of using intra prediction and the single tree structure, chroma blocks with sizes of 2x2, 2x4 and 4x2 are not allowed.
13. The method according to claim 10, wherein: The index having a value of 0 indicates that the particular transform process is not used.
14. The method according to claim 10, wherein: The DC position in the transform block is the upper left position of the transform block.
15. The method according to claim 10, wherein: The dual tree structure for the luma component is encoded for the given region before the dual tree structure for the chroma component is encoded for the given region.
16. The method according to claim 10, wherein: In the case where a transform block in the coding unit includes a non-zero coefficient, a flag indicating whether a magnitude of the non-zero coefficient is greater than 1 is encoded by using a context bin.
17. The method according to claim 16, wherein: Information about the sign of the non-zero coefficient is encoded.
18. A device for decoding a coding unit from a bit stream, wherein the coding unit is obtained by segmenting a coding tree unit of an image using a tree structure, wherein the coding unit can have at least a luminance component or a chrominance component, and the chrominance component includes a Cb component and a Cr component, the device comprising: A first decoding unit is configured to, when the coding unit has the luma component, decode a luma transform skip flag for the luma component from the bit stream, wherein the luma transform skip flag is used to indicate whether to skip a luma transform process for the luma component; a second decoding unit configured to, if the coding unit has the chroma component, decode a first chroma transform skip flag for the Cb component and a second chroma transform skip flag for the Cr component from the bit stream, wherein the first chroma transform skip flag is used to indicate whether to skip a first chroma transform process for the Cb component, and the second chroma transform skip flag is used to indicate whether to skip a second chroma transform process for the Cr component; a determining unit configured to determine, for the coding unit, whether to decode an index for a specific transform process from the bitstream; as well as a third decoding unit configured to decode, for the encoding unit, an index for the specific transform process from the bit stream according to the determination result using the determination unit, Wherein, in a case where the coding tree unit has a size of 128×128 and the coding tree structure for the luma component in the coding tree unit is to be separated from the coding tree structure for the chroma component in the coding tree unit, (a) the coding tree unit is divided into four regions each having a size of 64×64, similarly to the luma component and the chroma component, (b) a dual tree structure for the luma component and a dual tree structure for the chroma component start for each of the four regions, and (c) before determining whether to decode the index for each coding unit, i.e., each CU, which is partitioned from a given region of the four regions using the dual tree structure for the chroma component, a determination is made as to whether to decode the index for each CU partitioned from the given region using the dual tree structure for the luma component, wherein, in a case where the coding unit is obtained by partitioning the coding tree unit using a single tree structure and each transform block in the coding unit includes significant coefficients only at a DC position, an index for the coding unit is not always decoded from the bitstream, wherein, when (i) the luma transform process, the first chroma transform process, and the second chroma transform process are skipped and (ii) the coding unit is partitioned from the coding tree unit using the single tree structure, even if a transform block in the coding unit includes a non-zero coefficient at a position other than the DC position, an index for the coding unit is not decoded from the bitstream and a value of the index for the coding unit is inferred to be 0, wherein, in a case where (i) the luma transform process is skipped and (ii) the coding unit is partitioned from the coding tree unit using a dual-tree structure for the luma component, even if a transform block in the coding unit contains a non-zero coefficient at a position other than the DC position, an index for the coding unit is not decoded from the bitstream and a value of the index for the coding unit is inferred to be 0, and In which, when (i) the first chroma transform processing and the second chroma transform processing are skipped and (ii) the coding unit is obtained by partitioning from the coding tree unit using a dual tree structure for the chroma component, even if the transform block in the coding unit contains a non-zero coefficient at a position other than the DC position, the index for the coding unit is not decoded from the bitstream, and the value of the index for the coding unit is inferred to be 0.
19. A device for encoding a coding unit in a bitstream, wherein the coding unit is obtained by segmenting a coding tree unit of an image using a tree structure, the coding unit can have at least a luminance component or a chrominance component, and the chrominance component includes a Cb component and a Cr component, the device comprising: a first encoding unit configured to, when the encoding unit has the luma component, encode a luma transform skip flag for the luma component in the bitstream, wherein the luma transform skip flag is used to indicate whether to skip a luma transform process for the luma component; a second encoding unit configured to, if the encoding unit has the chroma component, encode a first chroma transform skip flag for the Cb component and a second chroma transform skip flag for the Cr component in the bitstream, wherein the first chroma transform skip flag is used to indicate whether to skip a first chroma transform process for the Cb component, and the second chroma transform skip flag is used to indicate whether to skip a second chroma transform process for the Cr component; a determining unit configured to determine, for the coding unit, whether to encode an index for a specific transform process in the bitstream; as well as a third encoding unit configured to, according to a determination result in the determining, encode, for the encoding unit, an index for the specific transform process in the bitstream, Wherein, in a case where the coding tree unit has a size of 128×128 and the coding tree structure for the luma component in the coding tree unit is to be separated from the coding tree structure for the chroma component in the coding tree unit, (a) the coding tree unit is divided into four regions each having a size of 64×64, similarly to the luma component and the chroma component, (b) a dual tree structure for the luma component and a dual tree structure for the chroma component start for each of the four regions, and (c) before determining whether to encode the index for each coding unit, i.e., each CU, which is partitioned from a given region of the four regions using the dual tree structure for the chroma component, a determination is made as to whether to encode the index for each CU partitioned from the given region using the dual tree structure for the luma component, Wherein, in a case where the coding unit is obtained by partitioning the coding tree unit using a single tree structure and each transform block in the coding unit includes significant coefficients only at a DC position, an index for the coding unit is not always encoded in the bitstream, wherein, when (i) the luma transform process, the first chroma transform process, and the second chroma transform process are skipped and (ii) the coding unit is partitioned from the coding tree unit using the single tree structure, even if a transform block in the coding unit contains a non-zero coefficient at a position other than the DC position, an index for the coding unit is not encoded in the bitstream and a value of the index for the coding unit is inferred to be 0, wherein, when (i) the luma transform process is skipped and (ii) the coding unit is partitioned from the coding tree unit using a dual-tree structure for the luma component, even if a transform block in the coding unit contains a non-zero coefficient at a position other than the DC position, an index for the coding unit is not encoded in the bitstream and a value of the index for the coding unit is inferred to be 0, and In which, when (i) the first chromaticity transform processing and the second chromaticity transform processing are skipped and (ii) the coding unit is obtained by partitioning from the coding tree unit using a dual tree structure for the chromaticity component, even if the transform block in the coding unit contains non-zero coefficients at positions other than the DC position, the index for the coding unit is not encoded in the bitstream, and the value of the index for the coding unit is inferred to be 0.
20. A non-transitory computer-readable storage medium comprising computer-executable instructions that cause a computer to perform the method of claim 1.
21. A non-transitory computer-readable storage medium comprising computer-executable instructions, the computer-executable instructions causing a computer to perform the method according to claim 10.
