Context derivation for last position coding for video coding

文档序号:246886 发布日期:2021-11-12 浏览:4次 中文

阅读说明:本技术 用于视频译码的最后位置译码的上下文推导 (Context derivation for last position coding for video coding ) 是由 D·鲁萨诺夫斯基 K·P·A·勒兹 M·卡切夫维茨 于 2020-04-01 设计创作,主要内容包括:一种视频译码器可以确定用于对最后有效系数位置语法元素的二进数进行熵译码的上下文。例如,视频译码器可以使用变换块的大小的函数来确定用于指示变换块中的最后有效系数的位置的语法元素的一个或多个二进数中的每个二进数的相应上下文,其中,该函数输出相应上下文,使得相同的上下文不用于具有不同大小的变换块。(A video coder may determine a context for entropy coding a bin of a last significant coefficient position syntax element. For example, a video coder may determine a respective context for each bin of one or more bins of a syntax element indicating a position of a last significant coefficient in a transform block using a function of a size of the transform block, wherein the function outputs the respective context such that the same context is not used for transform blocks having different sizes.)

1. A method of decoding video data, the method comprising:

receiving entropy coded data for a current block of video data, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block;

determining a respective context for each bin of one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using a function of a size of the transform block, wherein the function outputs the respective contexts such that the same context is not used for transform blocks having different sizes; and

decoding the entropy coded data for the syntax element indicating the position of the last significant coefficient using the determined respective context.

2. The method of claim 1, wherein the transform block for the current block is a 64-sample dimensional transform block, and wherein the function comprises a linear operation and a non-linear operation.

3. The method of claim 2, wherein the non-linear operation comprises a magnitude-dependent offset with bit shifting and clipping.

4. The method of claim 1, wherein the transform block for the current block is a 64-sample dimensional transform block, and wherein determining the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using the function of the size of the transform block comprises:

determining, using a first function for the 64-sample dimensional transform block, the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient, wherein the first function is different from a second function for determining, for a 32-sample dimensional transform block, a respective context for each bin of one or more bins of entropy coded data for syntax elements indicating a position of a last significant coefficient.

5. The method of claim 1, wherein determining the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using the function of the size of the transform block comprises:

determining a respective context offset and a respective context shift using a function of the size of the transform block and a color component index; and

determining the respective context for a respective bin of the one or more bins using a bin index for the respective bin, the respective context offset, and the respective context shift.

6. The method of claim 1, wherein the syntax element is one of a first prefix syntax element indicating an X position of the last significant coefficient or a second prefix syntax element indicating a Y position of the last significant coefficient, and wherein decoding the entropy coded data for the syntax element indicating the position of the last significant coefficient using the determined respective contexts comprises:

decoding the entropy coded data for the first prefix syntax element or the second prefix syntax element using the determined respective context.

7. The method of claim 6, further comprising:

decoding a first suffix syntax element using fixed length decoding; and

inverse binarization is performed on the first prefix syntax element and the first suffix syntax element to obtain the position of the last significant coefficient.

8. The method of claim 1, wherein the transform block for the current block is a 128-sample dimensional transform block, and wherein determining the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using the function of the size of the transform block comprises:

determining, using a first function for the 128-sample dimensional transform block, the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient, wherein the first function is different from a second function for determining, for a 64-sample dimensional transform block, a respective context for each bin of one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient, and wherein the first function is different from a third function for determining, for a 32-sample dimensional transform block, a respective context for each bin of one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient.

9. The method of claim 1, further comprising:

decoding the transform block based on the position of the last significant coefficient to obtain a transform coefficient;

applying an inverse transform to the transform coefficients to obtain a residual block;

performing a prediction process for the current block to obtain a prediction block; and

adding the residual block to the prediction block to obtain a decoded block of video data.

10. The method of claim 9, further comprising:

displaying a picture comprising the decoded block of video data.

11. An apparatus configured to decode video data, the apparatus comprising:

a memory configured to store a current block of video data; and

one or more processors in communication with the memory, the one or more processors configured to:

receiving entropy coded data for the current block of video data, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block;

determining a respective context for each bin of one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using a function of a size of the transform block, wherein the function outputs the respective contexts such that the same context is not used for transform blocks having different sizes; and

decoding the entropy coded data for the syntax element indicating the position of the last significant coefficient using the determined respective context.

12. The apparatus of claim 11, wherein the transform block for the current block is a 64-sample dimensional transform block, and wherein the function comprises a linear operation and a non-linear operation.

13. The apparatus of claim 12, wherein the non-linear operation comprises a magnitude-dependent offset with bit shift and clipping.

14. The apparatus of claim 11, wherein the transform block for the current block is a 64-sample dimensional transform block, and wherein, to determine the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using the function of the size of the transform block, the one or more processors are further configured to:

determining, using a first function for the 64-sample dimensional transform block, the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient, wherein the first function is different from a second function for determining, for a 32-sample dimensional transform block, a respective context for each bin of one or more bins of entropy coded data for syntax elements indicating a position of a last significant coefficient.

15. The apparatus of claim 11, wherein, to determine the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using the function of the size of the transform block, the one or more processors are further configured to:

determining a respective context offset and a respective context shift using a function of the size of the transform block and a color component index; and

determining the respective context for a respective bin of the one or more bins using a bin index for the respective bin, the respective context offset, and the respective context shift.

16. The apparatus of claim 11, wherein the syntax element is one of a first prefix syntax element indicating an X-position of the last significant coefficient or a second prefix syntax element indicating a Y-position of the last significant coefficient, and wherein, to decode the entropy coded data for the syntax element indicating the position of the last significant coefficient using the determined respective context, the one or more processors are further configured to:

decoding the entropy coded data for the first prefix syntax element or the second prefix syntax element using the determined respective context.

17. The apparatus of claim 16, wherein the one or more processors are further configured to:

decoding a first suffix syntax element using fixed length decoding; and

inverse binarization is performed on the first prefix syntax element and the first suffix syntax element to obtain the position of the last significant coefficient.

18. The apparatus of claim 11, wherein the transform block for the current block is a 128-sample dimensional transform block, and wherein, to determine the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using the function of a size of the transform block, the one or more processors are further configured to:

determining, using a first function for the 128-sample dimensional transform block, the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient, wherein the first function is different from a second function for determining, for a 64-sample dimensional transform block, a respective context for each bin of one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient, and wherein the first function is different from a third function for determining, for a 32-sample dimensional transform block, a respective context for each bin of one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient.

19. The apparatus of claim 11, wherein the one or more processors are further configured to:

decoding the transform block based on the position of the last significant coefficient to obtain a transform coefficient;

applying an inverse transform to the transform coefficients to obtain a residual block;

performing a prediction process for the current block to obtain a prediction block; and

adding the residual block to the prediction block to obtain a decoded block of video data.

20. The apparatus of claim 19, further comprising:

a display configured to display a picture comprising the decoded block of video data.

21. The apparatus of claim 11, wherein the apparatus is a wireless communication device.

22. A non-transitory computer-readable storage medium storing instructions that, when executed, cause one or more processors of a device configured to decode video data to:

receiving entropy coded data for a current block of video data, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block;

determining a respective context for each bin of one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using a function of a size of the transform block, wherein the function outputs the respective contexts such that the same context is not used for transform blocks having different sizes; and

decoding the entropy coded data for the syntax element indicating the position of the last significant coefficient using the determined respective context.

23. The non-transitory computer-readable storage medium of claim 22, wherein the transform block for the current block is a 64-sample dimensional transform block, and wherein the function comprises a linear operation and a non-linear operation.

24. The non-transitory computer-readable storage medium of claim 23, wherein the non-linear operation comprises a magnitude-dependent offset with bit shift and clipping.

25. The non-transitory computer-readable storage medium of claim 22, wherein the transform block for the current block is a 64-sample dimensional transform block, and wherein, to determine the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using the function of the size of the transform block, the instructions further cause the one or more processors to:

determining, using a first function for the 64-sample dimensional transform block, the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient, wherein the first function is different from a second function for determining, for a 32-sample dimensional transform block, a respective context for each bin of one or more bins of entropy coded data for syntax elements indicating a position of a last significant coefficient.

26. The non-transitory computer-readable storage medium of claim 22, wherein, to determine the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using the function of the size of the transform block, the instructions further cause the one or more processors to:

determining a respective context offset and a respective context shift using a function of the size of the transform block and a color component index; and

determining the respective context for a respective bin of the one or more bins using a bin index for the respective bin, the respective context offset, and the respective context shift.

27. The non-transitory computer-readable storage medium of claim 22, wherein the syntax element is one of a first prefix syntax element indicating an X-position of the last significant coefficient or a second prefix syntax element indicating a Y-position of the last significant coefficient, and wherein to decode the entropy coded data for the syntax element indicating the position of the last significant coefficient using the determined respective context, the instructions further cause the one or more processors to:

decoding the entropy coded data for the first prefix syntax element or the second prefix syntax element using the determined respective context.

28. The non-transitory computer-readable storage medium of claim 27, wherein the instructions further cause the one or more processors to:

decoding a first suffix syntax element using fixed length decoding; and

inverse binarization is performed on the first prefix syntax element and the first suffix syntax element to obtain the position of the last significant coefficient.

29. The non-transitory computer-readable storage medium of claim 22, wherein the transform block for the current block is a 128-sample dimensional transform block, and wherein, to determine the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using the function of the size of the transform block, the instructions further cause the one or more processors to:

determining, using a first function for the 128-sample dimensional transform block, the respective context for each bin of the one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient, wherein the first function is different from a second function for determining, for a 64-sample dimensional transform block, a respective context for each bin of one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient, and wherein the first function is different from a third function for determining, for a 32-sample dimensional transform block, a respective context for each bin of one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient.

30. The non-transitory computer-readable storage medium of claim 22, wherein the instructions further cause the one or more processors to:

decoding the transform block based on the position of the last significant coefficient to obtain a transform coefficient;

applying an inverse transform to the transform coefficients to obtain a residual block;

performing a prediction process for the current block to obtain a prediction block; and

adding the residual block to the prediction block to obtain a decoded block of video data.

Technical Field

The present disclosure relates to video encoding and video decoding.

Background

Digital video capabilities can be incorporated into a wide variety of devices, including digital televisions, digital direct broadcast systems, wireless broadcast systems, Personal Digital Assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video gaming devices, video gaming consoles, cellular or satellite radio telephones (so-called "smart phones"), video teleconferencing devices, video streaming devices, and the like. Digital video devices implement video coding techniques, such as those described in the standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264/MPEG-4 (part 10, Advanced Video Coding (AVC)), ITU-T H.265/High Efficiency Video Coding (HEVC), and extensions of such standards. By implementing such video coding techniques, video devices may more efficiently transmit, receive, encode, decode, and/or store digital video information.

Video coding techniques include spatial (intra-picture) prediction and/or temporal (inter-picture) prediction to reduce or remove redundancy inherent in video sequences. For block-based video coding, a video slice (e.g., a video picture or a portion of a video picture) may be partitioned into video blocks, which may also be referred to as Coding Tree Units (CTUs), Coding Units (CUs), and/or coding nodes. Video blocks in an intra-coded (I) slice of a picture are encoded using spatial prediction with respect to reference samples in neighboring blocks in the same picture. Video blocks in an inter-coded (P or B) slice of a picture may use spatial prediction with respect to reference samples in neighboring blocks in the same picture or temporal prediction with respect to reference samples in other reference pictures. A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame.

Disclosure of Invention

In general, this disclosure describes techniques for entropy coding in video coding. In particular, this disclosure describes apparatus and methods for context adaptive entropy coding one or more syntax elements indicating a last significant coefficient position (e.g., a last position). Some example techniques for determining a context for a syntax element indicating a last significant coefficient may result in the same context being used for different bins between different transform block sizes. Using the same context for different bins between different transform block sizes may result in lower coding efficiency and/or unnecessary increases in distortion.

This disclosure describes techniques for determining a respective context for each of one or more bins of a syntax element that indicates a position of a last significant coefficient in a transform block using a function of a size of the transform block, wherein the function outputs the respective contexts such that the same context is not used for transform blocks having different sizes. In fact, with this function, the context of each respective bin of the syntax element indicating the position of the last significant coefficient is different for transform blocks having different sizes. In this way, the same context is not used between different transform block sizes, and thus, coding efficiency may be improved and/or the resulting decoded video data may exhibit less distortion.

In one example, the present disclosure describes a method of decoding video data, the method comprising: receiving entropy coded data for a current block of video data, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block; determining a respective context for each bin of one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using a function of a size of the transform block, wherein the function outputs the respective contexts such that the same context is not used for transform blocks having different sizes; and decoding the entropy coded data for the syntax element indicating the position of the last significant coefficient using the determined respective context.

In another example, the present disclosure describes an apparatus configured to decode video data, the apparatus comprising a memory configured to store a current block of video data and one or more processors in communication with the memory, the one or more processors configured to: receiving entropy coded data for the current block of video data, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block; determining a respective context for each bin of one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using a function of a size of the transform block, wherein the function outputs the respective contexts such that the same context is not used for transform blocks having different sizes; and decoding the entropy coded data for the syntax element indicating the position of the last significant coefficient using the determined respective context.

In another example, the present disclosure describes an apparatus configured to decode video data, the apparatus comprising: means for receiving entropy coded data for a current block of video data, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block; means for determining a respective context for each bin of one or more bins of the entropy coded data of the syntax element indicating the position of the last significant coefficient using a function of a size of the transform block, wherein the function outputs the respective contexts such that the same context is not used for transform blocks of different sizes; and means for decoding the entropy coded data for the syntax element indicating the position of the last significant coefficient using the determined respective context.

In another example, the present disclosure describes a non-transitory computer-readable storage medium storing instructions that, when executed, cause one or more processors of a device configured to decode video data to: receiving entropy coded data for a current block of video data, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block; determining a respective context for each bin of one or more bins of the entropy coded data for the syntax element indicating the position of the last significant coefficient using a function of a size of the transform block, wherein the function outputs the respective contexts such that the same context is not used for transform blocks having different sizes; and decoding the entropy coded data for the syntax element indicating the position of the last significant coefficient using the determined respective context.

The details of one or more examples are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will be apparent from the description and drawings, and from the claims.

Drawings

Fig. 1 is a block diagram illustrating an example video encoding and decoding system that may perform the techniques of this disclosure.

Fig. 2 is a block diagram illustrating an example video encoder that may perform the techniques of this disclosure.

Fig. 3 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure.

Fig. 4 is a flow chart illustrating an example encoding method according to an example of the present disclosure.

Fig. 5 is a flow diagram illustrating an example entropy encoding method according to an example of the present disclosure.

Fig. 6 is a flow chart illustrating an example decoding method according to an example of the present disclosure.

Fig. 7 is a flow chart illustrating an example entropy decoding method according to an example of the present disclosure.

Detailed Description

In general, this disclosure describes techniques for deriving contexts (e.g., probability models) for use in entropy encoding and entropy decoding (e.g., using context adaptive binary arithmetic coding) bins of syntax elements. In particular, this disclosure describes techniques for determining a context for a bin of a syntax element indicating an X or Y position of a last significant coefficient in a transform block. Some example techniques for determining a context for a syntax element indicating a last significant coefficient may result in the same context being used for different bins between different transform block sizes. Using the same context for different bins between different transform block sizes may result in lower coding efficiency and/or unnecessary increases in distortion.

This disclosure describes techniques for determining a respective context for each of one or more bins of a syntax element that indicates a position of a last significant coefficient in a transform block using a function of a size of the transform block, wherein the function outputs the respective contexts such that the same context is not used for transform blocks having different sizes. In this way, the same context is not used between different transform block sizes, and thus, coding efficiency may be improved and/or the resulting decoded video data may exhibit less distortion.

Fig. 1 is a block diagram illustrating an example video encoding and decoding system 100 that may perform the last significant coefficient position coding techniques of this disclosure. In general, the techniques of this disclosure relate to coding (encoding and/or decoding) video data. In general, video data includes any data used to process video. Thus, video data may include original unencoded video, encoded video, decoded (e.g., reconstructed) video, and video metadata (such as signaling data).

As shown in fig. 1, in this example, system 100 includes a source device 102, source device 102 providing encoded video data to be decoded and displayed by a destination device 116. In particular, source device 102 provides video data to destination device 116 via computer-readable medium 110. Source device 102 and destination device 116 may comprise any of a wide variety of devices, including desktop computers, notebook computers (i.e., laptop computers), tablet computers, set-top boxes, telephone handsets such as smart phones, televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, and the like. In some cases, source device 102 and destination device 116 may be equipped for wireless communication and may therefore be referred to as wireless communication devices.

In the example of fig. 1, the source device 102 includes a video source 104, a memory 106, a video encoder 200, and an output interface 108. The destination device 116 includes an input interface 122, a video decoder 300, a memory 120, and a display device 118. In accordance with this disclosure, video encoder 200 of source device 102 and video decoder 300 of destination device 116 may be configured to apply the techniques for last significant coefficient position coding. Thus, source device 102 represents an example of a video encoding device, and destination device 116 represents an example of a video decoding device. In other examples, the source device and the destination device may include other components or arrangements. For example, source device 102 may receive video data from an external video source, such as an external camera. Likewise, destination device 116 may interface with an external display device instead of including an integrated display device.

The system 100 as shown in fig. 1 is merely an example. In general, any digital video encoding and/or decoding device may perform the techniques for last significant coefficient position coding. Source device 102 and destination device 116 are merely examples of transcoding devices in which source device 102 generates transcoded video data for transmission to destination device 116. The present disclosure refers to a "transcoding" apparatus as an apparatus that performs transcoding (e.g., encoding and/or decoding) of data. Accordingly, the video encoder 200 and the video decoder 300 represent examples of a coding apparatus (specifically, a video encoder and a video decoder), respectively. In some examples, the devices 102, 116 may operate in a substantially symmetric manner such that each of the devices 102, 116 includes video encoding and decoding components. Thus, the system 100 may support one-way or two-way video transmission between the video devices 102, 116, for example, for video streaming, video playback, video broadcasting, or video telephony.

In general, video source 104 represents a source of video data (i.e., raw, unencoded video data) and provides a sequential series of pictures (also referred to as "frames") of the video data to video encoder 200, which video encoder 200 encodes the data for the pictures. The video source 104 of the source device 102 may include a video capture device, such as a video camera, a video archive unit containing previously captured raw video, and/or a video feed interface for receiving video from a video content provider. As a further alternative, video source 104 may generate computer graphics-based data as the source video, or a combination of real-time video, archived video, and computer-generated video. In each case, the video encoder 200 may encode captured, pre-captured, or computer-generated video data. Video encoder 200 may rearrange the pictures from the received order (sometimes referred to as "display order") into the coding order for coding. The video encoder 200 may generate a bitstream including the encoded video data. Source device 102 may then output the encoded video data onto computer-readable medium 110 via output interface 108 for receipt and/or retrieval by, for example, input interface 122 of destination device 116.

Memory 106 of source device 102 and memory 120 of destination device 116 represent general purpose memory. In some examples, the memories 106, 120 may store raw video data, e.g., raw video from the video source 104 and raw decoded video data from the video decoder 300. Additionally or alternatively, the memories 106, 120 may store software instructions executable by, for example, the video encoder 200 and the video decoder 300, respectively. Although the memories 106, 120 are shown in this example as being separate from the video encoder 200 and the video decoder 300, it should be understood that the video encoder 200 and the video decoder 300 may also include internal memories for functionally similar or equivalent purposes. Further, the memories 106, 120 may store, for example, encoded video data output from the video encoder 200 and input to the video decoder 300. In some examples, portions of memory 106, 120 may be allocated as one or more video buffers, e.g., to store raw decoded and/or encoded video data.

Computer-readable medium 110 may represent any type of medium or device capable of transporting encoded video data from source device 102 to destination device 116. In one example, computer-readable medium 110 represents a communication medium that enables source device 102 to send encoded video data directly to destination device 116 in real-time, e.g., via a radio frequency network or a computer-based network. Output interface 108 may modulate a transmission signal including the encoded video data according to a communication standard, such as a wireless communication protocol, and input interface 122 may demodulate a received transmission signal according to a communication standard, such as a wireless communication protocol. The communication medium may include any wireless or wired communication medium, such as a Radio Frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network such as: a local area network, a wide area network, or a global network such as the internet. The communication medium may include a router, switch, base station, or any other device that may be useful for facilitating communication from source device 102 to destination device 116.

In some examples, computer-readable media 110 may include storage device 112. Source device 102 may output the encoded data from output interface 108 to storage device 112. Similarly, destination device 116 may access the encoded data from storage device 112 via input interface 122. Storage device 112 may include any of a variety of distributed or locally accessed data storage media such as a hard drive, blu-ray discs, DVDs, CD-ROMs, flash memory, volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data.

In some examples, computer-readable medium 110 may include file server 114 or another intermediate storage device that may store the encoded video data generated by source device 102. Source device 102 may output the encoded video data to file server 114 or another intermediate storage device that may store the encoded video generated by source device 102. Destination device 116 may access stored video data from file server 114 via streaming or download. File server 114 may be any type of server device capable of storing encoded video data and transmitting the encoded video data to destination device 116. File server 114 may represent a web server (e.g., for a website), a File Transfer Protocol (FTP) server, a content delivery network device, or a Network Attached Storage (NAS) device. Destination device 116 may access the encoded video data from file server 114 through any standard data connection, including an internet connection. This may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., Digital Subscriber Line (DSL), cable modem, etc.), or a combination of both, suitable for accessing encoded video data stored on file server 114. File server 114 and input interface 122 may be configured to operate in accordance with: a streaming transport protocol, a download transport protocol, or a combination thereof.

Output interface 108 and input interface 122 may represent wireless transmitters/receivers, modems, wired networking components (e.g., ethernet cards), wireless communication components that operate according to any of a variety of IEEE 802.11 standards, or other physical components. In examples in which the output interface 108 and the input interface 122 include wireless components, the output interface 108 and the input interface 122 may be configured to transmit data, such as encoded video data, in accordance with a cellular communication standard, such as 4G, 4G-LTE (long term evolution), LTE advanced, 5G, and so forth. In some examples in which the output interface 108 comprises a wireless transmitter, the output interface 108 and the input interface 122 may be configured according to other wireless standards (such as the IEEE 802.11 specification, the IEEE 802.15 specification (e.g., ZigBee)TM)、BluetoothTMStandard, etc.) to transmit data (such as encoded video data). In some examples, source device 102 and/or destination device 116 may include respective system on chip (SoC) devices. For example, source device 102 may include an SoC device to perform the functions attributed to video encoder 200 and/or output interface 108, and destination device 116 may include an SoC device to perform the functions attributed to video decoder 300 and/or input interface 122.

The techniques of this disclosure may be applied to video coding to support any of a variety of multimedia applications, such as over-the-air television broadcasts, cable television transmissions, satellite television transmissions, internet streaming video transmissions, such as dynamic adaptive streaming over HTTP (DASH), digital video encoded onto a data storage medium, decoding of digital video stored on a data storage medium, or other applications.

The input interface 122 of the destination device 116 receives the encoded video bitstream from the computer-readable medium 110 (e.g., communication device, storage device 112, file server 114, etc.). The encoded video bitstream from the computer-readable medium 110 may include signaling information defined by the video encoder 200 (which is also used by the video decoder 300), such as the following syntax elements: the syntax elements have values that describe characteristics and/or processing of video blocks or other coding units (e.g., slices, pictures, groups of pictures, sequences, etc.). Display device 118 displays the decoded pictures of the decoded video data to a user. Display device 118 may represent any of a variety of display devices, such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), a plasma display, an Organic Light Emitting Diode (OLED) display, or another type of display device.

Although not shown in fig. 1, in some examples, video encoder 200 and video decoder 300 may each be integrated with an audio encoder and/or audio decoder, and may include appropriate MUX-DEMUX units or other hardware and/or software to process multiplexed streams including both audio and video in a common data stream. The MUX-DEMUX unit may, if applicable, conform to the ITU h.223 multiplexer protocol or other protocols such as the User Datagram Protocol (UDP).

Video encoder 200 and video decoder 300 may each be implemented as any of a variety of suitable encoder and/or decoder circuits, such as one or more microprocessors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), discrete logic, software, hardware, firmware, or any combinations thereof. When the techniques are implemented in part in software, the device may store instructions for the software in a suitable non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the techniques of this disclosure. Each of video encoder 200 and video decoder 300 may be included in one or more encoders or decoders, either of which may be integrated as part of a combined encoder/decoder (CODEC) in the respective device. A device including video encoder 200 and/or video decoder 300 may include an integrated circuit, a microprocessor, and/or a wireless communication device (such as a cellular telephone).

The video encoder 200 and the video decoder 300 may operate in accordance with a video coding standard, such as ITU-t h.265 (also known as the High Efficiency Video Coding (HEVC) standard) or an extension thereto, such as a multiview and/or scalable video coding extension. Alternatively, the video encoder 200 and the video decoder 300 may operate according to other proprietary or industry standards, such as the joint exploration test model (JEM) or ITU-T H.266 standard, also known as Universal video coding (VVC). The draft of the VVC standard is described in the following documents: bross et al, "Versatile Video Coding (Draft 4)", ITU-T SG 16WP 3 and the Joint Video experts group (JFET) of ISO/IEC JTC 1/SC 29/WG 11, conference 13: malelan, Md.2019, JVET-M1001-v5 (hereinafter referred to as "VVC draft 4"), on Marathosh, 1/month, 9-18 days. In other examples, the video encoder 200 and the video decoder 300 may operate in accordance with one or more versions of the MPEG-5/EVC (basic video coding) standard under development. However, the techniques of this disclosure are not limited to any particular coding standard.

In general, the video encoder 200 and the video decoder 300 may perform block-based coding of pictures. The term "block" generally refers to a structure that includes data to be processed (e.g., encoded, decoded, or otherwise used in an encoding and/or decoding process). For example, a block may comprise a two-dimensional matrix of samples of luminance and/or chrominance data. In general, video encoder 200 and video decoder 300 may code video data represented in YUV (e.g., Y, Cb, Cr) format. That is, rather than coding red, green, and blue (RGB) data for samples of a picture, video encoder 200 and video decoder 300 may code luma and chroma components, where the chroma components may include both red-hue and blue-hue chroma components. In some examples, the video encoder 200 converts the received RGB formatted data to a YUV representation prior to encoding, and the video decoder 300 converts the YUV representation to an RGB format. Alternatively, a pre-processing unit and a post-processing unit (not shown) may perform these conversions.

In general, the present disclosure may relate to coding (e.g., encoding and decoding) of a picture to include a process of encoding or decoding data of the picture. Similarly, the disclosure may relate to coding of a block of a picture to include a process of encoding or decoding (e.g., predictive and/or residual coding) data for the block. An encoded video bitstream typically includes a series of values for syntax elements that represent coding decisions (e.g., coding modes) and that partition a picture into blocks. Thus, references to coding a picture or block should generally be understood as coding values of syntax elements used to form the picture or block.

HEVC defines various blocks, including Coding Units (CUs), Prediction Units (PUs), and Transform Units (TUs). In general, a coding unit or other type of unit may refer to all luma and/or chroma blocks of a region of a picture. For example, the coding unit may include a luminance block, a Cr chrominance block, and a Cb chrominance block. In other examples, the luma block and the chroma blocks are partitioned independently. In this example, the blocks and cells may be synonymous. According to HEVC, a video coder, such as video encoder 200, partitions a Coding Tree Unit (CTU) into CUs according to a quadtree structure. That is, the video coder partitions the CTUs and CUs into four equal, non-overlapping squares, and each node of the quadtree has zero or four child nodes. A node without a child node may be referred to as a "leaf node," and a CU of such a leaf node may include one or more PUs and/or one or more TUs. The video coder may further partition the PU and TU. For example, in HEVC, the Residual Quadtree (RQT) represents the partitioning of a TU. In HEVC, a PU represents inter prediction data and a TU represents residual data. The intra-predicted CU includes intra-prediction information, such as an intra-mode indication.

As another example, the video encoder 200 and the video decoder 300 may be configured to operate in accordance with JEM or VVC. According to EVC, JEM, or VVC, a video coder, such as video encoder 200, partitions a picture into multiple Coding Tree Units (CTUs). The video encoder 200 may partition the CTUs according to a tree structure, such as a quadtree-binary tree (QTBT) structure or a multi-type tree (MTT) structure. The QTBT structure removes the concept of multiple partition types, such as the separation between CU, PU and TU of HEVC. The QTBT structure comprises two levels: a first level segmented according to quadtree segmentation, and a second level segmented according to binary tree segmentation. The root node of the QTBT structure corresponds to the CTU. Leaf nodes of the binary tree correspond to Coding Units (CUs).

In the MTT split structure, a block may be split using Quadtree (QT) splitting, Binary Tree (BT) splitting, and one or more types of Ternary Tree (TT) splitting. A ternary tree partition is a partition in which a block is split into three sub-blocks. In some examples, the ternary tree partitioning divides the block into three sub-blocks without dividing the original block through the center. The partition types (e.g., QT, BT, and TT) in MTT may be symmetric or asymmetric.

In some examples, the video encoder 200 and the video decoder 300 may represent each of the luma and chroma components using a single QTBT or MTT structure, while in other examples, the video encoder 200 and the video decoder 300 may use two or more QTBT or MTT structures, such as one QTBT/MTT structure for the luma component and another QTBT/MTT structure for the two chroma components (or two QTBT/MTT structures for the respective chroma components).

The video encoder 200 and the video decoder 300 may be configured to use quadtree partitioning per HEVC, QTBT partitioning, MTT partitioning, or other partitioning structures. For purposes of explanation, a description of the techniques of the present disclosure is given with respect to QTBT segmentation. However, it should be understood that the techniques of this disclosure may also be applied to video coders configured to use quadtree partitioning, or also other types of partitioning.

The present disclosure may use "NxN" and "N by N" interchangeably to refer to the sample size of a block (such as a CU or other video block) in the vertical and horizontal dimensions, e.g., 16x16 samples or 16 by 16 samples. Typically, a 16x16 CU will have 16 samples in the vertical direction (y-16) and 16 samples in the horizontal direction (x-16). Likewise, an NxN CU typically has N samples in the vertical direction and N samples in the horizontal direction, where N represents a non-negative integer value. The samples in a CU may be arranged in rows and columns. Furthermore, a CU does not necessarily need to have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU may include NxM samples, where M is not necessarily equal to N.

Video encoder 200 encodes video data representing prediction and/or residual information, as well as other information, for a CU. The prediction information indicates how the CU is to be predicted in order to form a prediction block for the CU. The residual information typically represents the sample-by-sample difference between the samples of the CU before encoding and the prediction block.

To predict a CU, video encoder 200 may typically form a prediction block for the CU through inter prediction or intra prediction. Inter-prediction typically refers to predicting a CU from data of a previously coded picture, while intra-prediction typically refers to predicting a CU from previously coded data of the same picture. To perform inter prediction, the video encoder 200 may generate a prediction block using one or more motion vectors. Video encoder 200 may typically perform a motion search to identify a reference block that closely matches a CU, e.g., in terms of differences between the CU and the reference block. Video encoder 200 may calculate a difference metric using Sum of Absolute Differences (SAD), Sum of Squared Differences (SSD), Mean Absolute Differences (MAD), Mean Squared Differences (MSD), or other such difference calculations to determine whether the reference block closely matches the current CU. In some examples, video encoder 200 may predict the current CU using uni-directional prediction or bi-directional prediction.

Some examples of EVC, JEM, and VVC also provide an affine motion compensation mode, which may be considered an inter-prediction mode. In the affine motion compensation mode, video encoder 200 may determine two or more motion vectors that represent non-translational motion (such as zoom-in or zoom-out, rotation, perspective motion, or other irregular types of motion).

To perform intra-prediction, video encoder 200 may select an intra-prediction mode to generate the prediction block. Some examples of EVC, JEM, and VVC provide sixty-seven intra prediction modes, including various directional modes, as well as planar and DC modes. In general, video encoder 200 selects an intra-prediction mode that describes neighboring samples of a current block (e.g., a block of a CU) from which samples of the current block are to be predicted. Assuming that the video encoder 200 codes CTUs and CUs in raster scan order (left-to-right, top-to-bottom), such samples may typically be above, above-left, or left-to-side of the current block in the same picture as the current block.

The video encoder 200 encodes data representing a prediction mode for the current block. For example, for an inter prediction mode, the video encoder 200 may encode data indicating which of various available inter prediction modes is used, as well as motion information for the corresponding mode. For uni-directional or bi-directional inter prediction, for example, the video encoder 200 may encode the motion vector using Advanced Motion Vector Prediction (AMVP) or merge mode. The video encoder 200 may use a similar mode to encode the motion vectors for the affine motion compensation mode.

After prediction, such as intra prediction or inter prediction, for a block, the video encoder 200 may calculate residual data for the block. Residual data (such as a residual block) represents the sample-by-sample difference between a block and a prediction block for the block, which is formed using the corresponding prediction mode. Video encoder 200 may apply one or more transforms to the residual block to produce transformed data in the transform domain rather than in the sample domain. For example, the video encoder 200 may apply a Discrete Cosine Transform (DCT), an integer transform, a wavelet transform, or a conceptually similar transform to the residual video data. In addition, video encoder 200 may apply a second transform, such as a mode dependent non-separable second transform (mdsnst), a signal dependent transform, a Karhunen-Loeve transform (KLT), or the like, after the first transform. The video encoder 200 generates transform coefficients after applying one or more transforms.

As described above, after any transform to produce transform coefficients, the video encoder 200 may perform quantization of the transform coefficients. Quantization generally refers to the process of: in this process, the transform coefficients are quantized to possibly reduce the amount of data used to represent the coefficients, thereby providing further compression. By performing the quantization process, video encoder 200 may reduce the bit depth associated with some or all of the coefficients. For example, the video encoder 200 may round down an n-bit value to an m-bit value during quantization, where n is greater than m. In some examples, to perform quantization, video encoder 200 may perform a bitwise right shift of the value to be quantized.

After quantization, video encoder 200 may scan the transform coefficients, producing a one-dimensional vector from a two-dimensional matrix including the quantized transform coefficients. The scanning may be designed to place the higher energy (and therefore lower frequency) coefficients in front of the vector and the lower energy (and therefore higher frequency) transform coefficients behind the vector. In some examples, video encoder 200 may scan the quantized transform coefficients with a predefined scan order to produce a serialized vector, and then entropy encode the quantized transform coefficients of the vector. In other examples, video encoder 200 may perform adaptive scanning. After scanning the quantized transform coefficients to form a one-dimensional vector, video encoder 200 may entropy encode the one-dimensional vector, e.g., according to Context Adaptive Binary Arithmetic Coding (CABAC). Video encoder 200 may also entropy encode values for syntax elements describing metadata associated with the encoded video data for use by video decoder 300 in decoding the video data.

To perform CABAC, the video encoder 200 may assign a context within the context model to a symbol to be transmitted. The context may relate to, for example, whether adjacent values of a symbol are zero values. The probability determination may be based on the context assigned to the symbol.

The video encoder 200 may also generate syntax data (such as block-based syntax data, picture-based syntax data, and sequence-based syntax data) or other syntax data (such as Sequence Parameter Sets (SPS), Picture Parameter Sets (PPS), or Video Parameter Sets (VPS)) for the video decoder 300, for example, in a picture header, a block header, a slice header. Likewise, video decoder 300 may decode such syntax data to determine how to decode the corresponding video data.

In this manner, video encoder 200 may generate a bitstream that includes encoded video data, e.g., syntax elements that describe partitioning of a picture into blocks (e.g., CUs) and prediction and/or residual information for the blocks. Finally, the video decoder 300 may receive the bitstream and decode the encoded video data.

In general, the video decoder 300 performs a process reverse to that performed by the video encoder 200 to decode encoded video data of a bitstream. For example, video decoder 300 may use CABAC to decode values for syntax elements of a bitstream in a substantially similar, but opposite manner to the CABAC encoding process of video encoder 200. The syntax elements may define partitioning information for partitioning a picture into CTUs, and partitioning each CTU according to a corresponding partitioning structure (such as a QTBT structure) to define a CU of the CTU. The syntax elements may also define prediction and residual information for blocks (e.g., CUs) of the video data.

The residual information may be represented by, for example, quantized transform coefficients. The video decoder 300 may inverse quantize and inverse transform the quantized transform coefficients of the block to reproduce a residual block for the block. The video decoder 300 uses the signaled prediction mode (intra-prediction or inter-prediction) and related prediction information (e.g., motion information for inter-prediction) to form a prediction block for the block. The video decoder 300 may then combine the prediction block and the residual block (on a sample-by-sample basis) to reproduce the original block. The video decoder 300 may perform additional processing, such as performing a deblocking process to reduce visual artifacts along the boundaries of the blocks.

In accordance with the techniques of this disclosure, as will be explained in more detail below, video encoder 200 may be configured to: determining a syntax element indicating a position of a last significant coefficient in a transform block of a current block of video data; binarizing the syntax element into one or more bins; determining a respective context for each bin of the one or more bins of the syntax element indicating the position of the last significant coefficient using a function of the size of the transform block, wherein the function outputs the contexts such that the same context is not used for transform blocks having different sizes; and entropy encoding one or more bins of a syntax element indicating a position of a last significant coefficient using the determined context.

Similarly, the video decoder 300 may be configured to: receiving entropy coded data for a current block of video data, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block; determining a respective context for each bin of one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient using a function of a size of a transform block, wherein the function outputs the respective contexts such that the same context is not used for transform blocks having different sizes; and decoding entropy coded data for a syntax element indicating a position of a last significant coefficient using the determined respective context.

In general, the present disclosure may relate to "signaling" certain information (such as syntax elements). The term "signaling" may generally refer to the transmission of values for syntax elements and/or other data used to decode encoded video data. That is, the video encoder 200 may signal a value for a syntax element in a bitstream. Generally, signaling refers to generating values in a bitstream. As described above, source device 102 may transmit the bitstream to destination device 116 in substantially real time or not in real time (such as may occur when syntax elements are stored to storage device 112 for later retrieval by destination device 116).

Fig. 2 is a block diagram illustrating an example video encoder 200 that may perform the last significant coefficient coding techniques of this disclosure. Fig. 2 is provided for purposes of explanation and should not be considered limiting of the technology broadly illustrated and described in this disclosure. For purposes of explanation, this disclosure describes video encoder 200 in the context of a video coding standard, such as the HEVC video coding standard and the EVC and VVC video coding standards being developed. However, the techniques of this disclosure are not limited to these video coding standards and are generally applicable to video encoding and decoding.

In the example of fig. 2, the video encoder 200 includes a video data memory 230, a mode selection unit 202, a residual generation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a Decoded Picture Buffer (DPB)218, and an entropy coding unit 220. Any or all of video data memory 230, mode selection unit 202, residual generation unit 204, transform processing unit 206, quantization unit 208, inverse quantization unit 210, inverse transform processing unit 212, reconstruction unit 214, filter unit 216, DPB 218, and entropy encoding unit 220 may be implemented in one or more processors or in processing circuitry. Further, video encoder 200 may include additional or alternative processors or processing circuits to perform these and other functions.

The video data memory 230 may store video data to be encoded by the components of the video encoder 200. Video encoder 200 may receive video data stored in video data storage 230 from, for example, video source 104 (fig. 1). The DPB 218 may act as a reference picture memory that stores reference video data for use when subsequent video data is predicted by the video encoder 200. Video data memory 230 and DPB 218 may be formed from any of a variety of memory devices, such as Dynamic Random Access Memory (DRAM) (including synchronous DRAM (sdram)), magnetoresistive ram (mram), resistive ram (rram), or other types of memory devices. Video data memory 230 and DPB 218 may be provided by the same memory device or separate memory devices. In various examples, video data memory 230 may be on-chip with other components of video encoder 200 (as shown), or off-chip with respect to those components.

In this disclosure, references to video data memory 230 should not be construed as limited to memory internal to video encoder 200 (unless specifically described as such), or to memory external to video encoder 200 (unless specifically described as such). Rather, references to video data memory 230 should be understood as a reference memory that stores video data received by video encoder 200 for encoding (e.g., video data for a current block to be encoded). The memory 106 of fig. 1 may also provide temporary storage of the outputs from the various units of the video encoder 200.

The various elements of fig. 2 are shown to assist in understanding the operations performed by video encoder 200. These units may be implemented as fixed function circuits, programmable circuits, or a combination thereof. Fixed function circuitry refers to circuitry that provides a particular function and is pre-configured with respect to operations that may be performed. Programmable circuitry refers to circuitry that can be programmed to perform various tasks and provide flexible functionality in operations that can be performed. For example, the programmable circuitry may execute software or firmware that causes the programmable circuitry to operate in a manner defined by the instructions of the software or firmware. Fixed function circuitry may execute software instructions (e.g., to receive parameters or output parameters), but the type of operations performed by the fixed function circuitry is typically immutable. In some examples, one or more of the units may be different circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be integrated circuits.

The video encoder 200 may include an Arithmetic Logic Unit (ALU), a basic function unit (EFU), digital circuitry, analog circuitry, and/or a programmable core formed from programmable circuitry. In examples in which the operations of video encoder 200 are performed using software executed by programmable circuitry, memory 106 (fig. 1) may store object code of the software received and executed by video encoder 200, or another memory (not shown) within video encoder 200 may store such instructions.

The video data memory 230 is configured to store the received video data. The video encoder 200 may retrieve a picture of the video data from the video data memory 230 and provide the video data to the residual generation unit 204 and the mode selection unit 202. The video data in video data memory 230 may be the original video data to be encoded.

Mode selection unit 202 includes motion estimation unit 222, motion compensation unit 224, and intra prediction unit 226. Mode selection unit 202 may include additional functional units that perform video prediction according to other prediction modes. As an example, the mode selection unit 202 may include a palette unit, an intra-block copy unit (which may be part of the motion estimation unit 222 and/or the motion compensation unit 224), an affine unit, a Linear Model (LM) unit, and the like.

Mode selection unit 202 typically coordinates multiple encoding passes (pass) to test combinations of encoding parameters and resulting rate-distortion values for such combinations. The encoding parameters may include partitioning of the CTU into CUs, a prediction mode for the CU, a transform type of residual data for the CU, a quantization parameter of the residual data for the CU, and the like. The mode selection unit 202 may finally select a combination of encoding parameters having a better rate-distortion value than other tested combinations.

The video encoder 200 may partition a picture retrieved from the video data memory 230 into a series of CTUs and encapsulate one or more CTUs within a slice. The mode selection unit 202 may partition the CTUs of a picture according to a tree structure, such as the QTBT structure of HEVC or a quadtree structure described above. As described above, the video encoder 200 may form one or more CUs by partitioning CTUs according to a tree structure. Such CUs may also be commonly referred to as "video blocks" or "blocks".

Typically, mode select unit 202 also controls its components (e.g., motion estimation unit 222, motion compensation unit 224, and intra prediction unit 226) to generate a prediction block for the current block (e.g., the current CU, or the overlapping portion of a PU and a TU in HEVC). To inter-predict the current block, the motion estimation unit 222 may perform a motion search to identify one or more closely matching reference blocks in one or more reference pictures (e.g., one or more previously coded pictures stored in the DPB 218). Specifically, the motion estimation unit 222 may calculate a value representing how similar the potential reference block will be to the current block, for example, from a Sum of Absolute Differences (SAD), a Sum of Squared Differences (SSD), a Mean Absolute Difference (MAD), a Mean Squared Difference (MSD), and the like. The motion estimation unit 222 may typically perform these calculations using the sample-by-sample difference between the current block and the reference block under consideration. The motion estimation unit 222 may identify the reference block resulting from these calculations that has the lowest value, indicating the reference block that most closely matches the current block.

The motion estimation unit 222 may form one or more Motion Vectors (MVs) defining the position of a reference block in a reference picture relative to the position of the current block in the current picture. The motion estimation unit 222 may then provide the motion vectors to the motion compensation unit 224. For example, for uni-directional inter prediction, motion estimation unit 222 may provide a single motion vector, while for bi-directional inter prediction, motion estimation unit 222 may provide two motion vectors. Then, the motion compensation unit 224 may generate a prediction block using the motion vector. For example, the motion compensation unit 224 may use the motion vectors to retrieve data of the reference block. As another example, if the motion vector has fractional sample precision, the motion compensation unit 224 may interpolate values for the prediction block according to one or more interpolation filters. Furthermore, for bi-directional inter prediction, the motion compensation unit 224 may retrieve data for two reference blocks identified by respective motion vectors and combine the retrieved data, e.g., by sample-by-sample averaging or weighted averaging.

As another example, for intra-prediction or intra-prediction coding, the intra-prediction unit 226 may generate a prediction block from samples adjacent to the current block. For example, for directional modes, the intra prediction unit 226 may generally mathematically combine values of neighboring samples and pad these calculated values in a defined direction across the current block to produce a prediction block. As another example, for the DC mode, the intra prediction unit 226 may calculate an average value of neighboring samples of the current block, and generate the prediction block to include the resulting average value for each sample of the prediction block.

The mode selection unit 202 supplies the prediction block to the residual generation unit 204. The residual generation unit 204 receives the original, unencoded version of the current block from the video data memory 230 and the prediction block from the mode selection unit 202. The residual generation unit 204 calculates a sample-by-sample difference between the current block and the prediction block. The resulting sample-by-sample difference defines a residual block for the current block. In some examples, the residual generation unit 204 may generate the residual block using Residual Differential Pulse Code Modulation (RDPCM) by using a difference between sample values in the residual block. In some examples, residual generation unit 204 may be formed using one or more subtractor circuits that perform binary subtraction.

In an example where mode selection unit 202 partitions a CU into PUs, each PU may be associated with a luma prediction unit and a corresponding chroma prediction unit. The video encoder 200 and the video decoder 300 may support PUs having various sizes. As noted above, the size of a CU may refer to the size of the luma coding block of the CU, while the size of a PU may refer to the size of the luma prediction unit of the PU. Assuming that the size of a particular CU is 2Nx2N, video encoder 200 may support PU sizes of 2Nx2N or NxN for intra prediction, and 2Nx2N, 2NxN, Nx2N, NxN, or similar symmetric PU sizes for inter prediction. The video encoder 200 and the video decoder 300 may also support asymmetric partitioning for PU sizes of 2NxnU, 2NxnD, nLx2N, and nRx2N for inter prediction.

In examples where the mode selection unit does not further partition a CU into PUs, each CU may be associated with a luma coding block and a corresponding chroma coding block. As described above, the size of a CU may refer to the size of the luma coding block of the CU. The video encoder 200 and the video decoder 300 may support CU sizes of 2Nx2N, 2NxN, or Nx 2N.

For other video coding techniques, such as intra-block copy mode coding, affine mode coding, and Linear Model (LM) mode coding, to name a few examples, mode selection unit 202 generates a prediction block for the current block being encoded via respective units associated with the coding techniques. In some examples (such as palette mode coding), mode selection unit 202 may not generate a prediction block, but instead generate a syntax element that indicates the manner in which a block is reconstructed based on the selected palette. In such a mode, mode selection unit 202 may provide these syntax elements to entropy encoding unit 220 for encoding.

As described above, the residual generation unit 204 receives video data for the current block and the corresponding prediction block. Then, the residual generating unit 204 generates a residual block for the current block. To generate the residual block, the residual generation unit 204 calculates a sample-by-sample difference between the prediction block and the current block.

Transform processing unit 206 applies one or more transforms to the residual block to generate a block of transform coefficients (referred to herein as a "transform coefficient block"). Transform processing unit 206 may apply various transforms to the residual block to form a block of transform coefficients. For example, the transform processing unit 206 may apply Discrete Cosine Transform (DCT), directional transform, Karhunen-Loeve transform (KLT), or conceptually similar transform to the residual block. In some examples, transform processing unit 206 may perform a variety of transforms on the residual block, e.g., a primary transform and a secondary transform (such as a rotational transform). In some examples, transform processing unit 206 does not apply a transform to the residual block.

The quantization unit 208 may quantize transform coefficients in a transform coefficient block to produce a quantized transform coefficient block. The quantization unit 208 may quantize transform coefficients of a transform coefficient block according to a Quantization Parameter (QP) value associated with the current block. Video encoder 200 (e.g., via mode selection unit 202) may adjust the degree of quantization applied to the transform coefficient block associated with the current block by adjusting the QP value associated with the CU. Quantization may cause information loss, and thus, the quantized transform coefficients may have a lower precision than the original transform coefficients generated by transform processing unit 206.

The inverse quantization unit 210 and the inverse transform processing unit 212 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficient block to reconstruct a residual block from the transform coefficient block. The reconstruction unit 214 may generate a reconstructed block (although potentially with some degree of distortion) corresponding to the current block based on the reconstructed residual block and the prediction block generated by the mode selection unit 202. For example, the reconstruction unit 214 may add samples of the reconstructed residual block to corresponding samples from the prediction block generated by the mode selection unit 202 to produce a reconstructed block.

The filter unit 216 may perform one or more filter operations on the reconstructed block. For example, filter unit 216 may perform deblocking operations to reduce blocking artifacts along edges of the CU. In some examples, the operation of the filter unit 216 may be skipped.

The video encoder 200 stores the reconstructed block in the DPB 218. For example, in an example in which operation of the filter unit 216 is not required, the reconstruction unit 214 may store the reconstructed block into the DPB 218. In examples where operation of the filter unit 216 is required, the filter unit 216 may store the filtered reconstructed block into the DPB 218. The motion estimation unit 222 and the motion compensation unit 224 may retrieve reference pictures formed of reconstructed (and potentially filtered) blocks from the DPB 218 to inter-predict blocks of subsequently encoded pictures. In addition, the intra-prediction unit 226 may intra-predict other blocks in the current picture using reconstructed blocks of the current picture in the DPB 218.

In general, entropy encoding unit 220 may entropy encode syntax elements received from other functional components of video encoder 200. For example, entropy encoding unit 220 may entropy encode the quantized transform coefficient block from quantization unit 208. As another example, entropy encoding unit 220 may entropy encode the prediction syntax elements (e.g., motion information for inter prediction or intra mode information for intra prediction) from mode selection unit 202. Entropy encoding unit 220 may perform one or more entropy encoding operations on syntax elements, which is another example of video data, to generate entropy encoded data. For example, entropy encoding unit 220 may perform a Context Adaptive Variable Length Coding (CAVLC) operation, a CABAC operation, a variable-variable (V2V) length coding operation, a syntax-based context adaptive binary arithmetic coding (SBAC) operation, a Probability Interval Partitioning Entropy (PIPE) coding operation, an exponential golomb encoding operation, or another type of entropy encoding operation on data. In some examples, entropy encoding unit 220 may operate in a bypass mode in which syntax elements are not entropy encoded.

According to techniques of this disclosure, which will be explained in more detail below, the entropy encoding unit 220 may be further configured to: one or more bins of a syntax element are encoded, the syntax element indicating the X or Y position of the last significant coefficient in the transform block. The last significant coefficient position is the position of the last non-zero transform coefficient along the coefficient scan order. The video decoder 300 may use the position of the last significant coefficient to determine where to start the reverse scan order of the transform coefficients in the transform block.

The entropy encoding unit 220 may be configured to: determining a syntax element indicating a position of a last significant coefficient in a transform block of a current block of video data; binarizing the syntax element into one or more bins; determining a respective context for each bin of the one or more bins of the syntax element indicating the position of the last significant coefficient using a function of the size of the transform block, wherein the function outputs the contexts such that the same context is not used for transform blocks having different sizes; and entropy encoding one or more bins of a syntax element indicating a position of a last significant coefficient using the determined context. As described above, by using output contexts such that the same context is not used for functions having transform blocks of different sizes, coding efficiency may be improved and/or the resulting decoded video data may exhibit less distortion as compared to techniques that reuse the same context between different block sizes.

In one example of the present disclosure, entropy encoding unit 220 may be configured to encode a 64x64 transform block. In this example, the entropy encoding unit 220 may be configured to determine, for a 64x64 transform block, a respective context for each bin of the one or more bins of the syntax element indicating the position of the last significant coefficient in the 64x64 transform block using a first function, wherein the first function is different from a second function used to determine the respective context for each bin of the one or more bins of the syntax element indicating the position of the last significant coefficient of the 32x32 transform block.

The video encoder 200 may output a bitstream that includes entropy encoded syntax elements needed for reconstructing blocks of a slice or picture. Specifically, the entropy encoding unit 220 may output a bitstream.

The above operations are described with respect to blocks. Such a description should be understood as an operation for a luma coding block and/or a chroma coding block. As described above, in some examples, the luma and chroma coding blocks are luma and chroma components of a CU. In some examples, the luma and chroma coding blocks are luma and chroma components of the PU.

In some examples, the operations performed with respect to luma coding blocks need not be repeated for chroma coding blocks. As one example, the operations for identifying Motion Vectors (MVs) and reference pictures for luma coding blocks need not be repeated to identify MVs and reference pictures for chroma blocks. Specifically, the MVs for the luma coding blocks may be scaled to determine MVs for chroma blocks, and the reference pictures may be the same. As another example, the intra prediction process may be the same for luma and chroma coded blocks.

Fig. 3 is a block diagram illustrating an example video decoder 300 that may perform the last significant coefficient decoding techniques of this disclosure. Fig. 3 is provided for purposes of explanation and is not intended to limit the technology broadly illustrated and described in this disclosure. For purposes of explanation, this disclosure describes video decoder 300 in terms of EVC, VVC, and HEVC techniques. However, the techniques of this disclosure may be performed by video coding devices configured for other video coding standards.

In the example of fig. 3, the video decoder 300 includes a Coded Picture Buffer (CPB) memory 320, an entropy decoding unit 302, a prediction processing unit 304, an inverse quantization unit 306, an inverse transform processing unit 308, a reconstruction unit 310, a filter unit 312, and a Decoded Picture Buffer (DPB) 134. Any or all of the CPB memory 320, entropy decoding unit 302, prediction processing unit 304, inverse quantization unit 306, inverse transform processing unit 308, reconstruction unit 310, filter unit 312, and DPB 134 may be implemented in one or more processors or in processing circuitry. Further, video decoder 300 may include additional or alternative processors or processing circuits to perform these and other functions.

The prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. The prediction processing unit 304 may include an addition unit that performs prediction according to other prediction modes. As an example, the prediction processing unit 304 may include a palette unit, an intra-block copy unit (which may form part of the motion compensation unit 316), an affine unit, a Linear Model (LM) unit, and the like. In other examples, video decoder 300 may include more, fewer, or different functional components.

The CPB memory 320 may store video data to be decoded by the components of the video decoder 300, such as an encoded video bitstream. For example, the video data stored in the CPB memory 320 may be obtained from the computer-readable medium 110 (fig. 1). The CPB memory 320 may include CPBs that store encoded video data (e.g., syntax elements) from an encoded video bitstream. Furthermore, the CPB memory 320 may store video data other than syntax elements of coded pictures, such as temporary data representing the output from various units of the video decoder 300. The DPB314 typically stores decoded pictures that the video decoder 300 may output and/or use as reference video data in decoding subsequent data or pictures of the encoded video bitstream. The CPB memory 320 and DPB314 may be formed from any of a variety of memory devices, such as Dynamic Random Access Memory (DRAM), including synchronous DRAM (sdram), magnetoresistive ram (mram), resistive ram (rram), or other types of memory devices. The CPB memory 320 and DPB314 may be provided by the same memory device or separate memory devices. In various examples, the CPB memory 320 may be on-chip with other components of the video decoder 300 or off-chip with respect to those components.

Additionally or alternatively, in some examples, video decoder 300 may retrieve the coded video data from memory 120 (fig. 1). That is, the memory 120 may utilize the CPB memory 320 to store data as discussed above. Also, when some or all of the functions of the video decoder 300 are implemented in software to be executed by processing circuitry of the video decoder 300, the memory 120 may store instructions to be executed by the video decoder 300.

The various elements shown in fig. 3 are shown to aid in understanding the operations performed by the video decoder 300. These units may be implemented as fixed function circuits, programmable circuits, or a combination thereof. Similar to fig. 2, fixed function circuitry refers to circuitry that provides a particular function and is pre-configured with respect to operations that may be performed. Programmable circuitry refers to circuitry that can be programmed to perform various tasks and provide flexible functionality in operations that can be performed. For example, the programmable circuitry may execute software or firmware that causes the programmable circuitry to operate in a manner defined by the instructions of the software or firmware. Fixed function circuitry may execute software instructions (e.g., to receive parameters or output parameters), but the type of operations performed by the fixed function circuitry is typically immutable. In some examples, one or more of the units may be different circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be integrated circuits.

The video decoder 300 may include an ALU, EFU, digital circuitry, analog circuitry, and/or a programmable core formed from programmable circuitry. In examples in which the operations of video decoder 300 are performed by software executing on programmable circuitry, on-chip or off-chip memory may store instructions (e.g., object code) of the software received and executed by video decoder 300.

The entropy decoding unit 302 may receive the encoded video data from the CPB and entropy decode the video data to reproduce the syntax elements. The prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, and the filter unit 312 may generate decoded video data based on syntax elements extracted from the bitstream.

In general, the video decoder 300 reconstructs pictures on a block-by-block basis. The video decoder 300 may perform a reconstruction operation on each block individually (wherein a block currently being reconstructed (i.e., decoded) may be referred to as a "current block").

Entropy decoding unit 302 may entropy decode syntax elements that define quantized transform coefficients of a quantized transform coefficient block and transform information such as a Quantization Parameter (QP) and/or a transform mode indication. Inverse quantization unit 306 may use the QP associated with the quantized transform coefficient block to determine a degree of quantization and, likewise, a degree of inverse quantization for application by inverse quantization unit 306. The inverse quantization unit 306 may, for example, perform a bitwise left shift operation to inverse quantize the quantized transform coefficients. The inverse quantization unit 306 may thus form a transform coefficient block comprising transform coefficients.

In accordance with techniques of this disclosure, which will be explained in more detail below, the entropy decoding unit 302 may be further configured to: one or more bins of a syntax element are decoded, the syntax element indicating an X or Y position of a last significant coefficient in a transform block. The last significant coefficient position is the position of the last non-zero transform coefficient along the scan order. Entropy decoding unit 302 may use the position of the last significant coefficient to determine where to start the reverse scan order of transform coefficients in a transform block.

The entropy decoding unit 302 may be configured to: entropy coded data for a current block of video data is received, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block. Entropy decoding unit 302 may determine a respective context for each bin of the one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient using a function of a size of a transform block, wherein the function outputs the respective context such that the same context is not used for transform blocks having different sizes; and decoding entropy coded data for a syntax element indicating a position of a last significant coefficient using the determined respective context. As described above, by using output contexts such that the same context is not used for one or more functions of transform blocks having different sizes, coding efficiency may be improved and/or the resulting decoded video data may exhibit less distortion as compared to techniques that reuse the same context between different block sizes.

In one example of the present disclosure, the entropy decoding unit 302 may be configured to decode a 64x64 transform block. In this example, the entropy decoding unit 302 may be configured to determine, for a 64x64 transform block, a respective context for each bin of the one or more bins for a syntax element indicating a position of a last significant coefficient in the 64x64 transform block using a first function, wherein the first function is different from a second function used to determine the respective context for each bin of the one or more bins for entropy coded data for the syntax element indicating a position of a last significant coefficient for the 32x32 transform block.

After inverse quantization unit 306 forms the transform coefficient block, inverse transform processing unit 308 may apply one or more inverse transforms to the transform coefficient block to generate a residual block associated with the current block. For example, the inverse transform processing unit 308 may apply an inverse DCT, an inverse integer transform, an inverse Karhunen-Loeve transform (KLT), an inverse rotation transform, an inverse direction transform, or another inverse transform to the transform coefficient block.

Also, the prediction processing unit 304 generates a prediction block according to the prediction information syntax element entropy-decoded by the entropy decoding unit 302. For example, if the prediction information syntax element indicates that the current block is inter-predicted, the motion compensation unit 316 may generate a prediction block. In this case, the prediction information syntax element may indicate the reference picture in the DPB314 from which the reference block is to be retrieved, and a motion vector that identifies the position of the reference block in the reference picture relative to the position of the current block in the current picture. The motion compensation unit 316 may generally perform the inter prediction process in a substantially similar manner as described with respect to the motion compensation unit 224 (fig. 2).

As another example, if the prediction information syntax element indicates that the current block is intra-predicted, the intra prediction unit 318 may generate the prediction block according to the intra prediction mode indicated by the prediction information syntax element. Again, intra-prediction unit 318 may generally perform the intra-prediction process in a substantially similar manner as described with respect to intra-prediction unit 226 (fig. 2). The intra prediction unit 318 may retrieve data of neighboring samples of the current block from the DPB 314.

The reconstruction unit 310 may reconstruct the current block using the prediction block and the residual block. For example, the reconstruction unit 310 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the current block.

The filter unit 312 may perform one or more filter operations on the reconstructed block. For example, the filter unit 312 may perform a deblocking operation to reduce blocking artifacts along the edges of the reconstructed block. The operation of the filter unit 312 is not necessarily performed in all examples.

The video decoder 300 may store the reconstructed block in the DPB 314. For example, in an example in which the operation of the filter unit 312 is not performed, the reconstruction unit 310 may store the reconstructed block to the DPB 314. In examples where the operations of the filter unit 312 are performed, the filter unit 312 may store the filtered reconstructed block to the DPB 314. As discussed above, the DPB314 may provide reference information (such as samples of a current picture for intra prediction and a previously decoded picture for subsequent motion compensation) to the prediction processing unit 304. Further, video decoder 300 may output the decoded pictures from the DPB for subsequent presentation on a display device, such as display device 118 of fig. 1.

The following is a description of the encoding/decoding of the last position in HEVC test model (HM) software, e.g., the X or Y position of the last significant (e.g., non-zero) coefficient in a transform unit/block. In this disclosure, a Transform Unit (TU) may generally refer to a block including any or all color components (e.g., YCbCr), while a transform block refers to a block of a specific color component. The "last" significant coefficient may be the last significant coefficient along the predefined scan pattern for the transform block. For example, the last significant coefficient position may be the position of the last non-zero transform coefficient along the forward scan pattern. The video decoder 300 may start a scanning process for a transform block along a reverse scan mode using the position of the last significant coefficient in the transform block when entropy decoding the transform block.

In one example, encoding the last position includes two parts: binarization and CABAC coding. Similarly, decoding the last position would include CABAC decoding followed by inverse binarization. The binarization process converts the position of the last significant coefficient (e.g., the X or Y position) into a binary string. The binarization method used in HM is truncated unary-reinforced fixed length coding. For truncated unary code portions (e.g., prefixes), the bins are encoded using CABAC contexts (e.g., probability models). For fixed length parts (e.g., suffixes), the bins are encoded using a bypass mode (e.g., no context). The techniques of this disclosure relate to determining a context for use in encoding/decoding a bin of a truncated unary code prefix syntax element. Example binarization for a 32x32 TU (transform unit/transform block) is shown in table I below.

Table 1: binarization for TU 32x32

The context index ctxInc for the prefix syntax element in HEVC (e.g., an index specifying a particular context to be used for a bin) is defined in clause 9.3.4.2.3 referenced below:

derivation procedure for ctxInc for syntax elements last _ sig _ coeff _ x _ prefix and last _ sig _ coeff _ y _ prefix

The inputs to this process are the variable binIdx, the color component index cIdx, and the transform block size log2 TrafoSize.

The output of this process is the variable ctxInc.

The variables ctxOffset and ctxShift are derived as follows:

-if cIdx is equal to 0, setting ctxOffset equal to 3 × (log2TrafoSize-2) + ((log2TrafoSize-1) > >2), and setting ctxShift equal to (log2TrafoSize +1) > > 2.

Else (cIdx is greater than 0), ctxOffset is set equal to 15, and ctxShift is set equal to log2 TrafoSize-2.

The variable ctxInc is derived as follows:

ctxInc=(binIdx>>ctxShift)+ctxOffset(9-25)

in the above section of HEVC, the prefix syntax elements for the X and Y positions of the last significant coefficient position are last _ sig _ coeff _ X _ prefix and last _ sig _ coeff _ Y _ prefix. The variable binIdx indicates the bin being decoded. For example, as shown in table I, the last significant coefficient position of size 3 is represented by 4 bits in a truncated unary model prefix (e.g., last _ sig _ coeff _ x _ prefix or last _ sig _ coeff _ y _ prefix). These 4 bits are decoded into 4 different bins (e.g., bin 0, bin 1, bin 2, bin 3). The variable binIdx specifies for which of these bins the video encoder 200 and the video decoder 300 will determine the context.

The variable cIdx is an index that specifies a color component. For example, cIdx equals zero specifies the luma (Y) component, while cIdx is greater than zero specifies one of the Cr or Cb chroma components. The transform block size (e.g., one-dimensional) is specified by the variable log2 TrafoSize. For example, a 4x4 transform block will have a log2TrafoSize of 2 because the base 24 logarithm is 2. The 32x32 transform block will have a log2TrafoSize of 5 because the base 2 logarithm of 32 is 5.

The context (ctxInc) output from the above function is based on a context offset (ctxOffset) and a context drift (ctxShift), which are derived as functions of the color component (cIdx) and the transform block size (log2 TrafoSize). For example, for a luminance component (i.e., cIdx ═ 0), ctxOffset and ctxShift are determined as follows:

if cIdx is equal to 0, ctxOffset is set equal to 3 × (log2TrafoSize-2) + ((log2TrafoSize-1) > >2), and ctxShift is set equal to (log2TrafoSize +1) > > 2.

Operator > > is a logical right shift. Then, the context (ctxInc) is determined using ctxOffset, ctxShift, and binIdx as follows:

ctxInc=(binIdx>>ctxShift)+ctxOffset

the above-described function for determining the context of the bins for last _ sig _ coeff _ x _ prefix and/or last _ sig _ coeff _ y _ prefix effectively yields the following derivation:

table II luminance last _ significant _ coeff _ X _ prefix context assignment (setting a)

However, with the introduction of large transform sizes in next generation video codecs (e.g., VVC and EVC), the functions specified above for determining the context of bins for last _ sig _ coeff _ x _ prefix and last _ sig _ coeff _ y _ prefix do not provide a consistent pattern for transform sizes greater than 32. See, for example, table III below, which includes unintentionally shared context indices (bold and underlined) between different bins of different TU sizes. Reusing the same context for different bins between different transform sizes may effectively result in lower coding efficiency due to poor context adaptation. This is because the context is a probabilistic model of the occurrence of a 1 or 0 in a particular bin. A bin 6 or a bin 7 of the last significant coefficient position of a 32x32 TU (or transform block) will typically have a very different probability of being 0 or 1 compared to a bin 0 or a bin 1 of a 64x64 TU. Thus, reusing contexts between different transform sizes may result in lower coding efficiency and/or increased distortion.

TABLE III luminance last _ significant _ coeff _ X _ prefix context assignment (Note full binarization for TU64X 64)

In view of the above-identified deficiencies in context derivation for large transform block sizes, this disclosure describes techniques for determining a context for a bin of a context-coded syntax element that indicates the location of the last significant coefficient (e.g., last _ sig _ coeff _ x _ prefix and last _ sig _ coeff _ y _ prefix). In one example of the present disclosure, video encoder 200 and video decoder 300 may be configured to use another function (e.g., a different function than that used in HEVC) to derive a context index for a bin in last position coding, such that there is no problem of inadvertently sharing the context index. In an example of the present disclosure, a "function" used to derive a context index may include a plurality of sub-functions, where each sub-function may be for a transform block having a different size. For example, the video encoder 200 and the video decoder 300 may be configured to use a function of a size of a transform block to derive contexts for one or more bins of a syntax element that indicates a location of a last significant coefficient of the transform block (e.g., last _ significant _ coeff _ X _ prefix, last _ significant _ coeff _ Y _ prefix), wherein the function outputs contexts such that the same context is not used for transform blocks having different sizes.

In one example, video encoder 200 and video decoder 300 may be configured to use the following derivation of a context for bins for the syntax elements last _ sig _ coeff _ x _ prefix and last _ sig _ coeff _ y _ prefix. An example of context derivation in accordance with the techniques of this disclosure is shown below. The following part of the context derivation assists in ensuring that the context index is not inadvertently shared between transform block sizes. These parts are shown in bold and italics between the tags < add > and </add >. For example, the example context derivation techniques are examples of functions that the video encoder 200 or the video decoder 300 uses to determine contexts that are not the same for transform blocks having different sizes.

Derivation procedure for ctxInc for syntax elements last _ sig _ coeff _ x _ prefix and last _ sig _ coeff _ y _ prefix

The inputs to this process are the variable binIdx, the color component index cIdx, and the transform block size log2 TrafoSize.

The output of this process is the variable ctxInc.

If cIdx is equal to 0, the variables ctxOffset and ctxShift are derived as follows:

- < Add > if log2 TrafSizeX is less than or equal to 5< Add >, ctxOffset is set equal to 3 (log2 TrafSizeX-2) + ((log2 TrafSizeX-1) > >2), and ctxShift is set equal to (log2 TrafSizeX +1) > >2, where the variable log2 TrafSizeX is equal to log2 TrafSizeWidth used to derive the context for sig _ coeff _ x _ prefix and is equal to log2 TrafSizeHeight used to derive the context for sig _ coeff _ y _ prefix.

Else if (log2TrafoSizeX is greater than 5) </add >, ctxOffset is set equal to 3 (log2TrafoSizeX-2) + ((log2TrafoSizeX-1) > >2) + < add > ((TrafoSizeX > >6) < <1) + (TrafoSizeX > >7) </add >, and ctxShift is set equal to (log2TrafoSizeX +1) > >2, where the variable log2TrafoSizeX is equal to log2 trafoswidth used to derive the context for sig _ coeff _ x _ prefix and equal to log2 trafossizehigh used to derive the context for sig _ coeff _ y _ prefix.

Otherwise (cIdx is greater than 0), ctxOffset is set equal to 25, and ctxShift is set equal to log2 TrafSizeX- < Add > 2-log 2 (TrafSizeX > >4), where the variable TrafSizeX is equal to TrafSizeWidth for sig _ coeff _ x _ prefix and equal to TrafSizeHeight for sig _ coef _ y _ prefix. [ addition ]

In the above equation, log2 trafossizewidth is the logarithm of the base-2 transform block width, and log2 trafossizeheight is the logarithm of the base-2 transform block height. As indicated above, the clause stating "if log2TrafoSizeX is less than or equal to 5" is a function (or a sub-function of a function) for determining a context for transform blocks and/or TUs (e.g., 32x32 TU, 32x16 TU, 16x32 TU, etc.) that are less than or equal to 32 in a particular dimension. A clause stating "otherwise (if log2TrafoSizeX is greater than 5)" is a different function (or a different sub-function of functions) used to determine context for transform blocks and/or TUs greater than 32 in a particular dimension (e.g., 64x64 TU, 32x64 TU, 64x32 TU, etc.).

Among the functions defined above, for transform blocks having a particular dimension less than or equal to 32, video encoder 200 and video decoder 300 are configured to determine ctxOffset using the function 3 × (log2TrafoSizeX-2) + ((log2TrafoSizeX-1) > > 2). This function for ctxOffset can be generally described as having a scaling and an offset. For example, the function may be generally described as a size + (b size), where a size (log2TrafoSizeX-2) is the scaling and b size ((log2TrafoSizeX-1) > >2) is the offset.

For transform blocks having a particular dimension (e.g., 64) greater than 32, video encoder 200 and video decoder 300 are configured to determine ctxOffset using the function 3 × (log2TrafoSizeX-2) + ((log2TrafoSizeX-1) > >2) + ((TrafoSizeX > >6) < <1) + (TrafoSizeX > > 7). That is, for transform blocks having a particular dimension (e.g., 64) greater than 32, the function used to determine the context offset may be a combination of linear and non-linear operations in the form of scaling, offset, and size-dependent offset with bit shifting and clipping. For example, the function may be generally described as a size + (b size 2+ c (size)) + d (size). In this example, a and b are the same as defined above, and c (size) is (TrafoSizeX > >6) < <1 and d (size) is (TrafoSizeX > > 7). The c (size) and d (size) portions of the function can be viewed as having a size dependent offset of bit shift and clipping and are non-linear portions of the function.

Table IV below shows the segments of context indices (incomplete result of TU64x 64) for different TU block sizes, without sharing context indices of different bins.

Table IV luminance last _ significant _ coeff _ X _ prefix context assignment (setting a)

In view of the above, video decoder 300 (e.g., entropy decoding unit 302 of fig. 3) may be configured to determine a context for entropy decoding a bin of a syntax element indicating a position of a last significant coefficient using one or more of the following techniques. Although described with reference to video decoder 300, it should be understood that video encoder 200 (e.g., entropy encoding unit 220 of fig. 2) may also be configured to perform a reciprocity technique for determining a context for entropy encoding a bin of a syntax element indicating a position of a last significant coefficient.

In one example of the present disclosure, the video decoder 300 may be configured to receive entropy coded data for a current block of video data, wherein the entropy coded data includes entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block. For example, the entropy coded data for the syntax element indicating the position of the last significant coefficient in the transform block may be an entropy coded bin of a last _ sig _ coeff _ x _ prefix syntax element and/or a last _ sig _ coeff _ y _ prefix syntax element.

The video decoder 300 may also be configured to determine a respective context for each bin of the one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient using a function of a size of the transform block. That is, video decoder 300 determines a context for each bin in the entropy coded bins for the received syntax element. As shown in table I, different numbers of bins may be used to decode different sizes of the last location. The video decoder 300 determines a context for each of the bins. In accordance with the techniques of this disclosure, the function used by video decoder 300 to determine the respective context (which may include different sub-functions depending on the size of the transform block) outputs the respective context such that the same context is not used for transform blocks having different sizes. The video decoder 300 may then use the determined respective context to decode entropy coded data for a syntax element indicating a position of a last significant coefficient.

In one example, video decoder 300 may be configured to entropy decode entropy coded data for a 64-sample dimensional transform block. That is, the transform block has a size of 64 samples in the height and/or width of the block. For example, video decoder 300 may determine a context for a last _ sig _ coeff _ x _ prefix syntax element for a transform block having a width of 64 samples. Similarly, video decoder 300 may determine a context for a last _ sig _ coeff _ y _ prefix syntax element for a transform block having a height of 64 samples.

In this example, video decoder 300 may be configured to determine, using a first function, for a 64-sample dimensional transform block, a respective context for each bin of the one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient. In the example derivation above, the first function for a 64-sample dimension transform block is as follows:

ctxOffset is set equal to 3 × (log2TrafoSizeX-2) + ((log2TrafoSizeX-1) > >2) + ((TrafoSizeX > >6) < <1) + (TrafoSizeX > >7), and ctxShift is set equal to (log2TrafoSizeX +1) > >2, where the variable log2TrafoSizeX is equal to log2 trafosizevidwidth used to derive the context for sig _ coeff _ x _ prefix and is equal to log2 trafosizheight used to derive the context for sig _ coeff _ y _ prefix.

The video decoder 300 may then determine the particular context (ctxInc) for the corresponding bin using the following equation:

ctxInc=(binIdx>>ctxShift)+ctxOffset

in this example, the first function for the 64-sample dimensional transform block is different from a second function for determining a respective context for each bin of the one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient for the 32-sample dimensional transform block. In the example above, the second function for the 32-sample dimension transform block is as follows:

ctxOffset is set equal to 3 × (log2TrafoSizeX-2) + ((log2TrafoSizeX-1) > >2) and ctxShift is set equal to (log2TrafoSizeX +1) > >2, where the variable log2TrafoSizeX is equal to log2 trafosizeiwidth used to derive the context for sig _ coeff _ x _ prefix and is equal to log2 trafosizeiheight used to derive the context for sig _ coef _ y _ prefix.

Again, the video decoder 300 may then determine the particular context (ctxInc) for the corresponding bin using the following equation:

ctxInc=(binIdx>>ctxShift)+ctxOffset

of course, video decoder 300 may be configured to use different functions for 32-sample dimension and 64-sample dimension transform blocks in accordance with the techniques of this disclosure, as long as the functions output respective contexts such that the same context is not used for transform blocks having different sizes.

As can be seen from the above functions and equations, to determine a respective context for each bin of the one or more bins of entropy coded data for the syntax element indicating the position of the last significant coefficient using a function of the size of the transform block, video decoder 300 may be configured to determine a respective context offset (ctxOffset) and a respective context offset (ctxShift) using a function of the size of the transform block and the color component index, and to determine a respective context for a respective bin of the one or more bins using a bin index (binIdx) for the respective bin, the respective context offset, and the respective context shift.

Referring back to table I, the syntax element entropy decoded by the video decoder 300 according to the techniques of this disclosure is one of a first prefix syntax element (e.g., sig _ coeff _ X _ prefix) indicating the X-position of the last significant coefficient or a second prefix syntax element (e.g., sig _ coeff _ Y _ prefix) indicating the Y-position of the last significant coefficient. Thus, to decode entropy coded data for syntax elements indicating the position of the last significant coefficient using the determined respective contexts, video decoder 300 may be configured to decode entropy coded data for both the first prefix syntax element and the second prefix syntax element using the determined respective contexts.

Given that the sig _ coeff _ X _ prefix and sig _ coeff _ Y _ prefix syntax elements are prefix syntax elements, video decoder 300 may be further configured to decode the corresponding suffix syntax elements using fixed length decoding (e.g., the fixed binary portion of table I) corresponding to each of the sig _ coeff _ X _ prefix and sig _ coeff _ Y _ prefix syntax elements and inverse binarize the prefix syntax elements and the first suffix syntax elements to obtain the location (e.g., X or Y position) of the last significant coefficient in the transform block.

As described above, video decoder 300 may then use the determined respective context to decode entropy coded data for a syntax element indicating the position of the last significant coefficient. For example, the video decoder 300 may decode a transform block based on the location of the last significant coefficient to obtain transform coefficients, apply an inverse transform to the transform coefficients to obtain a residual block, perform a prediction process (e.g., inter-prediction or intra-prediction) for the current block to obtain a prediction block, and add the residual block to the prediction block to obtain a decoded block of video data.

The following is another example of context derivation. In the following example derivation, video encoder 200 and video decoder 300 may use one function for transform blocks having a 32 sample dimension or less (if log2TrafoSizeX is less than or equal to 5), another function for transform blocks having a 64 sample dimension (otherwise (if log2TrafoSizeX is equal to 6)), and yet another function for transform blocks having a 128 sample dimension (otherwise (if log2TrafoSizeX is equal to 7)). Again, the portions of the following context derivation that help to ensure that the context index is not inadvertently shared are shown in bold italics between the tags < Add > and </Add >.

If cIdx is equal to 0, the variables ctxOffset and ctxShift are derived as follows:

< Add > if log2 TrafSizeX is less than or equal to 5< Add >, ctxOffset is set equal to 3 (log2 TrafSizeX-2) + ((log2 TrafSizeX-1) > >2) and ctxShift is set equal to (log2 TrafSizeX +1) > >2, where the variable log2 TrafSizeX is equal to log2 TrafSizeWidth used to derive the context for sig _ coeff _ x _ prefix and is equal to log2 TrafSizeHeight used to derive the context for sig _ coeff _ y _ prefix.

Else if (log2TrafoSizeX equals 6) </add >, ctxOffset equal to 3 (log2TrafoSizeX-2) + ((log2TrafoSizeX-1) > >2) +2, and ctxShift is set equal to (log2TrafoSizeX +1) > >2, where the variable log2TrafoSizeX is equal to log2TrafoSizeWidth used to derive the context for sig _ coeff _ x _ prefix and is equal to log2 trafosizheight used to derive the context for sig _ coeff _ y _ prefix.

Else if (log2TrafoSizeX equals 7) </add >, ctxffset is set equal to 3 (log2TrafoSizeX-2) + ((log2TrafoSizeX-1) > >2) +5, and ctxShift is set equal to (log2TrafoSizeX +1) > >2, where the variable log2TrafoSizeX is equal to log2TrafoSizeWidth used to derive the context for sig _ coeff _ x _ prefix and is equal to log2 trafosizheight used to derive the context for sig _ coeff _ y _ prefix.

Otherwise (cIdx is greater than 0), ctxOffset is set equal to 25, and ctxShift is set equal to log2 TrafSizeX- < add > 2-log 2 (TrafSizeX > >4), where the variable TrafSizeX is equal to TrafSizeWidth used to derive the context for sig _ coeff _ x _ prefix and is equal to TrafSizeheight used to derive the context for sig _ coef _ y _ prefix. [ addition ]

Thus, in another example of the present disclosure, the transform block for the current block is a 128-sample dimensional transform block. In this example, to determine a respective context for each bin of the one or more bins of entropy coded data for the syntax element indicating the position of the last significant coefficient using a function of the size of the transform block, video decoder 300 may be configured to determine a respective context for each bin of the one or more bins of entropy coded data for the syntax element indicating the position of the last significant coefficient using a first function for the 128-sample dimensional transform block. In this example, the first function is different from the second function for determining, for a 64-sample dimensional transform block, a respective context for each bin of the one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient, and the first function is different from the third function for determining, for a 32-sample dimensional transform block, a respective context for each bin of the one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient.

In view of the above, in one example of the present disclosure, the video decoder 300 may be configured to: receiving entropy coded data for a current block of video data, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block; determining contexts for one or more bins of entropy coded data for syntax elements indicating positions of last significant coefficients using a function of a size of a transform block, wherein the function outputs the contexts such that the same contexts are not used for transform blocks having different sizes; and decoding entropy coded data for a syntax element indicating a position of a last significant coefficient using the determined context.

In one example, the function is also based on a bin index and a color component index.

Likewise, the video encoder 200 may be configured to: determining a syntax element indicating a position of a last significant coefficient in a transform block of a current block of video data; binarizing the syntax element into one or more bins; determining a context of one or more bins for a syntax element indicating a position of a last significant coefficient using a function of a size of a transform block, wherein the function outputs the context such that the same context is not used for transform blocks having different sizes; and entropy encoding one or more bins of a syntax element indicating a position of a last significant coefficient using the determined context.

In one example, the function is also based on a bin index and a color component index.

FIG. 4 is a flow diagram illustrating an example method for encoding a current block. The current block may include a current CU. Although described with respect to video encoder 200 (fig. 1 and 2), it should be understood that other devices may be configured to perform methods similar to those of fig. 4.

In this example, the video encoder 200 initially predicts the current block (350). For example, the video encoder 200 may form a prediction block for the current block. The video encoder 200 may then calculate a residual block for the current block (352). To calculate the residual block, the video encoder 200 may calculate the difference between the original, unencoded block and the prediction block for the current block. The video encoder 200 may then transform and quantize the transform coefficients of the residual block (354). Next, video encoder 200 may scan the quantized transform coefficients of the residual block (356). During or after scanning, video encoder 200 may entropy encode the coefficients and other syntax elements (358). For example, video encoder 200 may encode the coefficients using CAVLC or CABAC. As one example, video encoder 200 may determine the context of one or more bins for a syntax element indicating the position of the last significant coefficient using the example techniques described in this disclosure. Additional details are depicted in fig. 5. The video encoder 200 may then output entropy encoded data for the block (360).

Fig. 5 is a flow chart illustrating an example entropy encoding method. FIG. 5 illustrates aspects of the process 358 of FIG. 4 in more detail. The video encoder 200 may be configured to: a syntax element indicating a position of a last significant coefficient in a transform block of a current block of video data is determined (500), and the syntax element is binarized into one or more bins (502). The video encoder 200 may be further configured to: a respective context for each bin of the one or more bins of the syntax element indicating the position of the last significant coefficient is determined using a function of the size of the transform block, wherein the function outputs the contexts such that the same context is not used for transform blocks having different sizes (504). Video encoder 200 may then entropy encode one or more bins of a syntax element indicating the position of the last significant coefficient using the determined respective context (506).

FIG. 6 is a flow diagram illustrating an example method for decoding a current block of video data. The current block may include a current CU. Although described with respect to video decoder 300 (fig. 1 and 3), it should be understood that other devices may be configured to perform methods similar to those of fig. 6.

The video decoder 300 may receive entropy coded data for the current block (such as entropy coded prediction information and entropy coded data for coefficients of a residual block corresponding to the current block) (370). The video decoder 300 may entropy decode the entropy coded data to determine prediction information for the current block and reproduce coefficients of the residual block (372). As one example, video decoder 300 may use example techniques described in this disclosure to determine the context of one or more bins for a syntax element indicating the position of the last significant coefficient.

The video decoder 300 may predict the current block (374), e.g., calculate a prediction block for the current block using an intra or inter prediction mode indicated by prediction information for the current block. The video decoder 300 may then inverse scan the reproduced coefficients (376) to create blocks of quantized transform coefficients. The video decoder 300 may then inverse quantize and inverse transform the coefficients to produce a residual block (378). Finally, the video decoder 300 may decode the current block by combining the prediction block and the residual block (380).

Fig. 7 is a flowchart illustrating an example entropy decoding method. FIG. 7 illustrates aspects of process 372 of FIG. 6 in more detail.

For example, the video decoder 300 may be configured to: entropy coded data for a current block of video data is received, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block (700). The video decoder 300 may determine a respective context for each bin of the one or more bins of entropy coded data for a syntax element indicating a position of a last significant coefficient using a function of a size of a transform block, wherein the function outputs the respective context such that the same context is not used for transform blocks having different sizes (702). Video decoder 300 may then decode entropy coded data for the syntax element indicating the position of the last significant coefficient using the determined respective context (704).

The following are additional illustrative examples of the present disclosure.

Example 1-a method of decoding video data, the method comprising: receiving entropy coded data for a current block of video data, wherein the entropy coded data comprises entropy coded data for a syntax element indicating a position of a last significant coefficient in a transform block of the current block; determining contexts for one or more bins of the syntax element indicating the position of the last significant coefficient using a function of a size of the transform block, wherein the function outputs the contexts such that the same contexts are not used for transform blocks having different sizes; and decoding the entropy coded data for a syntax element indicating the position of the last significant coefficient using the determined context.

Example 2-the method of example 1, wherein the function is further based on a bin index and a color component index.

Example 3-a method of encoding video data, the method comprising: determining a syntax element indicating a position of a last significant coefficient in a transform block of a current block of video data; binarizing the syntax element into one or more bins; determining contexts for the one or more bins of the syntax element indicating the position of the last significant coefficient using a function of a size of the transform block, wherein the function outputs the contexts such that the same contexts are not used for transform blocks having different sizes; and entropy encoding the one or more bins of the syntax element indicating the position of the last significant coefficient using the determined context.

Example 4-the method of example 3, wherein the function is further based on a bin index and a color component index.

Example 5-an apparatus for coding video data, the apparatus comprising one or more units for performing the method according to any one of examples 1-4.

Example 6-the apparatus of example 5, wherein the one or more means comprise one or more processors implemented in circuitry.

Example 7-the apparatus of any one of examples 5 and 6, further comprising: a memory for storing the video data.

Example 8-the apparatus of any of examples 5-7, further comprising: a display configured to display the decoded video data.

Example 9-the device of any of examples 5-8, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

Example 10-the apparatus of any of examples 5-9, wherein the apparatus comprises a video decoder.

Example 11-the apparatus of any of examples 5-10, wherein the apparatus comprises a video encoder.

Example 12-a computer-readable storage medium having instructions stored thereon that, when executed, cause one or more processors to perform the method of any of examples 1-4.

It is to be appreciated that, according to an example, certain acts or events of any of the techniques described herein can be performed in a different order, added, combined, or omitted entirely (e.g., not all described acts or events are necessary for the practice of the techniques). Further, in some examples, actions or events may be performed concurrently, e.g., through multi-threaded processing, interrupt processing, or multiple processors, rather than sequentially.

In one or more examples, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media corresponding to tangible media such as data storage media or communication media including any medium that facilitates transfer of a computer program from one place to another, e.g., according to a communication protocol. In this manner, the computer-readable medium may generally correspond to (1) a non-transitory tangible computer-readable storage medium, or (2) a communication medium such as a signal or carrier wave. The data storage medium can be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, code and/or data structures for implementing the techniques described in this disclosure. The computer program product may include a computer-readable medium.

By way of example, and not limitation, such computer-readable storage media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer-readable medium. For example, if the instructions are transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. It should be understood, however, that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but are instead directed to non-transitory, tangible storage media. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.

The instructions may be executed by one or more processors, such as one or more Digital Signal Processors (DSPs), general purpose microprocessors, an Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Accordingly, the terms "processor" and "processing circuitry" as used herein may refer to any of the foregoing structure or any other structure suitable for implementation of the techniques described herein. In addition, in some aspects, the functionality described herein may be provided within dedicated hardware and/or software modules configured for encoding and decoding, or incorporated into a combined codec. Furthermore, the techniques may be implemented entirely within one or more circuits or logic elements.

The techniques of this disclosure may be implemented in a wide variety of devices or apparatuses, including a wireless handset, an Integrated Circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this disclosure to emphasize functional aspects of devices configured to perform the disclosed techniques, but do not necessarily require implementation by different hardware units. Rather, as noted above, the various units may be combined in a codec hardware unit, or provided by a collection of interoperable hardware units (including one or more processors as noted above) in conjunction with appropriate software and/or firmware.

Various examples have been described. These and other examples are within the scope of the following claims.

39页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于历史的运动矢量预测

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类