Coding method, system and device for AVS3 sample value adaptive offset filtering

By offsetting the SAO filtering calculation range using adjacent block pixels, the method addresses data dependency issues, reducing hardware storage and enhancing encoding speed in AVS3 encoding.

CN119232929APending Publication Date: 2024-12-31绍兴市北大信息技术科创中心
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411169910.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing sample adaptive offset filtering in AVS3 encoding relies on pixels that have not yet been generated, leading to high hardware storage requirements and reduced filtering speed due to data dependency.

Method used

The method involves offsetting the calculation range of SAO filtering by using pixels from adjacent blocks, reducing the need for caching ungenerated pixels and eliminating data dependency.

Benefits of technology

This approach reduces hardware storage needs and enhances encoding speed by caching only necessary pixels, allowing real-time processing with improved efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232929A_ABST
    Figure CN119232929A_ABST
Patent Text Reader

Abstract

The method comprises the following steps: acquiring A * A pixel blocks generated in a deblocking filtering process; shifting and expanding the A * A pixel block at the current position into a (A + n) * (A + n) pixel block, and segmenting the (A + n) * (A + n) pixel block into m B * B pixel blocks; a * A pixel blocks which are not subjected to offset expansion are divided into m C * C pixel blocks, SAO filtering processing is carried out on the C * C pixel blocks, and for each C * C pixel block, a to-be-processed block is formed by the C * C pixel block according to the rightmost n columns of pixels of the left adjacent block and the lowermost n rows of pixels of the upper adjacent block; performing SAO filtering calculation on the to-be-processed block, referring to pixels in the B * B pixel block during SAO filtering calculation, and filtering a C * C pixel block with a filtering range of n pixels deviated from the upper left of the original position; and carrying out demigration operation, and outputting the effective SAO filtering pixel according to the real LCU position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image and video data compression processing, in particular to an encoding method, system and device for AVS3 sample value adaptive offset filtering. Background Art

[0002] The loop filter includes two parts: deblocking filter (DeblockFilter, DBK) and sample adaptive offset. The sample adaptive process is divided into three parts: statistics, decision and filtering calculation. The sample adaptive offset (SampleAdaptiveOffset, SAO) coding mode in the AVS3 phase 1 standard includes two major categories: sideband offset (BandOffset, BO) and edge offset (EdgeOffset, EO). The EO mode includes four filtering directions of 0 degrees, 90 degrees, 45 degrees and 135 degrees.

[0003] Taking the AVS3 encoder as an example, the process of sample adaptive offset filtering includes the following steps: 1. Obtain the deblocking filter pixel at the current position: SAO filtering needs to complete the reconstruction pixel of deblocking filtering. The complete deblocking filtering process includes horizontal filtering and vertical filtering. When the current position is processed to the boundary pixel, the next LCU data to be encoded has not yet been generated. Some pixels can only complete one of horizontal filtering or vertical filtering. Therefore, SAO filtering can only process pixels after the complete execution of deblocking filtering. 2. Obtain the SAO filter parameters to be executed: During the encoding process, the SAO filter mode needs to count and decide the pixel situation of the entire LCU based on the reconstructed pixels that have not been loop filtered, calculate the code of the corresponding mode, and finally output an optimal mode with the lowest cost and its corresponding offset value. 3. Obtain the reference pixels required for the corresponding mode: According to the provisions of the AVS3 codec standard, BO mode filtering does not require surrounding reference pixels; in EO mode, each pixel to be filtered requires different reference pixels in the filtering mode at different angles, such as 0 degrees requires 2 pixels on the left and right of the current pixel to be filtered, and 90 degrees requires 2 pixels above and below. 4. Perform SAO filter calculation: After obtaining the corresponding SAO filter mode and the pixels to be filtered at the corresponding position and the required reference pixels, you can start to perform sample adaptive offset filter calculation on the current LCU.

[0004] In summary, since the sample adaptive offset filter calculation of each pixel needs to rely on the surrounding reference pixels to perform calculations, there is data dependency between different deblocking filter blocks and different encoding LCUs, and in certain modes, it is necessary to rely on pixels that have not yet been generated. In order to ensure the encoding speed, a large number of pixel caches and waiting cycles are used in the real-time hardware encoding system to obtain the pixels required for the filtering calculation. The traditional sample adaptive filtering calculation method occupies extremely high hardware storage resources, and in order to wait for pixels that have not yet been generated, the overall filtering calculation speed is reduced. Summary of the invention

[0005] The present invention aims to solve the problem that the existing sample adaptive filtering calculation needs to rely on pixels that have not yet been generated, and thus uses a large number of pixel buffers.

[0006] The present invention provides an encoding method, system and device for AVS3 sample value adaptive offset filtering.

[0007] A coding method for AVS3 sample adaptive offset filtering, comprising:

[0008] Step 1: Get the pixel block of size A*A and SAO filter parameters generated in the deblocking filter process;

[0009] Step 2: Offset extension: For the pixel block of size A*A at the current position, according to the rightmost n columns of pixels of its left adjacent block and the bottom n rows of pixels of its upper adjacent block, which form a pixel block of size (A+n)*(A+n), the pixel block of size (A+n)*(A+n) is divided into m pixel blocks of size B*B;

[0010] Step 3: Divide the pixel block of size A*A that has not been offset and expanded into m pixel blocks of size C*C, perform SAO filtering on the pixel blocks of size C*C, and for each pixel block of size C*C, combine the rightmost n columns of pixels of its left adjacent block and the bottom n rows of pixels of its upper adjacent block with the pixels to be processed;

[0011] Step 4: Perform SAO filter calculation on the block to be processed. The SAO filter calculation refers to the pixels in the pixel block of size B*B, and the filtering range is the pixel block of size C*C with a left upper offset of n pixels from the original position.

[0012] Step 5: Perform a de-biasing operation and output the valid SAO filtered pixels according to the actual LCU position.

[0013] Preferably, in step 2, for the pixel block of size A*A at the current position, the pixel block of size (A+n)*(A+n) is divided into m pixel blocks of size B*B based on the rightmost column of pixels of its left adjacent block and the bottom row of pixels of its upper adjacent block, which form a pixel block of size (A+n)*(A+n).

[0014] Preferably, the pixel block of size A*A that has not been offset and expanded is divided into m pixel blocks of size C*C, and the pixel blocks of size C*C are subjected to SAO filtering processing. For each pixel block of size C*C, a block to be processed is formed with the pixel block based on the rightmost column of pixels of its left adjacent block and the bottommost row of pixels of its upper adjacent block.

[0015] Preferably, in step 1, the pixel block of size A*A does not include the leftmost and bottommost m columns and m rows of pixels in the LCU that is not the rightmost and bottommost of the current frame.

[0016] Preferably, in step 1, the filtering parameters include the best SAO mode of the current LCU to be filtered and its corresponding offset.

[0017] Preferably, in step 4, a sliding window is constructed, and the valid pixel range is determined according to the position of the current pixel block of size C*C in the LCU and the current frame, and the valid pixels are filled into the sliding window. When each row is filled with pixels, the SAO filtered pixels are output according to their corresponding positions in the original LCU.

[0018] Preferably, the filling position is the position of the current pixel in a pixel block of size A*A that is offset by 1 pixel to the upper left.

[0019] A coding system for AVS3 sample adaptive offset filtering, comprising:

[0020] A pre-stage deblocking filter module generates a pixel block of size A*A after deblocking filtering; a register module is used to store the pixels of the pixel block of size A*A at each original position that do not participate in SAO filtering; an offset module is used to expand the pixel block of size A*A to a pixel block of size (A+n)*(A+n); a truncation module is used to truncate the pixel block of size (A+n)*(A+n) into m pixel blocks of size B*B; and a sliding window module is used to perform a de-offset operation.

[0021] An encoding device for AVS3 sample adaptive offset filtering includes a storage device and a processing device, wherein the storage device is used to store the program of the encoding method of the AVS3 sample adaptive offset filtering, and the processing device is used to execute the aforementioned program.

[0022] Compared with the prior art, the present invention has the following advantages and effects:

[0023] The present invention utilizes the algorithm characteristics of AVS3 sample value adaptive offset filtering to offset the calculation range of SAO filtering. The offset filtering calculation does not depend on pixels that do not exist at the current moment, thus eliminating data dependency. It only needs to cache column pixels and row pixels of the current processing block that have not been filtered, thereby reducing the overall hardware storage resource area and improving the encoding filtering speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0025] Figure 1 This is a schematic diagram of the existing sample adaptive offset filter coding process

[0026] Figure 2 Schematic diagram of the sample adaptive offset filtering method in the present invention

[0027] Figure 3 It is the hardware structure used by the sample adaptive offset filtering in the present invention.

[0028] Figure 4 The figure is a comparison table of the present invention and the existing method. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0030] SAO filter calculation requires pixels in 8 directions around it, and at most 2 pixels can be used at the same time. For example, when SAO is 0 degrees, the essence is the size relationship between the current position pixel and the two pixels on the left and right, with a total of 5 cases (larger than the left and smaller than the right, equal to the left and smaller than the right, etc....). Therefore, SAO filter calculation requires pixels beyond the current calculation range. For example, if the 4x4 range is (4,0)-(7,3) (4x4 position No. 1), then the 4 pixels in the column (7,0)-(7,3) are missing the reference pixel on the right, and the specific filter type cannot be obtained, causing the calculation to stop. Figure 1 As shown, the existing method of SAO is non-offset, and the bottom and rightmost of each 8x8 cannot be calculated. Since the 4x4 of the boundary cannot be fully calculated, it is necessary to cache the reference pixels until the right and bottom 8x8 appear, and the pixel cache amount is huge.

[0031] like Figure 2 As shown, a coding method for AVS3 sample adaptive offset filtering includes:

[0032] Step 1: Get the pixel block of size A*A and SAO filter parameters generated in the deblocking filter process;

[0033] Step 2: Offset extension: For the pixel block of size A*A at the current position, according to the rightmost n columns of pixels of its left adjacent block and the bottom n rows of pixels of its upper adjacent block, which form a pixel block of size (A+n)*(A+n), the pixel block of size (A+n)*(A+n) is divided into m pixel blocks of size B*B;

[0034] Step 3: Divide the pixel block of size A*A that has not been offset and expanded into m pixel blocks of size C*C, perform SAO filtering on the pixel blocks of size C*C, and for each pixel block of size C*C, combine the rightmost n columns of pixels of its left adjacent block and the bottom n rows of pixels of its upper adjacent block with the pixels to be processed;

[0035] Step 4: Perform SAO filter calculation on the block to be processed. The SAO filter calculation refers to the pixels in the pixel block of size B*B, and the filtering range is the pixel block of size C*C with a left upper offset of n pixels from the original position.

[0036] Step 5: Perform a de-biasing operation and output the valid SAO filtered pixels according to the actual LCU position.

[0037] In a specific implementation, in step 1, the 8x8 block of the current position that has completed the DBK process completely and the SAO parameters generated by the statistical decision of the current LCU are obtained. For the rightmost and bottommost LCUs that are not in the current frame, the 4 columns and 4 rows of pixels on the leftmost and bottommost sides cannot complete the complete deblocking filtering process. These pixels are calculated in other LCUs, and the DBK8x8 block required for the current SAO filtering does not contain these pixels. The SAO filtering parameters include the best SAO mode of the current LCU to be filtered and its corresponding offset. The process of obtaining the best SAO mode is called SAO decision. The best SAO mode and its corresponding offset can be obtained according to the existing AVS3 standard.

[0038] In a specific implementation, in step 2, the 8x8 block of the DBK process is used to obtain the rightmost column of pixels of the left adjacent block of the current 8x8 pixel block and the bottommost row of pixels of the upper adjacent block to form a 9x9 pixel block. In the SAO calculation, the calculation of all positions is offset by 1 pixel position in the upper left, so for the original position, the right 1 column and the bottom 1 column are not calculated. These pixels that are not calculated in the current block are calculated by offsetting blocks at other positions, and finally the pixels at all positions can be calculated. In the LCU after the offset, the top and leftmost pixels of the 8x8 at the boundary position are pixels that are not filtered or do not exist, and no reference pixels are required. For the 8x8 at the normal position, its top and leftmost pixels are the bottom and rightmost pixels of the 8x8 at other positions that are not filtered. The offset sao filtering calculation no longer needs to rely on the DBK 8x8 pixels that have not been calculated. Further, the 9x9 pixel block obtained in step 2 is divided into 4 5x5 pixel blocks.

[0039] In a specific implementation, in step 4, since the 5x5 block obtained in step 2 includes the original 4x4 block and its upper left 1 row and 1 column of pixels, for each original 4x4 block, its lowermost and leftmost 1 row and 1 column of pixels cannot be calculated. Therefore, the range of filtering calculation is offset by 1 pixel from the upper left of the original 4x4 block, and for the pixels at the red frame position, the comparison information between it and the left, upper, upper left or upper right pixels has been recorded in the previous SAO filtering operation, so there is no need to obtain the outer pixels of the boundary pixels to be filtered again. Finally, for each expanded DBK9X9 block, the pixel range that can complete the SAO filtering is 8x8 starting from the upper left corner, and the remaining lower right 1 row and 1 column of pixels that do not participate in the SAO filtering in the current block will be offset calculated at other corresponding positions. For example, after obtaining the required 9x9 block, it is divided into 4 5x5 pixel blocks, and the coordinates of the upper left corner of each block are (0,0)-(4,4), (4,0)(8,4), (0,4)-(4,8), (4,4)-(8,8). For each 5x5 block, the 16 pixels starting from the upper left are calculated, so for each 5x5 block, the rightmost and bottommost sides are only used for reference. The calculation range of 5x5 No. 0 is (0,0)-(3,3), the calculation range of 5x5 No. 1 is (4,0)-(7,3), the calculation range of 5x5 No. 2 is (0,4)-(3,7), and the calculation range of 5x5 No. 3 is (4,4)-(7,7). At this time, 1 column and 1 row of pixels are left uncalculated. The right column is given to the next 8x8 calculation, and the bottom row is given to the 8x8 calculation at the lower position. At this time, only a small number of unfiltered pixels need to be cached.

[0040] In a specific implementation, in step 5, since the operation of the SAO4x4 block has undergone an offset operation, the valid pixels of the current 4x4 block are uncertain (3x3 / 4x3 / 1x4 / 4x1 / 1x1) at the LCU or image boundary, and the SAO filtered pixels need to be stored according to the position of the real LCU, so the SAO4x4 block with uncertain valid pixels needs to be de-offset. In this example, the output format of the SAO pixel is 8x1 output 8 times from top to bottom in 8x8, and the order of 8x8 in the LCU is from left to right and from top to bottom. Further, take the first row 8x8 of the 0th LCU in the upper left corner of the current frame as an example. The window buffer advances in step following the 8x8 corresponding to the SAO. The position where the pixel is filled into the buffer is the position of the valid pixel of the current block in the current 8x8. For the first computable SAO4x4 block, its valid pixels are 3x3, and the filled position is the corresponding position in the current filterable offset 8x8. When the 4x4 at the second position of the next 8x8 is filtered, its valid pixels are 4x3, and the corresponding position is also filled. Similarly, after the SAO filtering of the third position is completed, it can form the first complete 8x1 pixel row in the original image and cover the pixel data of the output position. An example of valid pixels is as follows: If the original position of the 4x4 is located in the upper left corner of the image, the offset is performed at this time, and the outer circle pixels of the 1st row and 1st column are outside the image. They are non-existent pixels and will not be filtered. The valid pixel range is 3x3, and the coordinate range is (1,1)-(3,3).

[0041] like Figure 3 As shown, a coding system of AVS3 sample adaptive offset filtering, wherein DBK8x8 is a pre-stage deblocking filtering module for generating DBK8x8 pixel blocks, get_right and get_down modules are both implemented by registers, and are used to store the pixels of each original DBK8x8 block that do not participate in SAO filtering, the 8x8 offsetupleft 1pel module corresponds to the step of extending DBK8X8 to 9X9 blocks, DBK_offset_5x5 is used to intercept 4 5X5 in the 9X9 block, and the de-offset 8X8 buffer is the 8x8 window buffer described in step 5.

[0042] like Figure 4 As shown in the figure, under the 22nm process, 500Mhz can support real-time processing of 4k60fps, and the total memory resources occupied are 3200bit, which is significantly better than the existing methods.

[0043] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A coding method for AVS3 sample adaptive offset filtering, characterized in that: include: Step 1: Get the pixel block of size A*A and SAO filter parameters generated in the deblocking filter process; Step 2: Offset extension: For the pixel block of size A*A at the current position, the pixel block of size (A+n)*(A+n) is divided into m pixel blocks of size B*B according to the rightmost n columns of pixels of the adjacent block on its left and the bottom n rows of pixels of the adjacent block on its top, which form a pixel block of size (A+n)*(A+n). Step 3: Divide the pixel block of size A*A that has not been offset and expanded into m pixel blocks of size C*C, perform SAO filtering on the pixel blocks of size C*C, and for each pixel block of size C*C, combine the rightmost n columns of pixels of its left adjacent block and the bottom n rows of pixels of its upper adjacent block with the pixels to be processed; Step 4: Perform SAO filter calculation on the block to be processed. The SAO filter calculation refers to the pixels in the pixel block of size B*B, and the filtering range is the pixel block of size C*C with a left upper offset of n pixels from the original position. Step 5: Perform a de-biasing operation and output the valid SAO filtered pixels according to the actual LCU position.

2. The encoding method of AVS3 sample adaptive offset filtering according to claim 1, characterized in that: In step 2, n takes the value of 1: for the pixel block of size A*A at the current position, the pixel block of size (A+n)*(A+n) is divided into m pixel blocks of size B*B according to the rightmost column of pixels of its left adjacent block and the bottom row of pixels of its upper adjacent block, which form a pixel block of size (A+n)*(A+n).

3. The encoding method of AVS3 sample adaptive offset filtering according to claim 1, characterized in that: In step 3, n takes the value of 1: the pixel block of size A*A that has not been offset and expanded is divided into m pixel blocks of size C*C, and the pixel blocks of size C*C are subjected to SAO filtering. For each pixel block of size C*C, the rightmost column of pixels of the adjacent block on its left and the bottommost row of pixels of the adjacent block on its top are used to form a block to be processed.

4. The encoding method of AVS3 sample adaptive offset filtering according to claim 1, characterized in that: In step 1, the pixel block of size A*A does not include the leftmost and bottommost m columns and m rows of pixels in the LCU that is not the rightmost and bottommost of the current frame.

5. The encoding method of AVS3 sample adaptive offset filtering according to claim 1, characterized in that: In the step 1, the filtering parameters include the best SAO mode of the current LCU to be filtered and its corresponding offset.

6. The encoding method of AVS3 sample adaptive offset filtering according to claim 1, characterized in that: In step 4, a sliding window is constructed, and the valid pixel range is determined according to the position of the current C*C size pixel block in the LCU and the current frame, and the valid pixels are filled into the sliding window. When each row is filled with pixels, the SAO filtered pixels are output according to their corresponding positions in the original LCU.

7. The encoding method of AVS3 sample adaptive offset filtering according to claim 6, characterized in that: When valid pixels are filled into the sliding window, the filling position is the position of the current pixel in the pixel block of size A*A that is offset n pixels to the upper left.

8. The encoding method of AVS3 sample adaptive offset filtering according to claim 7, characterized in that: The value of n is 1.

9. A coding system for AVS3 sample adaptive offset filtering, characterized in that: include: The front-stage deblocking filter module generates a pixel block of size A*A after deblocking filtering; A register module is used to store pixels of each original position of a pixel block of size A*A that do not participate in SAO filtering; an offset module is used to expand a pixel block of size A*A to a pixel block of size (A+n)*(A+n); a truncation module is used to truncate a pixel block of size (A+n)*(A+n) into m pixel blocks of size B*B; and a sliding window module is used to perform a de-offset operation.

10. An encoding device for AVS3 sample adaptive offset filtering, characterized in that: It comprises a storage device and a processing device, the storage device is used to store the program of the encoding method of AVS3 sample adaptive offset filtering as described in any one of claims 1-7, and the processing device is used to execute the aforementioned program.