WO2022179354A1 - 样点自适应补偿的边界补偿模式的数据处理方法、装置 - Google Patents

样点自适应补偿的边界补偿模式的数据处理方法、装置 Download PDF

Info

Publication number
WO2022179354A1
WO2022179354A1 PCT/CN2022/072846 CN2022072846W WO2022179354A1 WO 2022179354 A1 WO2022179354 A1 WO 2022179354A1 CN 2022072846 W CN2022072846 W CN 2022072846W WO 2022179354 A1 WO2022179354 A1 WO 2022179354A1
Authority
WO
WIPO (PCT)
Prior art keywords
reconstructed
boundary
reconstructed pixel
compensation mode
directions
Prior art date
Application number
PCT/CN2022/072846
Other languages
English (en)
French (fr)
Inventor
李晓波
叶天晓
Original Assignee
上海哔哩哔哩科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海哔哩哔哩科技有限公司 filed Critical 上海哔哩哔哩科技有限公司
Priority to EP22758720.1A priority Critical patent/EP4246446A4/en
Publication of WO2022179354A1 publication Critical patent/WO2022179354A1/zh
Priority to US18/336,874 priority patent/US20230336723A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/117Filters, e.g. for pre-processing or post-processing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/40Tree coding, e.g. quadtree, octree
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/1883Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit relating to sub-band structure, e.g. hierarchical level, directional tree, e.g. low-high [LH], high-low [HL], high-high [HH]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Definitions

  • the present application relates to the technical field of data processing in the boundary compensation mode of sample point adaptive compensation, and in particular, to a data processing method and device in the boundary compensation mode of sample point adaptive compensation.
  • HEVC High Efficiency Video Coding
  • SAO Sample Adaptive Offset, sample adaptive compensation
  • the pixel compensation can be realized through the EO (Edge Offset, boundary compensation) mode or the BO (Band Offset, side band compensation) mode.
  • the EO technology compares the current reconstructed pixel with The size of adjacent pixels to classify the current reconstructed pixel. According to the position difference of pixel selection, boundary compensation is divided into 4 directions: horizontal direction (EO0), vertical direction (EO1), 135° direction (EO2) and 45° direction (EO3).
  • a data processing method, device, computer equipment and computer-readable storage medium of a boundary compensation mode of sampling point adaptive compensation are provided, so as to solve the calculation of the EO mode in the categories of pixels in respective directions, and realize the It is a time-consuming problem in the statistical process of residuals and quantities.
  • the present application provides a data processing method for the boundary compensation mode of sampling point adaptive compensation, including:
  • each tree coding block For each tree coding block, traverse all reconstructed pixels in the tree coding block, and calculate the residual value of each reconstructed pixel and the corresponding original pixel;
  • the type of the boundary compensation mode of each first reconstructed pixel in four directions calculate the Accumulated residual values of reconstructed pixel points under different categories of the boundary compensation mode, and count the accumulated number of reconstructed pixel points under different categories.
  • the category of the boundary compensation mode of each second reconstructed pixel point in a single direction, and each residual value are calculated separately.
  • the accumulated residual values of the reconstructed pixel points in different categories of the boundary compensation modes in the four directions include:
  • the category of the boundary compensation mode of each second reconstructed pixel point in a single direction, and each residual value are calculated separately.
  • the accumulated residual values of the reconstructed pixel points in different categories of the boundary compensation modes in the four directions also include:
  • the categories of the boundary compensation modes obtained from the variables in the four directions for each first reconstructed pixel point include:
  • the categories include 5 types, each type is represented by 4 bits, and the types of boundary compensation modes of each reconstructed pixel point in the 4 directions are represented by 16 bits.
  • the categories of the boundary compensation modes obtained from the variable for all reconstructed pixels in four directions include:
  • variable is shifted by 4 to obtain the updated variable
  • the preset 16-bit value is 0x000f
  • the category of the boundary compensation mode in 4 directions represented by the 16 bits obtained for each reconstructed pixel is shifted by 4 bits.
  • the shifted categories include:
  • the category of the boundary compensation mode in 4 directions which is represented by the 16 bits obtained for each reconstructed pixel point, is shifted to the right by 4 bits to obtain the category after the right shift.
  • the preset 16-bit value is 0xf000
  • the category of the boundary compensation mode in 4 directions represented by the 16 bits obtained for each reconstructed pixel is shifted by 4 bits.
  • the shifted categories include:
  • the category of the boundary compensation mode in 4 directions which is represented by the 16 bits obtained by each reconstructed pixel point, is shifted to the left by 4 bits to obtain the category after the left shift.
  • the category of the boundary compensation mode of each second reconstructed pixel point in a single direction, and each residual value are calculated separately.
  • the steps of accumulating residual values of reconstructed pixel points under different categories of boundary compensation modes in four directions include:
  • the boundaries in the four directions are calculated according to the type of the boundary compensation mode of each first reconstructed pixel point in four directions, the type of the boundary compensation mode of each second reconstructed pixel point in a single direction, and each residual value. Accumulated residual values of reconstructed pixel points in all categories except the preset categories in the compensation mode.
  • the present application also provides a data processing device in a boundary compensation mode of sampling point adaptive compensation, including:
  • an acquisition module for acquiring a target reconstructed image, and dividing the target reconstructed image into a plurality of non-overlapping tree-shaped coding blocks
  • the first traversal module is used to traverse all the reconstructed pixels in the tree-shaped coding block for each tree-shaped coding block, and calculate the residual value of each reconstructed pixel point and the corresponding original pixel point;
  • the second traversal module is used to traverse all the first reconstructed pixels belonging to the non-boundary part in the tree-shaped coding block, and calculate the boundary compensation modes of each traversed first reconstructed pixel in four directions.
  • category wherein the four directions include horizontal direction, vertical direction, 135° direction and 45° direction;
  • the third traversal module is used to traverse all the second reconstructed pixels belonging to the boundary part in the tree-shaped coding block, and calculate the category of the boundary compensation mode of each second reconstructed pixel traversed in a single direction;
  • the calculation module is used to calculate the type of the boundary compensation mode of each first reconstructed pixel point in four directions, the type of the boundary compensation mode of each second reconstructed pixel point in a single direction, and each residual value respectively.
  • the accumulated residual values of the reconstructed pixel points under different categories of the boundary compensation modes in the four directions, and the accumulated number of reconstructed pixel points under different categories are counted.
  • the present application also provides a computer device comprising a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor, the processor executing the computer
  • a computer device comprising a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor, the processor executing the computer
  • the steps of the above method are implemented when the instructions are readable.
  • the present application also provides a computer-readable storage medium on which computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, implement the steps of the above method.
  • the target reconstructed image is divided into a plurality of non-overlapping tree-shaped coding blocks; Construct pixels, and calculate the residual value between each reconstructed pixel and the corresponding original pixel; traverse all the first reconstructed pixels belonging to the non-boundary part in the tree-shaped coding block, and calculate each traversed pixel.
  • the categories of the boundary compensation modes of the first reconstructed pixel in four directions wherein the four directions include the horizontal direction, the vertical direction, the 135° direction and the 45° direction; All the second reconstructed pixel points, and calculate the category of the boundary compensation mode of each second reconstructed pixel point in a single direction; according to the boundary compensation mode of each first reconstructed pixel point in 4 directions.
  • the category of the second reconstructed pixel point, the category of the boundary compensation mode in a single direction, and the residual value of each second reconstructed pixel point. and count the cumulative number of reconstructed pixels under different categories.
  • FIG. 1 is an environmental schematic diagram of a data processing method in a boundary compensation mode of sample point adaptive compensation according to an embodiment of the present application
  • FIG. 2 is a flowchart of an embodiment of the data processing method in the boundary compensation mode of sampling point adaptive compensation described in the present application;
  • 3 is a schematic diagram of boundary compensation modes in four directions of the application.
  • FIG. 4 shows the types of boundary compensation modes according to each first reconstructed pixel point in four directions, the type of boundary compensation mode of each second reconstructed pixel point in a single direction, and each residual in an embodiment of the present application Schematic diagram of the step refinement of calculating the accumulated residual values of the reconstructed pixel points under different categories of the boundary compensation modes in the four directions respectively;
  • FIG. 5 is a program block diagram of an embodiment of the data processing apparatus in the boundary compensation mode of sampling point adaptive compensation according to the present application
  • FIG. 6 is a schematic diagram of a hardware structure of a computer device for performing a data processing method in a boundary compensation mode of sample point adaptive compensation provided by an embodiment of the present application.
  • first, second, third, etc. may be used in this disclosure to describe various pieces of information, such information should not be limited by these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information, without departing from the scope of the present disclosure.
  • word "if” as used herein can be interpreted as "at the time of” or "when” or "in response to determining.”
  • FIG. 1 schematically shows a schematic frame diagram of a data processing method in a boundary compensation mode of sample adaptive compensation according to an embodiment of the present application.
  • the system of the application environment may include a computer device 10 and a server 20 .
  • the computer device 10 forms a wireless or wired connection with the server 20 .
  • the computer device 10 may be a mobile phone, an iPAD, a tablet computer, a server, or the like.
  • the server 20 may be a rack-type server, a blade-type server, a tower-type server or a cabinet-type server (including an independent server, or a server cluster composed of multiple servers) and the like.
  • FIG. 2 is a schematic flowchart of a data processing method in a boundary compensation mode of sample point adaptive compensation according to an embodiment of the present application. It should be understood that the flowchart in this embodiment of the method is not used to limit the sequence of executing steps. The following is an exemplary description with a computer device as the execution subject. As can be seen from the figure, the data processing method of the boundary compensation mode of sample point adaptive compensation provided in this embodiment includes:
  • Step S20 acquiring a target reconstructed image, and dividing the target reconstructed image into a plurality of non-overlapping tree-shaped coding blocks.
  • the target reconstructed image is an image obtained after deblocking the reconstructed image, which is a reconstructed frame of image.
  • the target reconstructed image when the target reconstructed image is divided into tree coding blocks, the whole frame of the image is divided into blocks according to the size of the tree coding unit (Coding Tree Unit, CTU) preset by the encoder, such as , the size of the target reconstructed image is 128*128, and the size of the CTU is 64*64, then the target reconstructed image can be divided into 4 non-overlapping tree-shaped coding blocks.
  • CTU Coding Tree Unit
  • Step S21 for each tree-shaped coding block, traverse all the reconstructed pixel points in the tree-shaped coding block, and calculate the residual value between each reconstructed pixel point and the corresponding original pixel point.
  • the tree coding block may be the luminance CTB included in the tree coding unit (Coding Tree Unit, CTU) in the sample adaptive compensation technology (Sample Adaptive Offset, SAO) in HEVC Or Chroma CTB.
  • a tree coding block consists of multiple reconstructed pixels.
  • the reconstructed pixel points refer to the pixel points obtained by restoring each pixel point in the original image.
  • the residual values of all reconstructed pixel points in the tree-shaped coding block can be pre-calculated, instead of calculating the residual values when they are needed.
  • Step S22 traverse all the first reconstructed pixels belonging to the non-boundary part in the tree-shaped coding block, and calculate the category of the boundary compensation mode of each traversed first reconstructed pixel in four directions, wherein, The four directions include horizontal direction, vertical direction, 135° direction and 45° direction.
  • the non-boundary part is relative to the boundary part, wherein the boundary part refers to the uppermost row, the lowermost row, the leftmost column and the rightmost column in the tree-shaped coding block.
  • the non-boundary part refers to the part of the tree-shaped coding block except the uppermost row, the lowermost row, the leftmost column and the rightmost column.
  • all the first reconstructed pixels in the non-boundary part refer to the pixels in the tree-shaped coding block except the pixels in the uppermost row, the pixels in the lowermost row, the pixels in the leftmost column and All pixels except the pixels in the rightmost column.
  • the edge compensation (Edge Offset, EO) mode can be divided into four kinds of boundary compensation modes, namely horizontal direction (E00), vertical direction (E01), 135° direction (E02) and 45° direction (E03) Boundary Compensation Mode.
  • FIG. 3 the boundary compensation modes in these four directions are shown in FIG. 3 .
  • c represents the reconstructed pixel point to be calculated currently
  • a and b represent the reference pixel point of the reconstructed pixel point to be calculated currently.
  • each reconstructed pixel in the tree coding block can be divided into 5 different categories, namely category0, category1, category2, category3, category4, namely category 0, category 1, category 2.
  • category 1 indicates that the pixel values of the reconstructed pixels currently to be calculated are all smaller than the pixel values of the two reference pixels.
  • This category belongs to Positive offset, and the compensation value must be greater than or equal to 0;
  • category 2 indicates that the current reconstruction to be calculated.
  • the pixel value of a pixel is equal to the pixel value of one reference pixel, and is smaller than the pixel value of another reference pixel.
  • This category belongs to Positive offset, and the compensation value must be greater than or equal to 0;
  • category 3 represents the reconstructed pixel currently to be calculated.
  • the pixel value of the point is equal to the pixel value of one reference pixel, and is greater than the pixel value of another reference pixel.
  • This category belongs to the Negative offset, and the compensation value must be less than or equal to 0; category 4 represents the reconstructed pixel currently to be calculated.
  • the pixel values of the two reference pixels are all greater than the pixel values of the two reference pixels.
  • This category belongs to the Negative offset, and the compensation value is less than or equal to 0; the category 0 indicates that the pixel value of the reconstructed pixel currently to be calculated belongs to the above four cases. Reconstructed pixels belonging to this category do not require pixel compensation.
  • a preset function can be used to calculate the category of the boundary compensation mode of the first reconstructed pixel in four directions at one time, without the need to pass multiple This function completes the category calculation of the boundary supplementary model in each direction.
  • Step S23 traverse all the second reconstructed pixels belonging to the boundary part in the tree-shaped coding block, and calculate the category of the boundary compensation mode in a single direction for each traversed second reconstructed pixel.
  • the boundary of the second pixel in the corresponding direction needs to be calculated Category of compensation mode.
  • the second reconstructed pixel to be calculated is the pixel of the uppermost row in the boundary portion
  • the pixel located in the uppermost row only has the boundary compensation mode in the horizontal direction (E00)
  • the second reconstructed pixel of a row can only calculate the category of the boundary compensation mode in the horizontal direction; if the second reconstructed pixel to be calculated is the pixel of the bottom row in the boundary
  • the pixels of one row only have the boundary compensation mode in the horizontal direction.
  • the reconstructed pixel point is the pixel point of the leftmost row in the boundary part. Since the pixel point located in the leftmost row only has the boundary compensation mode in the vertical direction (E01), therefore, for the second layer located in the leftmost row, That is, only the category of the boundary compensation mode in the vertical direction can be calculated; if the second reconstructed pixel to be calculated is the pixel of the rightmost row in the boundary part, because the pixel located in the rightmost row is also There is only a boundary compensation mode in the vertical direction (E01), therefore, for the second reconstructed pixel point located in the rightmost row, only the type of the boundary compensation mode in the vertical direction can be calculated.
  • the category of the boundary compensation mode in other directions for the second pixel located in the boundary part may not be calculated, or in order to ensure that all pixels have the category of the boundary compensation mode in 4 directions, for
  • the category of the boundary compensation mode of the second pixel located in the boundary portion in other directions may be represented by a preset value, which can be understood to be the same as the value representing the category of the boundary compensation mode.
  • Step S24 according to the types of the boundary compensation modes of each first reconstructed pixel point in four directions, the type of the boundary compensation mode of each second reconstructed pixel point in a single direction, and each residual value, calculate four types respectively.
  • the accumulated residual values of the reconstructed pixel points under different categories of the boundary compensation mode under the direction, and the accumulated number of reconstructed pixel points under the different categories are counted.
  • the accumulated residual value is the accumulated sum of residual values of all reconstructed pixel points and their corresponding original pixel points in the boundary compensation mode in each direction that belong to the same category. That is to say, the accumulated residual value includes the accumulated sum of residual values of all reconstructed pixels belonging to category 0 in the EOO mode and their corresponding original pixel points, and all reconstructed pixels belonging to category 1 in the EOO mode.
  • the cumulative sum of the residual values of all reconstructed pixels and their corresponding original pixels, the cumulative sum of all reconstructed pixels belonging to category 4 in the EOO mode and the residual values of their corresponding original pixels, belonging to the EO1 mode The cumulative sum of the residual values of all reconstructed pixels of category 0 and their corresponding original pixels, the cumulative sum of all reconstructed pixels belonging to category 1 under the EO1 mode and the residual values of their corresponding original pixels, The cumulative sum of the residual values of all reconstructed pixels belonging to category 2 in EO1 mode and their corresponding original pixels, and the residual values of all reconstructed pixels belonging to category 3 and their corresponding original pixels in EO1 mode
  • the accumulated sum of all reconstructed pixels belonging to category 4 under EO1 mode and the residual values of their corresponding original pixels; all reconstructed pixels belonging to category 0 under EO2 mode and their corresponding original pixels The accumulated sum of the residual values, the accumulated sum of the residual values of all reconstructed pixels belonging to category 1 under EO2 mode and their corresponding original
  • the accumulated number is the number of all reconstructed pixels belonging to the same category in the boundary compensation mode in various directions. For example, there are 8 reconstructed pixels belonging to category 0 in the EOO mode, and the accumulated number is is 8; there are 5 reconstructed pixels belonging to category 2 in the EO1 mode, and the accumulated number is 5.
  • the reconstructed pixel points belonging to each category in each EO mode can be found first, and then the pixel corresponding to the found pixel point can be found from the calculated residual value. Residual value, and finally all residual values are accumulated to obtain the accumulated residual value belonging to the category x (x is 0, 1, 2, 3 or 4) in the EO mode, and the number of pixels is counted at the same time.
  • the boundaries in the four directions are calculated respectively. Accumulated residual values of reconstructed pixel points under different categories of the compensation mode, and count the accumulated number of reconstructed pixel points under different categories.
  • by calculating the types of boundary compensation modes of each reconstructed pixel in four directions at one time it only takes a little more than 1/4 of the time to complete each reconstructed pixel
  • the calculation of the category of the boundary compensation mode of the point in 4 directions greatly reduces the calculation time.
  • the EO module can be accelerated by about 32.8%, and when applied in a live broadcast scenario, it can be accelerated by about 3.28%, reducing the live broadcast delay.
  • the step of calculating the accumulated residual values of the reconstructed pixel points under different categories of the boundary compensation modes in the four directions and each residual value respectively may include steps S40-S42, wherein:
  • Step S40 traverse all the first reconstructed pixels, and store the categories of the boundary compensation modes of each first reconstructed pixel in four directions into a variable.
  • the category of each first reconstructed pixel point in each EO direction can be represented by m bits. Since there are only 5 categories in total, in this embodiment, the minimum value of m can be 3, That is, at least 3-bit values can be used to represent 5 categories, so that the categories of the 4 EO directions of each pixel point only need 12 bits to fully represent.
  • the value of m is preferably 4. , that is, a 16-bit value is used to represent the category of the reconstructed pixel in the four directions of each EO; of course, in other embodiments of the present application, m can also be 8, and a 32-bit value is used to represent each EO. categories in four directions.
  • the value of m is not limited.
  • the category of the boundary compensation mode of each first reconstructed pixel in 4 directions can be spliced into a 16-bit variable, for example, spliced and stored into a 16-bit variable. in the variable et.
  • the variable may be a global variable or a local variable, which is not limited in this embodiment.
  • step S41 the category of the boundary compensation mode in the four directions of each first reconstructed pixel point is obtained from the variable.
  • variable contains the category of the boundary compensation mode of each first reconstructed pixel after splicing in four directions, it can be directly extracted from the category information when the category information is required.
  • Step S42 according to the type of the boundary compensation mode of each first reconstructed pixel point in the four directions, the type of the boundary compensation mode of each second reconstructed pixel point in a single direction, and each residual value respectively calculate the four directions. Accumulated residual values of reconstructed pixels under different categories of boundary compensation modes.
  • this step is the same as the above-mentioned step S23, which is not repeated in this embodiment.
  • the amount of data stored and transmitted can be reduced.
  • the type of boundary compensation mode according to each first reconstructed pixel point in four directions, the type of boundary compensation mode of each second reconstructed pixel point in a single direction, and each The residual value is calculated separately for the four directions and the accumulated residual values of the reconstructed pixel points in different categories of the boundary compensation mode may also include:
  • the second reconstructed pixels that only exist in the boundary compensation mode in a single direction can also be spliced to form the same as the first reconstructed pixel.
  • the pixel points have category information of the same number of digits, and the spliced category information is also stored in the variable.
  • the single direction refers to the EO mode possessed by the current second reconstructed pixel.
  • the single direction refers to the horizontal direction (EOO); if the current second reconstructed pixel point is the pixel point of the leftmost row or the rightmost row, the single direction refers to the vertical direction (EO1).
  • the other direction refers to the direction other than the single direction of the current second reconstructed pixel point. Specifically, if the current second reconstructed pixel point is the pixel point of the uppermost row or the lowermost row , the other directions refer to the vertical direction (EO1), the 135° direction (E02) and the 45° direction (E03); if the current second reconstructed pixel is the pixel of the leftmost row or the rightmost row, Then the other directions refer to the horizontal direction (EOO), the 135° direction (E02) and the 45° direction (E03);
  • each category is represented by 4 bits, and bits 1 to 4 in the variable represent the category of EOO mode, bits 5 to 8 in the variable represent the category of EO1 mode, and bits in the variable
  • the 9th to 12th bits represent the category of EO2 mode, and the 13th to 16th bits in the variable represent the category of EO3 mode.
  • the value representing the category can be added to the first to fourth bits in the variable, and other bits in the variable are represented by preset values.
  • the value representing the category can be added to the 5th to 8th bits in the variable, and the other bits in the variable are also processed with preset values. express.
  • the preset value is a preset or default value, and the preset value requires different values corresponding to each category.
  • the values corresponding to 5 categories are 0, 1, 2, 3, 4, the preset value may be 5, 6, 7, 8, etc.
  • the categories of the boundary compensation modes obtained from the variables in the four directions for each first reconstructed pixel point include:
  • variable contains the categories of the first reconstructed pixel point and the second reconstructed pixel point
  • all reconstructed pixel points in four directions can be acquired from the variable.
  • Category under Boundary Compensation Mode when the variable contains the categories of the first reconstructed pixel point and the second reconstructed pixel point, when the category needs to be acquired, all reconstructed pixel points in four directions can be acquired from the variable.
  • the step of obtaining the categories of boundary compensation modes of all reconstructed pixels in 4 directions from the variable may include: comparing the variable with a preset 16-bit Perform an AND operation on the numerical values, and use the operation result as the category of the boundary compensation mode in one direction for each reconstructed pixel point stored in the variable;
  • variable is shifted by 4 to obtain the updated variable
  • the preset 16-bit value may be 0x000f or 0xf000.
  • the variable et and 0x000f can be subjected to the '& (and)' operation to obtain the lower 4 bits of the original variable et, and each reconstruction in the variable et can be obtained
  • the category of the pixel in the EO0 mode, and then the accumulated residual value and the accumulated number of each category in the EO0 mode can be counted separately.
  • variable et After completing the accumulated residual values and accumulated quantities of each category in the EO0 mode, the variable et can be shifted to the right by 4 bits, and then the shifted variable et and 0x000f are performed '&' operation to obtain the original variable et The 5th to 8th bits of , obtain the EO1 category of each reconstructed pixel point in the variable et, and then count the accumulated residual values and accumulated quantities of each category in the EO1 mode.
  • shifting the variable by 4 bits to obtain the updated variable includes:
  • one of the categories contained in the variable is 0x378B, then the right-shifted category is 0x0378.
  • the shifting of the variable by 4 bits to obtain the updated variable includes:
  • the variable is left-shifted by 4 bits to obtain the updated variable.
  • one of the categories contained in the variable is 0x378B, and the left-shifted category is 0x78B0.
  • the type of boundary compensation mode according to each first reconstructed pixel point in four directions, the type of boundary compensation mode of each second reconstructed pixel point in a single direction, and each Residual values respectively include:
  • the boundaries in the four directions are calculated according to the type of the boundary compensation mode of each first reconstructed pixel point in four directions, the type of the boundary compensation mode of each second reconstructed pixel point in a single direction, and each residual value. Accumulated residual values of reconstructed pixel points in all categories except the preset categories in the compensation mode.
  • the preset category is category 0 in the foregoing embodiment.
  • pixel compensation is not required for the reconstructed pixels belonging to category 0, that is to say, the calculation of the accumulated residual value and the statistical result of the accumulated number of reconstructed pixels belonging to category 0 are useless Therefore, in this embodiment, in order to reduce the amount of calculation, when calculating the accumulated residual value, only the accumulated residual value of all categories except category 0 may be calculated, and the reconstruction of the residual value belonging to category 0 may be calculated. The accumulated residual value of the pixel point is not calculated.
  • FIG. 5 it is a program block diagram of an embodiment of the data processing apparatus 50 in the boundary compensation mode of the sample point adaptive compensation of the present application.
  • the data processing device 50 in the boundary compensation mode of the sample point adaptive compensation includes a series of computer-readable instructions stored in the memory.
  • the present invention can be implemented.
  • the data processing function of the boundary compensation mode of the sample point adaptive compensation of each embodiment is applied.
  • the data processing apparatus 50 in the boundary compensation mode of sample adaptive compensation may be divided into one or more modules based on the specific operations implemented by the various parts of the computer readable instructions.
  • the data processing device 50 in the boundary compensation mode of sample point adaptive compensation can be divided into an acquisition module 51 , a first traversal module 52 , a second traversal module 53 , a third traversal module 54 , and a calculation module 51 .
  • an acquisition module 51 configured to acquire a target reconstructed image, and divide the target reconstructed image into a plurality of non-overlapping tree-shaped coding blocks;
  • the first traversal module 52 is used to traverse all the reconstructed pixels in the tree-shaped coding block for each tree-shaped coding block, and calculate the residual value of each reconstructed pixel point and the corresponding original pixel point;
  • the second traversal module 53 is configured to traverse all the first reconstructed pixels belonging to the non-boundary part in the tree-shaped coding block, and calculate the boundary compensation modes of each traversed first reconstructed pixel in four directions
  • the category of , wherein, the four directions include horizontal direction, vertical direction, 135° direction and 45° direction;
  • the third traversing module 54 is configured to traverse all the second reconstructed pixels belonging to the boundary part in the tree-shaped coding block, and calculate the category of the boundary compensation mode of each traversed second reconstructed pixel in a single direction ;
  • the calculation module 55 is configured to separate the type of the boundary compensation mode of each first reconstructed pixel point in four directions, the type of the boundary compensation mode of each second reconstructed pixel point in a single direction, and each residual value. Calculate the accumulated residual values of the reconstructed pixel points under different categories of the boundary compensation modes in the four directions, and count the accumulated number of reconstructed pixel points under different categories.
  • the calculation module 55 is further configured to traverse all the first reconstructed pixel points, and store the category splicing of the boundary compensation mode of each first reconstructed pixel point in four directions into a In a variable; obtain the category of the boundary compensation mode of each first reconstructed pixel in 4 directions from the variable; according to the category of the boundary compensation mode of each first reconstructed pixel in 4 directions, The category of the boundary compensation mode and each residual value of each second reconstructed pixel point in a single direction are calculated respectively to calculate the accumulated residual value of the reconstructed pixel point in different categories of the boundary compensation mode in four directions.
  • the calculation module 55 is further configured to traverse all the second reconstructed pixel points, and store the category of the boundary compensation mode of each second reconstructed pixel point in a single direction spliced to all the second reconstructed pixels.
  • a preset value is used to represent the category of the boundary compensation mode of each second reconstructed pixel point in other directions.
  • the calculation module 55 is further configured to obtain the categories of boundary compensation modes of all reconstructed pixels in four directions from the variable.
  • the categories include 5 categories, each category is represented by 4 bits, and the category of the boundary compensation mode of each reconstructed pixel point in the 4 directions is represented by 16 bits.
  • the calculation module 55 is also configured to perform AND operation on the variable and a preset 16-bit value, and use the operation result as each reconstructed pixel stored in the variable at The category of the boundary compensation mode under a direction; the variable is shifted by 4 bits to obtain the updated variable; the updated variable is ANDed with the preset 16-bit value, and the result of the operation is used as The category of the boundary compensation mode of each reconstructed pixel point in another direction; return to the step of shifting the variable by 4 bits to obtain the updated variable, until each reconstructed pixel point is obtained in all Category of Boundary Compensation Mode under Orientation.
  • the preset 16-bit value is 0x000f
  • the calculation module 55 is further configured to right-shift the variable by 4 bits to obtain an updated variable.
  • the preset 16-bit value is 0xf000
  • the calculation module 55 is further configured to shift the variable to the left by 4 bits to obtain an updated variable.
  • the boundaries in the four directions are calculated respectively. Accumulated residual values of reconstructed pixel points under different categories of the compensation mode, and count the accumulated number of reconstructed pixel points under different categories.
  • by calculating the types of boundary compensation modes of each reconstructed pixel in four directions at one time it only takes a little more than 1/4 of the time to complete each reconstructed pixel
  • the calculation of the category of the boundary compensation mode of the point in 4 directions greatly reduces the calculation time.
  • FIG. 6 schematically shows a schematic diagram of the hardware architecture of a computer device 10 suitable for implementing a data processing method of a boundary compensation mode of sample adaptive compensation according to an embodiment of the present application.
  • the computer device 10 is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions.
  • it can be a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including an independent server, or a server cluster composed of multiple servers) and the like.
  • the computer device 10 at least includes but is not limited to: a memory 120 , a processor 121 , and a network interface 122 that can communicate with each other through a system bus. in:
  • the memory 120 includes at least one type of computer-readable storage medium, which may be volatile or non-volatile.
  • the readable storage medium includes flash memory, hard disk, multimedia card, Card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable Read only memory (PROM), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 120 may be an internal storage module of the computer device 10 , such as a hard disk or memory of the computer device 10 .
  • the memory 120 may also be an external storage device of the computer device 10, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC for short), a secure digital (Secure) Digital, referred to as SD) card, flash memory card (Flash Card) and so on.
  • the memory 120 may also include both an internal storage module of the computer device 10 and an external storage device thereof.
  • the memory 120 is generally used to store the operating system installed in the computer device 10 and various application software, such as program codes of the data processing method of the boundary compensation mode of the sample point adaptive compensation.
  • the memory 120 may also be used to temporarily store various types of data that have been output or will be output.
  • the processor 121 may be a central processing unit (Central Processing Unit, referred to as CPU for short), a controller, a microcontroller, a microprocessor, or other data processing chips in the boundary compensation mode of sampling point adaptive compensation.
  • the processor 121 is generally used to control the overall operation of the computer device 10 , such as performing control and processing related to data interaction or communication with the computer device 10 .
  • the processor 121 is configured to execute program codes or process data stored in the memory 120 .
  • Network interface 122 which may include a wireless network interface or a wired network interface, is typically used to establish communication links between computer device 10 and other computer devices.
  • the network interface 122 is used to connect the computer device 10 with an external terminal through a network, and establish a data transmission channel and a communication link between the computer device 10 and the external terminal.
  • the network can be Intranet, Internet, Global System of Mobile communication (GSM for short), Wideband Code Division Multiple Access (WCDMA for short), 4G network , 5G network, Bluetooth (Bluetooth), Wi-Fi and other wireless or wired networks.
  • FIG. 6 only shows a computer device having components 120-122, but it should be understood that it is not required to implement all of the shown components, and more or less components may be implemented instead.
  • the data processing method of the sample point adaptive compensation boundary compensation mode stored in the memory 120 may be divided into one or more program modules, and processed by one or more processors (in this embodiment, the processing 121) to complete the application.
  • Embodiments of the present application provide a computer-readable storage medium, where computer-readable instructions are stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the boundary compensation of the sampling point adaptive compensation in the embodiment is implemented The steps of the data processing method of the schema.
  • the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Programmable Read-Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc.
  • the computer-readable storage medium may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device.
  • the computer-readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC for short), a secure digital ( Secure Digital, referred to as SD) card, flash memory card (Flash Card) and so on.
  • the computer-readable storage medium may also include both an internal storage unit of a computer device and an external storage device thereof.
  • the computer-readable storage medium is generally used to store the operating system and various application software installed in the computer device, for example, the program code of the data processing method of the boundary compensation mode of sampling point adaptive compensation in the embodiment.
  • the computer-readable storage medium can also be used to temporarily store various types of data that have been output or will be output.
  • the device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place , or distributed over at least two network elements. Some or all of the modules may be screened out according to actual needs to achieve the purpose of the solutions of the embodiments of the present application. Those of ordinary skill in the art can understand and implement it without creative effort.
  • each embodiment can be implemented by means of software plus a general hardware platform, and certainly can also be implemented by hardware.
  • Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through computer-readable instructions, and the program can be stored in a computer-readable storage medium. When the program is executed, it may include the flow of the embodiments of the above-mentioned methods.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

一种样点自适应补偿的边界补偿模式的数据处理方法、装置。该方法包括:获取目标重构图像,将目标重构图像划分为多个互不重叠的树形编码块;对于每一个树形编码块,遍历树形编码块中所有的重构像素点,并计算每一个重构像素点与对应的原始像素点的残差值;遍历树形编码块中属于非边界部分的所有的第一重构像素点和属于边界部分的所有的第二重构像素点,并计算遍历出的每一个第一重构像素点在4种方向下的边界补偿模式的类别和每一个第二重构像素点在单一方向下的边界补偿模式的类别;根据以上类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值及统计不同类别下的重构像素点的累加数量。

Description

样点自适应补偿的边界补偿模式的数据处理方法、装置
本申请要求于2021年2月24日提交中国专利局、申请号为202110209617.4,发明名称为“样点自适应补偿的边界补偿模式的数据处理方法、装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及样点自适应补偿的边界补偿模式的数据处理技术领域,尤其涉及一种样点自适应补偿的边界补偿模式的数据处理方法、装置。
背景技术
HEVC(High Efficiency Video Coding)是一种视频压缩标准,在采用HEVC对视频进行压缩后,为了减小重构图像与原图像的失真,会通过SAO(Sample Adaptive Offset,样点自适应补偿)技术对重构图像进行像素补偿。
在采用SAO技术对像素进行补偿时,可以通过EO(Edge Offset,边界补偿)模式或者通过BO(Band Offset,边带补偿)模式实现像素补偿,其中,EO技术是通过比较当前的重构像素与相邻像素的大小,对当前重构像素进行归类。根据像素选取的位置差异,边界补偿分为4种方向:分别为水平方向(EO0)、垂直方向(EO1)、135°方向(EO2)和45°方向(EO3)。
现有的EO模式在实现过程中,会针对每个EO方向,单独写一个函数,也就是4个EO方向,需要写4个函数,然后通过每个函数完成各自方向像素的类别的计算,以及实现对残差以及数量的统计过程。
然而,发明人发现,采用这种方式实现,就需要对重建像素读取四次,会耗费较多时间,严重影响SAO的性能。
发明内容
有鉴于此,现提供一种样点自适应补偿的边界补偿模式的数据处理方法、装置、计算机设备及计算机可读存储介质,以解决EO模式在对各自方向像素的类别的计算,以及实现对残差以及数量的统计过程中比较耗时的问题。
本申请提供了一种样点自适应补偿的边界补偿模式的数据处理方法,包括:
获取目标重构图像,将所述目标重构图像划分为多个互不重叠的树形编码块;
对于每一个树形编码块,遍历树形编码块中所有的重构像素点,并计算每一个重构像素点与对应的原始像素点的残差值;
遍历树形编码块中属于非边界部分的所有的第一重构像素点,并计算遍历出的每一个第一重构像素点在4种方向下的边界补偿模式的类别,其中,所述4种方向包括水平方向、垂直方向、135°方向与45°方向;
遍历树形编码块中属于边界部分的所有的第二重构像素点,并计算遍历出的每一个第二重构像素点在单一方向下的边界补偿模式的类别;
根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点的在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值,以及统计不同类别下的重构像素点的累加数量。
可选地,所述根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值包括:
遍历所有的第一重构像素点,并将每一个第一重构像素点在4个方向下的边界补偿模式的类别拼接存储到一个变量中;
从所述变量中获取每一个第一重构像素点在4种方向下的边界补偿模式的类别;
根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值。
可选地,所述根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值还包括:
遍历所有的第二重构像素点,并将每一个第二重构像素点在单一方向下的边界补偿模式的类别拼接存储到所述变量中,其中,采用预设值表示所述每一个第二重构像素点在其他方向上的边界补偿模式的类别;
所述从所述变量中获取每一个第一重构像素点在4种方向下的边界补偿模式的类别包括:
从所述变量中获取所有的重构像素点在4种方向下的边界补偿模式的类别。
可选地,所述类别包括5种,每一种类别采用4个比特表示,每一个重构像素点在4种方向下的边界补偿模式的类别采用16个比特表示。
可选地,所述从所述变量中获取所有的重构像素点在4种方向下的边界补偿模式的类 别包括:
将所述变量与预设的16位比特数值做与运算,并将运算结果作为所述变量中存储的每一个重构像素点在一种方向下的边界补偿模式的类别;
将所述变量移位4位,得到更新后的变量;
将更新后的变量与预设的16位比特数值做与运算,并将运算结果作为所述每一个重构像素点在另一种方向下的边界补偿模式的类别;
返回执行将所述变量移位4位,得到更新后的变量的步骤,直到得到每一个重构像素点在所有方向下的边界补偿模式的类别。
可选地,所述预设的16位比特数值为0x000f,所述将获取到的每一个重构像素点采用的16个比特表示的在4种方向下的边界补偿模式的类别移位4位,得到移位后的类别包括:
将获取到的每一个重构像素点采用的16个比特表示的在4种方向下的边界补偿模式的类别右移位4位,得到右移位后的类别。
可选地,所述预设的16位比特数值为0xf000,所述将获取到的每一个重构像素点采用的16个比特表示的在4种方向下的边界补偿模式的类别移位4位,得到移位后的类别包括:
将获取到的每一个重构像素点采用的16个比特表示的在4种方向下的边界补偿模式的类别左移位4位,得到左移位后的类别。
可选地,所述根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值的步骤包括:
根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的除预设的类别之外的所有类别下的重构像素点的累加残差值。
本申请还提供了一种样点自适应补偿的边界补偿模式的数据处理装置,包括:
获取模块,用于获取目标重构图像,将所述目标重构图像划分为多个互不重叠的树形编码块;
第一遍历模块,用于对于每一个树形编码块,遍历树形编码块中所有的重构像素点,并计算每一个重构像素点与对应的原始像素点的残差值;
第二遍历模块,用于遍历树形编码块中属于非边界部分的所有的第一重构像素点,并计算遍历出的每一个第一重构像素点在4种方向下的边界补偿模式的类别,其中,所述4种方向包括水平方向、垂直方向、135°方向与45°方向;
第三遍历模块,用于遍历树形编码块中属于边界部分的所有的第二重构像素点,并计 算遍历出的每一个第二重构像素点在单一方向下的边界补偿模式的类别;
计算模块,用于根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点的在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值,以及统计不同类别下的重构像素点的累加数量。
本申请还提供了一种计算机设备,所述计算机设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述方法的步骤。
本申请还提供了一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述方法的步骤。
上述技术方案的有益效果:
本申请实施例中,通过获取目标重构图像,将所述目标重构图像划分为多个互不重叠的树形编码块;对于每一个树形编码块,遍历树形编码块中所有的重构像素点,并计算每一个重构像素点与对应的原始像素点的残差值;遍历树形编码块中属于非边界部分的所有的第一重构像素点,并计算遍历出的每一个第一重构像素点在4种方向下的边界补偿模式的类别,其中,所述4种方向包括水平方向、垂直方向、135°方向与45°方向;遍历树形编码块中属于边界部分的所有的第二重构像素点,并计算遍历出的每一个第二重构像素点在单一方向下的边界补偿模式的类别;根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点的在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值,以及统计不同类别下的重构像素点的累加数量。在本申请实施例中,通过一次计算每一个重构像素点在4种方向下的边界补偿模式的类别,从而可以只需要花费稍多以前1/4的时间,即可完成每一个重构像素点在4种方向下的边界补偿模式的类别的计算,极大的减少了计算耗时。
附图说明
图1为本申请实施例的样点自适应补偿的边界补偿模式的数据处理方法的环境示意图;
图2为本申请所述的样点自适应补偿的边界补偿模式的数据处理方法的一种实施例的流程图;
图3为本申请4种方向的边界补偿模式的示意图;
图4为本申请一实施方式中根据各个第一重构像素点在4种方向下的边界补偿模式的 类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值的的步骤细化流程示意图;
图5为本申请所述的样点自适应补偿的边界补偿模式的数据处理装置的一种实施例的程序模块图;
图6为本申请实施例提供的执行样点自适应补偿的边界补偿模式的数据处理方法的计算机设备的硬件结构示意图。
具体实施方式
以下结合附图与具体实施例进一步阐述本申请的优点。
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。
在本公开使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本公开和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其它含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
在本申请的描述中,需要理解的是,步骤前的数字标号并不标识执行步骤的前后顺序,仅用于方便描述本申请及区别每一步骤,因此不能理解为对本申请的限制。
图1示意性示出了根据本申请实施例的样点自适应补偿的边界补偿模式的数据处理方法的框架示意图。在示例性的实施例中,该应用环境的系统可包括计算机设备10、服务器20。其中,计算机设备10与服务器20形成无线或有线连接。计算机设备10可以为手机、iPAD,平板电脑、服务器等。服务器20可以为机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。
参阅图2,其为本申请一实施例的样点自适应补偿的边界补偿模式的数据处理方法的 流程示意图。本可以理解,本方法实施例中的流程图不用于对执行步骤的顺序进行限定。下面以计算机设备为执行主体进行示例性描述,从图中可以看出,本实施例中所提供的样点自适应补偿的边界补偿模式的数据处理方法包括:
步骤S20,获取目标重构图像,将所述目标重构图像划分为多个互不重叠的树形编码块。
具体地,所述目标重构图像为对重建图像在进行deblocking之后后得到的图像,其为重建完成的一帧图像。
在本实施例中,在将目标重构图像划分为树形编码块时,是根据编码器预先设置的树形编码单元(Coding Tree Unit,CTU)的大小对整帧的图像进行分块,比如,目标重构图像的大小为128*128,而CTU的大小为64*64,则可以将目标重构图像划分为4个互不重叠的树形编码块。
步骤S21,对于每一个树形编码块,遍历树形编码块中所有的重构像素点,并计算每一个重构像素点与对应的原始像素点的残差值。
具体地,树形编码块(Coding Tree Block,CTB)可以为HEVC中的样点自适应补偿技术(Sample Adaptive Offset,SAO)中的树形编码单元(Coding Tree Unit,CTU)所包含的亮度CTB或者色度CTB。一个树形编码快由多个重构像素点组成。
需要说明的是,重构像素点指的是对原始图像中的各个像素点进行还原后得到的像素点。
其中,每一个重构像素点与对应的原始像素点的残差值diff指的是重构像素点的像素值a与对应的原始像素点的像素值b之差,即diff=a-b。
可以理解的是,本发明实施例中,为了节省数据处理时间,可以预先计算出树形编码块中的所有重构像素点的残差值,而不用在需要使用残差值才计算。
步骤S22,遍历树形编码块中属于非边界部分的所有的第一重构像素点,并计算遍历出的每一个第一重构像素点在4种方向下的边界补偿模式的类别,其中,所述4种方向包括水平方向、垂直方向、135°方向与45°方向。
具体地,所述非边界部分是相对于边界部分来说的,其中,边界部分指的是所述树形编码块中的最上一行,最下一行,最左一列和最右一列,相应的,非边界部分指的是所述树形编码块中除了该最上一行,最下一行,最左一列和最右一列之外的部分。
在本实施例中,非边界部分的所有的第一重构像素点指的是所述树形编码块中除了该最上一行的像素点,最下一行的像素点,最左一列的像素点和最右一列的像素点之外的所有像素点。
其中,边界补充(Edge Offset,EO)模式具体可以分为4种方向的边界补偿模式,分别为水平方向(E00)、垂直方向(E01)、135°方向(E02)和45°方向(E03)的边界补偿模式。
作为示例,这4种方向的边界补偿模式如图3所示,在图3中,c表示当前待计算的重构像素点,a、b表示当前待计算的重构像素点的参考像素点。
对于每一种边界补偿模式,都可以将树形编码块中每一个重构像素点分为5个不同的类别,分别为category0、category1、category2、category3、category4,即类别0、类别1、类别2、类别3及类别4。其中,类别1表示当前待计算的重构像素点的像素值均小于两参考像素点的像素值,这种类别属于Positive offset,补偿值要大于或等于0;类别2表示当前待计算的重构像素点的像素值等于一个参考像素点的像素值,且小于另一个参考像素点的像素值,这种类别属于Positive offset,补偿值要大于或等于0;类别3表示当前待计算的重构像素点的像素值等于一个参考像素点的像素值,且大于另一个参考像素点的像素值,这种类别属于Negative offset,补偿值要小于或等于0;类别4表示当前待计算的重构像素点的像素值均大于两参考像素点的像素值,这种类别属于Negative offset,补偿值要小于或等于0;类别0表示当前待计算的重构像素点的像素值属于上述4种情况之外,属于这种类别的重构像素点不需要进行像素补偿。
本实施例中在遍历出每一个第一重构像素点之后,可以通过一个预设的函数一次性计算该第一重构像素点在4种方向下的边界补偿模式的类别,而无需通过多个函数完成对各个方向下的边界补充模型的类别计算。
步骤S23,遍历树形编码块中属于边界部分的所有的第二重构像素点,并计算遍历出的每一个第二重构像素点在单一方向下的边界补偿模式的类别。
具体地,由于位于边界部分的像素点只存在一种方向下的边界补偿模式,因此,在计算每一个第二重构像素点的类别时,只需要计算第二像素点在对应方向下的边界补偿模式的类别。比如,若当前待计算的第二重构像素点为边界部分中的最上一行的像素点,由于位于该最上一行的像素点只存在水平方向(E00)下的边界补偿模式,因此,对于位于最上一行的第二重构像素点即可以只计算水平方向下的边界补偿模式的类别;若当前待计算的第二重构像素点为边界部分中的最下一行的像素点,由于位于该最下一行的像素点也只存在水平方向下的边界补偿模式,因此,对于位于最下一行的第二重构像素点即可以只计算水平方向下的边界补偿模式的类别;若当前待计算的第二重构像素点为边界部分中的最左一行的像素点,由于位于该最左一行的像素点也只存在垂直方向(E01)下的边界补偿模式,因此,对于位于最左一行的第二重构像素点即可以只计算垂直方向下的边界补偿模式的类 别;若当前待计算的第二重构像素点为边界部分中的最右一行的像素点,由于位于该最右一行的像素点也只存在垂直方向(E01)下的边界补偿模式,因此,对于位于最右一行的第二重构像素点即可以只计算垂直方向下的边界补偿模式的类别。
可以理解的是,对于位于边界部分的第二像素点在其他方向下的边界补偿模式的类别则可以不计算,或者为了保证所有的像素点都存在4种方向下的边界补偿模式的类别,对于位于边界部分的第二像素点在其他方向下的边界补偿模式的类别则可以采用预设数值进行表示,可以理解的是所述预设数值不能和代表边界补偿模式的类别的数值相同。
步骤S24,根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点的在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值,以及统计不同类别下的重构像素点的累加数量。
具体地,所述累加残差值为在各个方向下的边界补偿模式的属于相同类别下的所有重构像素点与其对应的原始像素点的残差值的累加和。也就是说,所述累加残差值包括属于EOO模式下的类别0的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EOO模式下的类别1的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EOO模式下的类别2的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EOO模式下的类别3的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EOO模式下的类别4的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO1模式下的类别0的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO1模式下的类别1的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO1模式下的类别2的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO1模式下的类别3的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO1模式下的类别4的所有重构像素点与其对应的原始像素点的残差值的累加和;属于EO2模式下的类别0的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO2模式下的类别1的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO2模式下的类别2的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO2模式下的类别3的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO2模式下的类别4的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO3模式下的类别0的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO3模式下的类别1的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO3模式下的类别2的所有重构像素点与其对应的原始像素点的残差值的累加和、属于EO3模式下的类别3的所有重构 像素点与其对应的原始像素点的残差值的累加和、属于EO3模式下的类别4的所有重构像素点与其对应的原始像素点的残差值的累加和。
所述累加数量为各种方向下的边界补偿模式的属于同一类别下的所有重构像素点的数量,比如,属于EOO模式下的类别0的重构像素点存在8个,所述累加数量即为8;属于EO1模式下的类别2的重构像素点存在5个,所述累加数量即为5。
本实施例中,在计算累加残差值时,可以先找出属于各个EO模式下的各个类别的重构像素点,然后从计算出的残差值中找到与该找到的像素点所对应的残差值,最后将所有的残差值进行累加,得到属于该EO模式下的类别x(x为0、1、2、3或4)的累加残差值,同时统计像素点的数量。
作为示例,假设属于EOO模式下的类别0的重构像素点存在8个,且这8个重构像素点与其对应的原始像素点的残差值分别为5、8、7、6、4、3、12、9,则所述累加残差值=5+8+7+6+4+3+12+9=54,所述累加数量即为8属于EO1模式下的类别2的重构像素点存在5个,且这5个重构像素点与其对应的原始像素点的残差值分别为5、8、7、6、4、,则所述累加残差值=5+8+7+6+4=30,所述累加数量即为5。
本申请实施例中,通过遍历树形编码块中所有的重构像素点,并计算每一个重构像素点与对应的原始像素点的残差值;遍历树形编码块中属于非边界部分的所有的第一重构像素点,并计算遍历出的每一个第一重构像素点在4种方向下的边界补偿模式的类别,其中,所述4种方向包括水平方向、垂直方向、135°方向与45°方向;遍历树形编码块中属于边界部分的所有的第二重构像素点,并计算遍历出的每一个第二重构像素点在单一方向下的边界补偿模式的类别;根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点的在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值,以及统计不同类别下的重构像素点的累加数量。在本申请实施例中,通过一次计算每一个重构像素点在4种方向下的边界补偿模式的类别,从而可以只需要花费稍多以前1/4的时间,即可完成每一个重构像素点在4种方向下的边界补偿模式的类别的计算,极大的减少了计算耗时。
经过实验统计,通过本申请的计算方法,EO模块可以加速大约32.8%,并在应用于直播场景下时可以加速大约3.28%,降低直播延时。
在一示例性的实施方式中,参照图4,所述根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值的步骤可以包括步骤S40-S42,其中:
步骤S40,遍历所有的第一重构像素点,并将每一个第一重构像素点在4个方向下的边界补偿模式的类别拼接存储到一个变量中。
具体地,每一个第一重构像素点在每个EO方向的类别可以用m个比特表示,由于类别总共只存在5种,因此,在本实施例中,m的最小取值可以为3,即最少可以采用3比特数值表示5种类别,这样,每个像素点的4个EO方向的类别只需要12个比特就可以完全表示。
可以理解的是,由于在计算机系统中,采用12位比特表示一个数据,在处理过程中不方便,因此,在本实施例中,为了后续可以方便对类别数据进行处理,m取值优选为4,即采用16个比特数值来表示重构像素点在每一个EO的四个方向的类别;当然,在本申请其他实施方式中,m也可以取8,用32比特数值来表示每一个EO的四个方向的类别。在本实施方式中,并不对m的取值进行限定。
作为示例,当m取值为4时,即可以将每一个第一重构像素点在4个方向下的边界补偿模式的类别拼接到一个16位的变量中,比如,拼接存储到16位的变量et中。需要说明的是,该变量可以为全局变量,也可以为局部变量,在本实施例中不作限定。
步骤S41,从所述变量中获取每一个第一重构像素点在4种方向下的边界补偿模式的类别。
具体地,由于变量中包含有拼接后的每一个第一重构像素点在4种方向下的边界补偿模式的类别,因此,在需要类别信息时,可以直接从提取出来。
步骤S42,根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值。
具体地,该步骤与上述步骤S23相同,在本实施例中不再赘述。
本实施例中,通过将每一个第一重构像素点的4个EO模式的类别值组合到一个变量中,从而可以减少存储和传输的数据量。
在一示例性的实施方式中,所述根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值还可以包括:
遍历所有的第二重构像素点,并将每一个第二重构像素点在单一方向下的边界补偿模式的类别拼接存储到所述变量中,其中,采用预设值表示所述每一个第二重构像素点在其他方向上的边界补偿模式的类别。
具体地,为了便于后续对所有的重构像素点的类别信息进行处理,本实施例中,也可 以对只存在单一方向下的边界补偿模式的第二重构像素点拼接成与第一重构像素点具有相同位数的数值的类别信息,并将拼接后的类别信息也存储至所述变量中。
其中,所述单一方向指的是当前的第二重构像素点所具有的EO模式,具体而言,若当前的第二重构像素点为最上一行或最下一行的像素点,则所述单一方向指的是水平方向(EOO);若当前的第二重构像素点为最左一行或最右一行的像素点,则所述单一方向指的是垂直方向(EO1)。
其中,所述其他方向指的是当前的第二重构像素点除了具有的单一方向之外的方向,具体而言,若当前的第二重构像素点为最上一行或最下一行的像素点,则所述其他方向指的是垂直方向(EO1)、135°方向(E02)和45°方向(E03);若当前的第二重构像素点为最左一行或最右一行的像素点,则所述其他方向指的是水平方向(EOO)、135°方向(E02)和45°方向(E03);
作为示例,假设每一种类别采用4个比特表示,且变量中的第1位到第4位表示EOO模式的类别、变量中的第5位到第8位表示EO1模式的类别、变量中的第9位到第12位表示EO2模式的类别、变量中的第13位到第16位表示EO3模式的类别,则在进行类别拼接时,可以将每一个第二重构像素点在单一方向的边界补偿模式的类别拼接到变量中的对应位置中,然后将变量中的其他位置添加预设值。比如,该类别为第二重构像素点在EOO模式的类别,则可以将表示类别的数值添加至变量中的第1位到第4位,将该变量中的其他位以预设值进行表示。又比如,类别为第二重构像素点在EO1模式的类别,则可以将表示类别的数值添加至变量中的第5位到第8位,将该变量中的其他位也以预设值进行表示。
需要说明的是,所述预设值为预先设定的或者默认的数值,该预设值需要各个类别对应的数值不同,比如,5种类别对应的数值分别为0、1、2、3、4,则所述预设值可以为5、6、7、8等。
所述从所述变量中获取每一个第一重构像素点在4种方向下的边界补偿模式的类别包括:
从所述变量中获取所有的重构像素点在4种方向下的边界补偿模式的类别。
具体地,在变量中包含有第一重构像素点和第二重构像素点的类别时,则在需要获取类别时,即可以从所述变量中获取所有的重构像素点在4种方向下的边界补偿模式的类别。
在一示例性的实施方式中,所述从所述变量中获取所有的重构像素点在4种方向下的边界补偿模式的类别的步骤可以包括:将所述变量与预设的16位比特数值做与运算,并将运算结果作为所述变量中存储的每一个重构像素点在一种方向下的边界补偿模式的类别;
将所述变量移位4位,得到更新后的变量;
将更新后的变量与预设的16位比特数值做与运算,并将运算结果作为所述每一个重构像素点在另一种方向下的边界补偿模式的类别;
返回执行将所述变量移位4位,得到更新后的变量的步骤,直到得到每一个重构像素点在所有方向下的边界补偿模式的类别。
具体地,所述预设的16位比特数值可以为0x000f,也可以为0xf000。
作为示例,当所述预设的16位比特数值为0x000f时,可以将变量et和0x000f做‘&(与)’运算,以获取原始变量et的低4位,得到变量et中的每个重建像素点的EO0模式下的类别,之后可以分别统计EO0模式下的各类别的累加残差值和累加数量。在完成EO0模式下的各个类别的累加残差值和累加数量之后,可以将变量et进行右移4位,之后,将移位后的变量et和0x000f做‘&’操作,以获取原始变量et的第5到第8位,得到变量et中的每个重建像素点的EO1的类别,之后可以分别统计EO1模式下的各类别的累加残差值和累加数量。在完成EO1模式下的各个类别的累加残差值和累加数量之后,可以继续将变量et进行右移4位,之后,将移位后的变量et和0x000f做‘&’操作,以获取原始变量et的第9到第12位,得到变量et中的每个重建像素点的EO2的类别,之后可以分别统计EO2模式下的各类别的累加残差值和累加数量。在完成EO2模式下的各个类别的累加残差值和累加数量之后,可以继续将变量et进行右移4位,之后,将移位后的变量et和0x000f做‘&’操作,以获取原始变量et的第13到第16位,即高4位,得到变量et中的每个重建像素点的EO3的类别,之后可以分别统计EO3模式下的各类别的累加残差值和累加数量。
在一示例性的实施方式中,当预设的16位比特数值为0x000f,所述将所述变量移位4位,得到更新后的变量包括:
将所述变量右移位4位,得到更新后的变量。
作为示例,变量中包含的一个类别为0x378B,则右移位后的类别为0x0378。
可以理解的是,在进行移位处理时,需要对变量中包含的所有的类别进行移位处理。
在一示例性的实施方式中,当所述预设的16位比特数值为0xf000,所述所述将所述变量移位4位,得到更新后的变量包括:
将所述变量左移位4位,得到更新后的变量。
作为示例,变量中包含的一个类别为0x378B,则左移位后的类别为0x78B0。
可以理解的是,在进行移位处理时,需要对变量中包含的所有的类别进行移位处理。
在一示例性的实施方式中,所述根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值的步骤包括:
根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的除预设的类别之外的所有类别下的重构像素点的累加残差值。
具体地,所述预设的类别为上述实施例中的类别0。在本实施例中,由于对于属于类别0的重构像素点不需要进行像素补偿,也就是说,对于属于类别0的重构像素点的累加残差值的计算和累加数量的统计结果是无用的,因此,在本实施例中,为了减少计算量,在对累加残差值的计算时,可以只计算除类别0之外的所有类别的累加残差值,而对属于类别0的重构像素点的累加残差值不进行计算。
参阅图5所示,是本申请样点自适应补偿的边界补偿模式的数据处理装置50一实施例的程序模块图。
本实施例中,所述样点自适应补偿的边界补偿模式的数据处理装置50包括一系列的存储于存储器上的计算机可读指令,当该计算机可读指令被处理器执行时,可以实现本申请各实施例的样点自适应补偿的边界补偿模式的数据处理功能。在一些实施例中,基于该计算机可读指令各部分所实现的特定的操作,样点自适应补偿的边界补偿模式的数据处理装置50可以被划分为一个或多个模块。例如,在图5中,所述样点自适应补偿的边界补偿模式的数据处理装置50可以被分割成获取模块51、第一遍历模块52、第二遍历模块53、第三遍历模块54、计算模块55。其中:
获取模块51,用于获取目标重构图像,将所述目标重构图像划分为多个互不重叠的树形编码块;
第一遍历模块52,用于对于每一个树形编码块,遍历树形编码块中所有的重构像素点,并计算每一个重构像素点与对应的原始像素点的残差值;
第二遍历模块53,用于遍历树形编码块中属于非边界部分的所有的第一重构像素点,并计算遍历出的每一个第一重构像素点在4种方向下的边界补偿模式的类别,其中,所述4种方向包括水平方向、垂直方向、135°方向与45°方向;
第三遍历模块54,用于遍历树形编码块中属于边界部分的所有的第二重构像素点,并计算遍历出的每一个第二重构像素点在单一方向下的边界补偿模式的类别;
计算模块55,用于根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点的在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值,以及统计不同类别下的重构像素点的累加数量。
在一示例性的实施方式中,计算模块55,还用于遍历所有的第一重构像素点,并将每 一个第一重构像素点在4个方向下的边界补偿模式的类别拼接存储到一个变量中;从所述变量中获取每一个第一重构像素点在4种方向下的边界补偿模式的类别;根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值。
在一示例性的实施方式中,计算模块55,还用于遍历所有的第二重构像素点,并将每一个第二重构像素点在单一方向下的边界补偿模式的类别拼接存储到所述变量中,其中,采用预设值表示所述每一个第二重构像素点在其他方向上的边界补偿模式的类别。
计算模块55,还用于从所述变量中获取所有的重构像素点在4种方向下的边界补偿模式的类别。
在一示例性的实施方式中,所述类别包括5种,每一种类别采用4个比特表示,每一个重构像素点在4种方向下的边界补偿模式的类别采用16个比特表示。
在一示例性的实施方式中,计算模块55,还用于将所述变量与预设的16位比特数值做与运算,并将运算结果作为所述变量中存储的每一个重构像素点在一种方向下的边界补偿模式的类别;将所述变量移位4位,得到更新后的变量;将更新后的变量与所述预设的16位比特数值做与运算,并将运算结果作为所述每一个重构像素点在另一种方向下的边界补偿模式的类别;返回执行将所述变量移位4位,得到更新后的变量的步骤,直到得到每一个重构像素点在所有方向下的边界补偿模式的类别。
在一示例性的实施方式中,所述预设的16位比特数值为0x000f,计算模块55,还用于将所述变量右移位4位,得到更新后的变量。
在一示例性的实施方式中,所述预设的16位比特数值为0xf000,计算模块55,还用于将所述变量左移位4位,得到更新后的变量。
本申请实施例中,通过遍历树形编码块中所有的重构像素点,并计算每一个重构像素点与对应的原始像素点的残差值;遍历树形编码块中属于非边界部分的所有的第一重构像素点,并计算遍历出的每一个第一重构像素点在4种方向下的边界补偿模式的类别,其中,所述4种方向包括水平方向、垂直方向、135°方向与45°方向;遍历树形编码块中属于边界部分的所有的第二重构像素点,并计算遍历出的每一个第二重构像素点在单一方向下的边界补偿模式的类别;根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点的在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值,以及统计不同类别下的重构像素点的累加数量。在本申请实施例中,通过一次计算每一个重构像素点在4种方向下 的边界补偿模式的类别,从而可以只需要花费稍多以前1/4的时间,即可完成每一个重构像素点在4种方向下的边界补偿模式的类别的计算,极大的减少了计算耗时。
图6示意性示出了根据本申请实施例的适于实现样点自适应补偿的边界补偿模式的数据处理方法的计算机设备10的硬件架构示意图。本实施例中,计算机设备10是一种能够按照事先设定或者存储的指令,自动进行数值计算和/或信息处理的设备。例如,可以是平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。如图6所示,计算机设备10至少包括但不限于:可通过系统总线相互通信链接存储器120、处理器121、网络接口122。其中:
存储器120至少包括一种类型的计算机可读存储介质,该可读存储介质可以是易失性的,也可以是非易失性的,具体而言,可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器120可以是计算机设备10的内部存储模块,例如该计算机设备10的硬盘或内存。在另一些实施例中,存储器120也可以是计算机设备10的外部存储设备,例如该计算机设备10上配备的插接式硬盘,智能存储卡(Smart Media Card,简称为SMC),安全数字(Secure Digital,简称为SD)卡,闪存卡(Flash Card)等。当然,存储器120还可以既包括计算机设备10的内部存储模块也包括其外部存储设备。本实施例中,存储器120通常用于存储安装于计算机设备10的操作系统和各类应用软件,例如样点自适应补偿的边界补偿模式的数据处理方法的程序代码等。此外,存储器120还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器121在一些实施例中可以是中央处理器(Central Processing Unit,简称为CPU)、控制器、微控制器、微处理器、或其它样点自适应补偿的边界补偿模式的数据处理芯片。该处理器121通常用于控制计算机设备10的总体操作,例如执行与计算机设备10进行数据交互或者通信相关的控制和处理等。本实施例中,处理器121用于运行存储器120中存储的程序代码或者处理数据。
网络接口122可包括无线网络接口或有线网络接口,该网络接口122通常用于在计算机设备10与其它计算机设备之间建立通信链接。例如,网络接口122用于通过网络将计算机设备10与外部终端相连,在计算机设备10与外部终端之间的建立数据传输通道和通信链接等。网络可以是企业内部网(Intranet)、互联网(Internet)、全球移动通讯系统(Global System of Mobile communication,简称为GSM)、宽带码分多址(Wideband Code Division  Multiple Access,简称为WCDMA)、4G网络、5G网络、蓝牙(Bluetooth)、Wi-Fi等无线或有线网络。
需要指出的是,图6仅示出了具有部件120~122的计算机设备,但是应理解的是,并不要求实施所有示出的部件,可以替代的实施更多或者更少的部件。
在本实施例中,存储于存储器120中的样点自适应补偿的边界补偿模式的数据处理方法可以被分割为一个或者多个程序模块,并由一个或多个处理器(本实施例为处理器121)所执行,以完成本申请。
本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质其上存储有计算机可读指令,计算机可读指令被处理器执行时实现实施例中的样点自适应补偿的边界补偿模式的数据处理方法的步骤。
本实施例中,计算机可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,计算机可读存储介质可以是计算机设备的内部存储单元,例如该计算机设备的硬盘或内存。在另一些实施例中,计算机可读存储介质也可以是计算机设备的外部存储设备,例如该计算机设备上配备的插接式硬盘,智能存储卡(Smart Media Card,简称为SMC),安全数字(Secure Digital,简称为SD)卡,闪存卡(Flash Card)等。当然,计算机可读存储介质还可以既包括计算机设备的内部存储单元也包括其外部存储设备。本实施例中,计算机可读存储介质通常用于存储安装于计算机设备的操作系统和各类应用软件,例如实施例中的样点自适应补偿的边界补偿模式的数据处理方法的程序代码等。此外,计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的各类数据。
以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到至少两个网络单元上。可以根据实际的需要筛选出其中的部分或者全部模块来实现本申请实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
通过以上的实施方式的描述,本领域普通技术人员可以清楚地了解到各实施方式可借助软件加通用硬件平台的方式来实现,当然也可以通过硬件。本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程是可以通过计算机可读指令来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上 述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-OnlyMemory,ROM)或随机存储记忆体(RandomAccessMemory,RAM)等。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (10)

  1. 一种样点自适应补偿的边界补偿模式的数据处理方法,包括:
    获取目标重构图像,将所述目标重构图像划分为多个互不重叠的树形编码块;
    对于每一个树形编码块,遍历树形编码块中所有的重构像素点,并计算每一个重构像素点与对应的原始像素点的残差值;
    遍历树形编码块中属于非边界部分的所有的第一重构像素点,并计算遍历出的每一个第一重构像素点在4种方向下的边界补偿模式的类别,其中,所述4种方向包括水平方向、垂直方向、135°方向与45°方向;
    遍历树形编码块中属于边界部分的所有的第二重构像素点,并计算遍历出的每一个第二重构像素点在单一方向下的边界补偿模式的类别;
    根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点的在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值及统计所述不同类别下的重构像素点的累加数量。
  2. 根据权利要求1所述的样点自适应补偿的边界补偿模式的数据处理方法,所述根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值包括:
    遍历所有的第一重构像素点,并将每一个第一重构像素点在4个方向下的边界补偿模式的类别拼接存储到一个变量中;
    从所述变量中获取每一个第一重构像素点在4种方向下的边界补偿模式的类别;
    根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值。
  3. 根据权利要求2所述的样点自适应补偿的边界补偿模式的数据处理方法,所述根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值还包括:
    遍历所有的第二重构像素点,并将每一个第二重构像素点在单一方向下的边界补偿模式的类别拼接存储到所述变量中,其中,采用预设值表示所述每一个第二重构像素点在其他方向上的边界补偿模式的类别;
    所述从所述变量中获取每一个第一重构像素点在4种方向下的边界补偿模式的类别包括:
    从所述变量中获取所有的重构像素点在4种方向下的边界补偿模式的类别。
  4. 根据权利要求3所述的样点自适应补偿的边界补偿模式的数据处理方法,所述类别包括5种,每一种类别采用4个比特表示,每一个重构像素点在4种方向下的边界补偿模式的类别采用16个比特表示,所述从所述变量中获取所有的重构像素点在4种方向下的边界补偿模式的类别包括:
    将所述变量与预设的16位比特数值做与运算,并将运算结果作为所述变量中存储的每一个重构像素点在一种方向下的边界补偿模式的类别;
    将所述变量移位4位,得到更新后的变量;
    将更新后的变量与所述预设的16位比特数值做与运算,并将运算结果作为所述每一个重构像素点在另一种方向下的边界补偿模式的类别;
    返回执行将所述变量移位4位,得到更新后的变量的步骤,直到得到每一个重构像素点在所有方向下的边界补偿模式的类别。
  5. 根据权利要求4所述的样点自适应补偿的边界补偿模式的数据处理方法,所述预设的16位比特数值为0x000f,所述将所述变量移位4位,得到更新后的变量包括:
    将所述变量右移位4位,得到更新后的变量。
  6. 根据权利要求4所述的样点自适应补偿的边界补偿模式的数据处理方法,所述预设的16位比特数值为0xf000,所述将所述变量移位4位,得到更新后的变量包括:
    将所述变量左移位4位,得到更新后的变量。
  7. 根据权利要求4至6任一项所述的样点自适应补偿的边界补偿模式的数据处理方法,所述根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值的步骤包括:
    根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的除预设的类别之外的所有类别下的重构像素点的累加残差值。
  8. 一种样点自适应补偿的边界补偿模式的数据处理装置,包括:
    获取模块,用于获取目标重构图像,将所述目标重构图像划分为多个互不重叠的树形编码块;
    第一遍历模块,用于对于每一个树形编码块,遍历树形编码块中所有的重构像素点, 并计算每一个重构像素点与对应的原始像素点的残差值;
    第二遍历模块,用于遍历树形编码块中属于非边界部分的所有的第一重构像素点,并计算遍历出的每一个第一重构像素点在4种方向下的边界补偿模式的类别,其中,所述4种方向包括水平方向、垂直方向、135°方向与45°方向;
    第三遍历模块,用于遍历树形编码块中属于边界部分的所有的第二重构像素点,并计算遍历出的每一个第二重构像素点在单一方向下的边界补偿模式的类别;
    计算模块,用于根据各个第一重构像素点在4种方向下的边界补偿模式的类别、各个第二重构像素点的在单一方向下的边界补偿模式的类别与各个残差值分别计算4种方向下的边界补偿模式的不同类别下的重构像素点的累加残差值,以及统计不同类别下的重构像素点的累加数量。
  9. 一种计算机设备,所述计算机设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现权利要求1至7任一项所述的样点自适应补偿的边界补偿模式的数据处理方法的步骤。
  10. 一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现权利要求1至7任一项所述的样点自适应补偿的边界补偿模式的数据处理方法的步骤。
PCT/CN2022/072846 2021-02-24 2022-01-20 样点自适应补偿的边界补偿模式的数据处理方法、装置 WO2022179354A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22758720.1A EP4246446A4 (en) 2021-02-24 2022-01-20 DATA PROCESSING METHOD AND APPARATUS FOR EDGE OFFSET MODE BASED ON SCANNING ADAPTIVE OFFSET
US18/336,874 US20230336723A1 (en) 2021-02-24 2023-06-16 Data processing in edge offset mode of sample adaptive offset

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110209617.4 2021-02-24
CN202110209617.4A CN112927324B (zh) 2021-02-24 2021-02-24 样点自适应补偿的边界补偿模式的数据处理方法、装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/336,874 Continuation US20230336723A1 (en) 2021-02-24 2023-06-16 Data processing in edge offset mode of sample adaptive offset

Publications (1)

Publication Number Publication Date
WO2022179354A1 true WO2022179354A1 (zh) 2022-09-01

Family

ID=76171703

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/072846 WO2022179354A1 (zh) 2021-02-24 2022-01-20 样点自适应补偿的边界补偿模式的数据处理方法、装置

Country Status (4)

Country Link
US (1) US20230336723A1 (zh)
EP (1) EP4246446A4 (zh)
CN (1) CN112927324B (zh)
WO (1) WO2022179354A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112927324B (zh) * 2021-02-24 2022-06-03 上海哔哩哔哩科技有限公司 样点自适应补偿的边界补偿模式的数据处理方法、装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110122950A1 (en) * 2009-11-26 2011-05-26 Ji Tianying Video decoder and method for motion compensation for out-of-boundary pixels
CN105141948A (zh) * 2015-09-22 2015-12-09 天津师范大学 一种改进的hevc样点自适应补偿方法
CN106131554A (zh) * 2016-07-07 2016-11-16 杭州电子科技大学 基于主要边缘方向的hevc快速样点自适应补偿方法
CN109963160A (zh) * 2017-12-26 2019-07-02 北京君正集成电路股份有限公司 基于hevc的简化sao最优补偿值计算方法和装置
CN112927324A (zh) * 2021-02-24 2021-06-08 上海哔哩哔哩科技有限公司 样点自适应补偿的边带补偿模式的数据处理方法、装置

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070070243A1 (en) * 2005-09-28 2007-03-29 Ali Corporation Adaptive vertical temporal flitering method of de-interlacing
CN106454357A (zh) * 2011-01-09 2017-02-22 寰发股份有限公司 已处理视频数据的样本自适应补偿的方法和装置
US9716882B2 (en) * 2012-01-05 2017-07-25 Google Technology Holdings LLC Devices and methods for sample adaptive offset coding and/or selection of edge offset parameters
US9031137B2 (en) * 2012-05-03 2015-05-12 Texas Instruments Incorporated Signaling signed band offset values for sample adaptive offset (SAO) filtering in video coding
US9826240B2 (en) * 2013-07-05 2017-11-21 Texas Instruments Incorporated High throughput VLSI architecture for HEVC SAO encoding
CN103810675B (zh) * 2013-09-09 2016-09-21 深圳市华星光电技术有限公司 图像超分辨率重构系统及方法
KR102276854B1 (ko) * 2014-07-31 2021-07-13 삼성전자주식회사 인루프 필터 파라미터 예측을 사용하는 비디오 부호화 방법 및 그 장치, 비디오 복호화 방법 및 그 장치
CN104219520B (zh) * 2014-09-10 2018-11-20 华为技术有限公司 确定图像补偿模式的方法和装置
US10841581B2 (en) * 2016-07-14 2020-11-17 Arris Enterprises Llc Region specific encoding and SAO-sensitive-slice-width-adaptation for improved-quality HEVC encoding

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110122950A1 (en) * 2009-11-26 2011-05-26 Ji Tianying Video decoder and method for motion compensation for out-of-boundary pixels
CN105141948A (zh) * 2015-09-22 2015-12-09 天津师范大学 一种改进的hevc样点自适应补偿方法
CN106131554A (zh) * 2016-07-07 2016-11-16 杭州电子科技大学 基于主要边缘方向的hevc快速样点自适应补偿方法
CN109963160A (zh) * 2017-12-26 2019-07-02 北京君正集成电路股份有限公司 基于hevc的简化sao最优补偿值计算方法和装置
CN112927324A (zh) * 2021-02-24 2021-06-08 上海哔哩哔哩科技有限公司 样点自适应补偿的边带补偿模式的数据处理方法、装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4246446A4

Also Published As

Publication number Publication date
EP4246446A4 (en) 2024-05-01
CN112927324B (zh) 2022-06-03
EP4246446A1 (en) 2023-09-20
US20230336723A1 (en) 2023-10-19
CN112927324A (zh) 2021-06-08

Similar Documents

Publication Publication Date Title
CN105917648B (zh) 具有非对称分区的帧内块复制预测以及编码器侧搜索图案、搜索范围和用于分区的方法
WO2022179355A1 (zh) 样点自适应补偿的边带补偿模式的数据处理方法、装置
EP3761646B1 (en) Context modelling method and device for partition flag bit
CN109344277B (zh) 图片处理方法、装置、介质和计算设备
US11308647B2 (en) Method and system for improving compression ratio by difference between blocks of image file
CN109670091B (zh) 一种基于数据标准的元数据智能维护方法和装置
WO2022179354A1 (zh) 样点自适应补偿的边界补偿模式的数据处理方法、装置
US11871004B2 (en) Video image processing method and device, and storage medium
CN112714338B (zh) 视频传输、播放方法、装置、计算机设备及存储介质
CN115209147B (zh) 摄像头视频传输带宽优化方法、装置、设备及存储介质
US11539955B2 (en) Method and system for improving compression ratio through pixel conversion of image file
CN113068050B (zh) 树形编码块的样点自适应补偿模式确定方法、装置
CN115643403A (zh) Av1的滤波方法及装置
CN116016937A (zh) 视频编码中的样点自适应补偿方法及装置
CN111010574B (zh) 图像压缩方法、装置和电子设备
CN114630114A (zh) 视频编码的帧内预测方法和装置、存储介质及电子设备
CN112738522A (zh) 视频编码方法、装置
CN111988612A (zh) 一种视频编码处理方法、装置及电子设备
CN112866692B (zh) 一种基于hevc的编码单元划分方法、装置及电子设备
CN113473150B (zh) 一种图像处理方法、装置以及计算机可读存储装置
WO2020258056A1 (zh) 一种视频图像处理方法、设备及存储介质
WO2024212190A1 (zh) 编解码方法及装置、编解码器、码流、设备、存储介质
US20140133771A1 (en) Electronic device and method for splitting image
CN116662401A (zh) 数据的检索方法、装置、设备及计算机可读存储介质
CN108429910B (zh) 图像压缩方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22758720

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022758720

Country of ref document: EP

Effective date: 20230613

NENP Non-entry into the national phase

Ref country code: DE