WO2024104504A1 - Image processing method and apparatus, and electronic device and storage medium - Google Patents

Image processing method and apparatus, and electronic device and storage medium Download PDF

Info

Publication number
WO2024104504A1
WO2024104504A1 PCT/CN2024/072113 CN2024072113W WO2024104504A1 WO 2024104504 A1 WO2024104504 A1 WO 2024104504A1 CN 2024072113 W CN2024072113 W CN 2024072113W WO 2024104504 A1 WO2024104504 A1 WO 2024104504A1
Authority
WO
WIPO (PCT)
Prior art keywords
sub
region
image
filtering
area
Prior art date
Application number
PCT/CN2024/072113
Other languages
French (fr)
Chinese (zh)
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 杭州海康威视数字技术股份有限公司
Publication of WO2024104504A1 publication Critical patent/WO2024104504A1/en

Links

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/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/186Methods 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 colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • H04N19/31Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability in the temporal domain
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • 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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/86Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving reduction of coding artifacts, e.g. of blockiness
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Definitions

  • the present application relates to the field of image processing, and in particular to an image processing method, device, electronic device and storage medium.
  • the purpose of filtering is to achieve smooth noise reduction and detail removal within the video image block, and to preserve the image edges to the greatest extent possible.
  • electronic devices filter the boundaries of multiple areas in the image to preserve the image edges.
  • different users have different viewing permissions for different areas in the image.
  • the electronic device will not filter the boundary between the high-authority area and the low-authority area during the video decoding process, resulting in poor image quality.
  • the present application provides an image processing method, device, electronic device and storage medium, which solve the problem that the image quality of different permission areas in the image is poor after decoding and filtering.
  • the present application provides an image processing method, which is executed by an electronic device, and includes: dividing an image to be processed into multiple image sub-regions, and obtaining an authority level for each image sub-region; if the authority levels of at least two adjacent image sub-regions among the multiple image sub-regions are different, filtering the adjacent boundaries between the at least two image sub-regions.
  • the electronic device divides the image to be processed into multiple image sub-regions, obtains the authority level of each image sub-region, and judges the authority level of each image sub-region. If the authority levels of at least two adjacent image sub-regions in the multiple image sub-regions are different, it means that the two image sub-regions may still not be filtered after filtering in the decoding process, and the quality of the image to be processed is not high. Therefore, based on the decoding information such as the division of the authority region, the electronic device performs filtering again on the adjacent boundaries between at least two image sub-regions, thereby improving the image quality of different authority regions in the image to be processed.
  • the permission levels include a first permission level, a second permission level, and a zero permission level; an image sub-region of the zero permission level is an image sub-region that can be viewed by any user.
  • the process before dividing the image to be processed into multiple image sub-regions and obtaining the permission level of each image sub-region, the process includes: receiving a decoded code stream of the image to be processed, decoding based on the decoded code stream, and obtaining the decoded image to be processed.
  • the filtering process includes at least one of: deblocking effect vertical filtering, deblocking effect horizontal filtering, sample adaptive compensation filtering, adaptive loop filtering and neural network filtering.
  • the filtering process includes vertical filtering for deblocking effects.
  • the filtering process for the boundary between at least two image sub-regions includes: determining a target area to be filtered on the vertical side of a first sub-region among the at least two image sub-regions; the vertical side is the left side or right side of the boundary between the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the right side of the boundary, an area to be filtered on the left side of the boundary, an area to be filtered on the right side of the boundary, and an area to be filtered on the left side of the boundary; and performing vertical filtering for deblocking effects on the target area to be filtered.
  • the at least two adjacent image sub-regions further include a second sub-region, and the second sub-region is horizontally adjacent to the first sub-region, where horizontal adjacent means that the second sub-region is located on the left or right side of the first sub-region in the horizontal direction.
  • the at least two adjacent image sub-regions have different authority levels, including: the authority level of the first sub-region is lower than the authority level of the second sub-region; or, the authority level of the first sub-region is higher than the authority level of the second sub-region; or, the authority level of the first sub-region is not equal to the authority level of the second sub-region; or, the authority level of the first sub-region is not equal to the authority level of the second sub-region, and the filtering strength of the adjacent boundaries is greater than or equal to the preset filtering strength.
  • the filtering process includes horizontal filtering for deblocking effects.
  • the filtering process for the boundary between at least two image sub-regions includes: determining a target area to be filtered on the horizontal side of a first sub-region among the at least two image sub-regions; the horizontal side is the upper side or the lower side of the boundary between the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the lower side of the boundary, an area to be filtered on the upper side of the boundary, an area to be filtered on the lower side of the boundary, and an area to be filtered on the upper side of the boundary; and performing horizontal filtering for deblocking effects on the target area to be filtered.
  • the at least two adjacent image sub-regions further include a third sub-region, and the third sub-region is vertically adjacent to the first sub-region, where vertical adjacent means that the third sub-region is located above or below the first sub-region in the horizontal direction.
  • the at least two adjacent image sub-regions have different authority levels, including: the authority level of the first sub-region is lower than the authority level of the third sub-region; or, the authority level of the first sub-region is higher than the authority level of the third sub-region; or, the authority level of the first sub-region is not equal to the authority level of the third sub-region; or, the authority level of the first sub-region is not equal to the authority level of the third sub-region, and the filtering strength of the adjacent boundaries is greater than or equal to the preset filtering strength.
  • the filtering process includes sample adaptive compensation filtering
  • the filtering process on the boundary between at least two image sub-regions includes: determining the target area to be filtered from the surrounding side of the first sub-region in the at least two image sub-regions according to the set filtering order; the surrounding side includes: the left side, the upper side, the right side and the lower side of the boundary between the first sub-region and the other sub-regions, the authority level of the first sub-region is different from the authority level of the other sub-regions, and the target area to be filtered is any one of the following: the first sub-region The first side area in the area compared to the connected boundary, the second side area outside the first sub-area compared to the connected boundary, the first side area and the second side area; according to the set filtering order, sample adaptive compensation filtering is performed on the target area to be filtered.
  • the filtering process includes adaptive loop filtering, and the above-mentioned filtering process is performed on the adjacent boundary between at least two image sub-regions, including: determining the target area to be filtered from the surrounding side of the first sub-region in the at least two image sub-regions according to the set filtering order; the surrounding side includes, in sequence: the left side, the top side, the right side and the bottom side of the adjacent boundary between the first sub-region and other sub-regions, the authority level of the first sub-region is different from the authority level of other sub-regions, and the target area to be filtered is any one of the following: the first side area within the first sub-region compared to the adjacent boundary, the second side area outside the first sub-region compared to the adjacent boundary, the first side area and the second side area; according to the set filtering order, the target area to be filtered is adaptively loop filtered.
  • based on the decoded information of the image to be processed it is determined whether a first sub-region of at least two image sub-regions needs to be subjected to neural network-based filtering processing; when the first sub-region needs to be subjected to neural network-based filtering processing, the reconstructed pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network; and the filtered reconstructed pixels of the first sub-region are obtained as output.
  • the reconstructed pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network, and the permission level of at least one image sub-region adjacent to the first sub-region is input into the neural network.
  • the electronic device may obtain information of an image sub-region that is lower than or equal to the user's authority level according to the user's authority level; the information of the image region includes pixel values of the image sub-region.
  • filtering processing is performed on the connecting boundary between the at least two image sub-regions, including: filtering processing of the brightness channel component of the connecting boundary between the at least two image sub-regions; or, filtering processing of the chrominance channel component of the connecting boundary between the at least two image sub-regions; or, filtering processing of the brightness channel component and the chrominance channel component of the connecting boundary between the at least two image sub-regions.
  • the present application provides an image processing device, which includes: an image division unit and an image filtering unit; the image division unit is used to divide the image to be processed into multiple image sub-regions; an image decoding unit is used to obtain the authority level of each image sub-region; and the image filtering unit is used to filter the adjacent boundaries between at least two image sub-regions if the authority levels of at least two adjacent image sub-regions among the multiple image sub-regions are different.
  • the permission level of each image sub-region is used to indicate: whether each image sub-region is a set permission region, and if each image sub-region is a permission region, the electronic device determines the permission level of each image sub-region; the permission level includes a first permission level and a second permission level.
  • the image decoding unit is further used to receive a decoded code stream of the image to be processed, perform decoding based on the decoded code stream, and obtain the decoded image to be processed.
  • the image filtering unit is further used to determine a target area to be filtered on the vertical side of a first sub-region among at least two image sub-regions; the vertical side is the left or right side of a connected boundary of the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the right side of the connected boundary, an area to be filtered on the left side of the connected boundary, an area to be filtered on the right side of the connected boundary, and an area to be filtered on the left side; the image filtering unit is further used to perform vertical filtering to remove blocking effects on the target area to be filtered.
  • the at least two adjacent image sub-regions further include a second sub-region, and the second sub-region is horizontally adjacent to the first sub-region, where horizontal adjacent means that the second sub-region is located on the left or right side of the first sub-region in the horizontal direction.
  • the at least two adjacent image sub-regions have different authority levels, including: the authority level of the first sub-region is lower than the authority level of the second sub-region; or the authority level of the first sub-region is higher than the authority level of the second sub-region; or the authority level of the first sub-region is not equal to the authority level of the second sub-region; or the authority level of the first sub-region is not equal to the authority level of the second sub-region, and the filtering strength of the adjacent boundaries is greater than or equal to the preset filtering strength.
  • the image filtering unit is further used to determine a target area to be filtered on the horizontal side of a first sub-region among at least two image sub-regions; the horizontal side is the upper side or the lower side of the adjacent boundary of the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the lower side of the adjacent boundary, an area to be filtered on the upper side of the adjacent boundary, an area to be filtered on the lower side of the adjacent boundary, and an area to be filtered on the upper side of the adjacent boundary; the image filtering unit is further used to perform horizontal filtering to remove blocking effects on the target area to be filtered.
  • the at least two adjacent image sub-regions further include a third sub-region, and the third sub-region is vertically adjacent to the first sub-region, where vertical adjacent means that the third sub-region is located on the upper side or the lower side of the first sub-region in the horizontal direction.
  • the at least two adjacent image sub-regions have different authority levels, including: the authority level of the first sub-region is lower than the authority level of the third sub-region; or the authority level of the first sub-region is higher than the authority level of the third sub-region; or the authority level of the first sub-region is not equal to the authority level of the third sub-region; or the authority level of the first sub-region is not equal to the authority level of the third sub-region, and the filtering strength of the adjacent boundaries is greater than or equal to the preset filtering strength.
  • the image filtering unit is further used to determine the target area to be filtered from the surrounding side of the first sub-region of at least two image sub-regions according to the set filtering order;
  • the surrounding side includes: the left side, the upper side, the right side and the lower side of the boundary between the first sub-region and the other sub-regions, the authority level of the first sub-region is different from the authority level of the other sub-regions, and the target area to be filtered is as follows Any one: the first side area within the first sub-area compared to the connected boundary, the second side area outside the first sub-area compared to the connected boundary, the first side area and the second side area; the image filtering unit is also used to perform sample adaptive compensation filtering on the target area to be filtered according to the set filtering order.
  • the image filtering unit is also used to determine the target area to be filtered from the surrounding side of the first sub-region in at least two image sub-regions according to a set filtering order;
  • the surrounding side includes, in sequence: the left side, top side, right side and bottom side of the boundary between the first sub-region and other sub-regions, the authority level of the first sub-region is different from the authority level of other sub-regions, and the target area to be filtered is any one of the following: the first side area in the first sub-region compared to the connected boundary, the second side area outside the first sub-region compared to the connected boundary, the first side area and the second side area; the image filtering unit is also used to perform adaptive loop filtering on the target area to be filtered according to the set filtering order.
  • the image filtering unit is also used to determine whether it is necessary to perform neural network-based filtering processing on the first sub-region of at least two image sub-regions based on the decoded information of the image to be processed; when the first sub-region needs to perform neural network-based filtering processing, the reconstructed pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network; and the filtered reconstructed pixels of the first sub-region are obtained as output.
  • the image filtering unit is further used to input the authority level of at least one image sub-region adjacent to the first sub-region into the neural network.
  • the image filtering unit is further used to filter the brightness channel component of the adjacent boundary between at least two image sub-regions; or, to filter the chrominance channel component of the adjacent boundary between at least two image sub-regions; or, to filter the brightness channel component and the chrominance channel component of the adjacent boundary between at least two image sub-regions.
  • the present application provides an electronic device, comprising: a memory and a processor; the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions; wherein, when the processor executes the computer instructions, the image processing device executes the image processing method as in the first aspect and any possible implementation thereof.
  • the present application provides a computer-readable storage medium, which includes: computer software instructions; when the computer software instructions are executed in an image processing device, the image processing device implements the image processing method of the first aspect and any possible implementation method thereof.
  • the present application provides a computer program product, which, when executed on an image processing device, enables the image processing device to execute the image processing method of the first aspect and any possible implementation thereof.
  • the beneficial effects of the second to fifth aspects can be referred to the corresponding description of the first aspect, and will not be repeated here.
  • FIG1 is a schematic diagram of an image processing flow framework provided by the present application.
  • FIG2 is a schematic diagram of a region for deblocking filtering provided by the present application.
  • FIG3 is a schematic diagram of a filter block boundary provided by the present application.
  • FIG4 is a schematic diagram of a filter provided by the present application.
  • FIG5 is a schematic diagram of the structure of an image processing device provided by the present application.
  • FIG6 is a schematic diagram of a flow chart of an image processing method provided by the present application.
  • FIG7 is a schematic diagram of a detection area provided by the present application.
  • FIG8 is a schematic diagram of a flow chart of another image processing method provided by the present application.
  • FIG9 is a schematic diagram of a filtering area provided by the present application.
  • FIG10 is a schematic diagram of another filtering area provided by the present application.
  • FIG11 is a schematic diagram of a flow chart of another image processing method provided by the present application.
  • FIG12 is a schematic diagram of another filtering area provided by the present application.
  • FIG13 is a schematic diagram of a flow chart of another image processing method provided by the present application.
  • FIG14 is a schematic diagram of another filtering area provided by the present application.
  • FIG15 is a schematic diagram of a flow chart of another image processing method provided by the present application.
  • FIG16 is a schematic diagram of another filtering area provided by the present application.
  • FIG17 is a schematic diagram of a flow chart of another image processing method provided by the present application.
  • FIG18 is a schematic diagram of a flow chart of another image processing method provided by the present application.
  • FIG19 is a schematic diagram of the hardware structure of an electronic device provided in this application.
  • words such as “first” and “second” are used to distinguish between identical items or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as “first” and “second” do not limit the quantity and execution order.
  • Deblocking filter used to remove the block boundary effect caused by block coding, including vertical deblocking filter and horizontal deblocking filter.
  • Sample adaptive offset By classifying the pixel values of the samples and the gradient values of the surrounding blocks, different compensation values are added to the pixel values of each category, so that the reconstructed image is closer to the original image.
  • the basic principle of SAO is to add negative values to compensate the peak pixels in the reconstructed curve and add positive values to supplement the trough pixels.
  • SAO uses the Collect Transfer unit (CTU) as the basic unit, including two major types of compensation: edge compensation (EO) and sideband compensation (BO).
  • CTU Collect Transfer unit
  • EO edge compensation
  • BO sideband compensation
  • Sample offset compensation filtering includes basic sample value offset compensation (the above-mentioned SAO), enhanced sample value offset compensation (ESAO), and cross-component sample value offset compensation (CCSAO, only for chroma).
  • Adaptive loop filter The reconstructed image is enhanced and filtered through the Wiener filter to make the reconstructed image closer to the original image.
  • the adaptive loop filter can enable the enhanced adaptive correction filter (EALF).
  • Neural Network A neural network is a computational model consisting of a large number of interconnected nodes (or neurons).
  • a neuron processing unit can represent different objects, such as features, letters, concepts, or some meaningful abstract patterns.
  • the types of processing units in the network are divided into three categories: input units, output units, and hidden units.
  • the input unit receives signals and data from the outside world; the output unit realizes the output of the system processing results; the hidden unit is a unit between the input and output units that cannot be observed from outside the system.
  • the connection weights between neurons reflect the connection strength between units, and the representation and processing of information are reflected in the connection relationship of the network processing units.
  • Artificial neural network is a non-programmed, brain-like information processing method.
  • CNN convolutional neural networks
  • RNN recurrent neural networks
  • video coding generally includes processes such as prediction, transformation, quantization, and entropy coding. Furthermore, the coding process can also be implemented according to the framework in FIG. 1 .
  • prediction can be divided into intra-frame prediction and inter-frame prediction.
  • Intra-frame prediction uses the surrounding coded blocks as references to predict the current uncoded block, effectively removing redundancy in the spatial domain.
  • Inter-frame prediction uses the neighboring coded images to predict the current image, effectively removing redundancy in the temporal domain.
  • Transformation refers to converting an image from the spatial domain to the transform domain, and using transform coefficients to represent the image. Most images contain many flat areas and slowly changing areas. Appropriate transformation can transform the image from a dispersed distribution in the spatial domain to a relatively concentrated distribution in the transform domain, remove the frequency domain correlation between signals, and cooperate with the quantization process to effectively compress the bit stream.
  • Entropy coding is a lossless coding method that can transform a series of element symbols into a binary code stream for transmission or storage.
  • the input symbols may include quantized transform coefficients, motion vector information, prediction mode information, transform quantization related syntax, etc. Entropy coding can effectively remove the redundancy of video element symbols.
  • the above is an introduction based on encoding as an example.
  • the process of video decoding is relative to that of video encoding, that is, video decoding usually includes entropy decoding, prediction, inverse quantization, inverse transformation, filtering and other processes.
  • the implementation principles of each process are the same or similar to entropy encoding.
  • filtering processing includes deblocking filtering, sample adaptive compensation filtering, adaptive loop filtering and filtering based on neural network.
  • DBF filtering processing includes two processes: filtering decision and filtering operation.
  • the filtering decision includes: 1) obtaining the boundary filter strength (BS value); 2) filtering switch decision; 3) filtering strength selection.
  • BS value boundary filter strength
  • filtering switch decision For chroma, only step 1) exists, and the BS value of brightness is directly reused.
  • chroma filtering is performed only when the BS value is 2 (that is, at least one of the image areas on both sides adopts intra mode).
  • the filtering operations include: 1) strong filtering and weak filtering for luminance; 2) filtering for chrominance.
  • Condition 1 If the boundary to be filtered is an image boundary, then the boundary does not need to be filtered.
  • Condition 3 If the boundary to be filtered is a luminance filtering boundary, and the luminance filtering boundary is not a boundary of a luminance coding block or a luminance transform block, then the boundary does not need to be filtered.
  • Condition 4 If the boundary to be filtered is a chroma filter boundary, and the chroma filter boundary is not a boundary of a chroma coding block or a chroma transform block, and the luminance filter boundary corresponding to the chroma filter boundary is not a boundary of a luminance coding block, then the boundary does not need to be filtered.
  • Condition 5 If the boundary to be filtered is a luminance filtering boundary, and the sub-block transform flag of the coding unit where the luminance filtering boundary is located is 1, and the luminance filtering boundary is not a boundary of a luminance coding block, then the boundary does not need to be filtered.
  • DBF filtering generally performs deblocking vertical filtering and deblocking horizontal filtering in units of 8x8, and DBF filtering filters at most 3 pixels on both sides of the border of the current block (image area to be filtered), and uses at most 4 pixels on both sides of the border for filtering, so vertical/horizontal filtering of different blocks does not affect each other and can be performed in parallel.
  • vertical filtering is first performed on the 3 columns on the left side of the current block and the 3 columns on the right side of the left block, and then horizontal filtering is performed on the 3 rows on the upper side of the current block and the 3 rows on the lower side of the upper block.
  • a schematic diagram of the vertical side connecting boundary (vertical boundary) and the horizontal side connecting boundary (horizontal boundary) of the current block is shown, and the 8 pixel samples on both sides of the vertical boundary/horizontal boundary are recorded as p 0 , p 1 , p 2 , p 3 and q 0 , q 1 , q 2 , q 3 respectively.
  • the boundary filter strength BS value is calculated for the pixel points of the current block, that is, the boundary is the boundary of the pixel points of the current block, rather than the boundary of the current luminance block or the current chrominance block.
  • Boundary filter strength determination method 1
  • the boundary filter strength BS value is equal to 0.
  • the quantization coefficients of the transform blocks of the coding units where p 0 and q 0 are located are all 0. If p 0 (or q 0 ) is a luma sample and the coding unit where p 0 (or q 0 ) is located only contains luma samples, then the coding unit where p 0 (or q 0 ) is located refers to the luma coding unit containing p 0 (or q 0 ); if p 0 (or q 0 ) is a chroma sample and the coding unit where p 0 (or q 0 ) is located only contains chroma samples, then the coding unit where p 0 (or q 0 ) is located refers to the coding unit containing the luma sample corresponding to p 0 (or q 0 ); otherwise (i.e., the coding unit where p 0 or q 0 is located contains both luma samples and chrom
  • the prediction type of the coding unit where p 0 and q 0 are located is not intra frame.
  • BP and BQ be the 4 ⁇ 4 luminance coding blocks where p0 and q0 are located respectively, and the motion information of BP and BQ satisfies the following conditions 1 and 2 at the same time or satisfies conditions 3, 4 and 5 at the same time.
  • the L0 reference indexes of the spatial motion information storage units corresponding to BP and BQ are both equal to -1, or the reference frames corresponding to the L0 reference indexes of the spatial motion information storage units corresponding to BP and BQ are the same frame and the differences of all components of the L0 motion vectors of the spatial motion information storage units are less than an integer pixel.
  • the L1 reference indexes of the spatial motion information storage units corresponding to BP and BQ are both equal to -1, or the reference frames corresponding to the L1 reference indexes of the spatial motion information storage units corresponding to BP and BQ are the same frame and the differences of all components of the L1 motion vectors of the spatial motion information storage units are less than an integer pixel.
  • the L0 reference index of the spatial motion information storage unit corresponding to BP is equal to -1 and the L1 reference index of the spatial motion information storage unit corresponding to BQ is equal to -1.
  • the reference frame corresponding to the L0 reference index of the spatial motion information storage unit corresponding to BP and the reference frame corresponding to the L1 reference index of the spatial motion information storage unit corresponding to BQ are the same frame, and the differences between all components of the L0 motion vector of the spatial motion information storage unit corresponding to BP and the L1 motion vector of the spatial motion information storage unit corresponding to BQ are less than an integer pixel.
  • the reference frame corresponding to the L0 reference index of the spatial motion information storage unit corresponding to B Q and the reference frame corresponding to the L1 reference index of the spatial motion information storage unit corresponding to BP are the same frame and the differences between all components of the L0 motion vector of the spatial motion information storage unit corresponding to B Q and the L1 motion vector of the spatial motion information storage unit corresponding to BP are less than an integer pixel.
  • the reference frame corresponding to the L0 reference index of the spatial motion information storage unit corresponding to BP and the reference frame corresponding to the L0 reference index of the spatial motion information storage unit corresponding to BQ are not the same frame; the reference frame corresponding to the L1 reference index of the spatial motion information storage unit corresponding to BP and the reference frame corresponding to the L1 reference index of the spatial motion information storage unit corresponding to BQ are not the same frame.
  • the boundary filter strength Bs value is calculated according to the second boundary filter strength determination method.
  • Boundary filter strength determination method 2
  • Step 1 Calculate the average quantization parameter QPav of the coding unit where p0 and q0 are located. If it is a luma sample, the quantization parameter of the luma coding block should be used; if it is a chroma sample, the quantization parameter of the chroma coding block should be used. Let the quantization parameter of the coding unit where p0 is located be is QP p , the quantization parameter of the coding unit where q 0 is located is QP q , and the average quantization parameter is:
  • Step 2 Calculate indexes IndexA and IndexB.
  • Step 3 Look up the table according to IndexA and IndexB to get the values of ⁇ ' and ⁇ ' respectively, and then get the values of ⁇ and ⁇ according to BitDepth.
  • “>>” is a right shift operation, which is used to replace division, that is, “>>5” is equivalent to division by 25 (that is, 32).
  • multiplication that is, “*”
  • a multiplied by 4 can be replaced by left shifting 2 bits, that is, by a ⁇ 2; a multiplied by 10 can be replaced by (a ⁇ 3)+(a ⁇ 1).
  • is a left shift operation, which is used to replace multiplication, that is, “a ⁇ 2” is equivalent to multiplication by 22 (ie, 4).
  • the numerator of the above weighted sum can be added with 1/2 of the denominator (i.e., the dividend) to achieve the effect of rounding.
  • Step 4 If DeblockingFilterType is 1 and Abs(p0-q0) is greater than or equal to 4 ⁇ , Bs is equal to 0; otherwise, calculate the Bs value as follows.
  • step 2) If the Bs value obtained in step 2) is not equal to 0 and the filtered boundary is a chroma coding block boundary, the Bs value is reduced by 1.
  • Deblocking filter adjustment parameters DbrThresold, DbrOffset0, DbrOffset1, DbrAltOffset0 and DbrAltOffset1 are determined.
  • PictureDbrEnableFlag If the value of PictureDbrEnableFlag is 1, adjust the values of P0 and Q0 according to the following "(IX) Deblocking filter adjustment process".
  • PictureDbrEnableFlag If the value of PictureDbrEnableFlag is 1, adjust the values of P0 and Q0 according to the following "(IX) Deblocking filter adjustment process".
  • Clip1(x) means to limit x to the range [0,2 ⁇ (bit_depth)-1] (including 0 and 2 ⁇ (bit_depth)-1).
  • bit_depth represents the bit depth of the image, which is usually 8, 10, 12, etc.
  • SAO filtering is used to eliminate the ringing effect.
  • the ringing effect is caused by the quantization distortion of the high-frequency AC coefficient. After decoding, ripples will appear around the edge. The larger the transform block size, the more obvious the ringing effect.
  • the basic principle of SAO is to add negative values to compensate the peak pixels in the reconstructed curve and add positive values to supplement the trough pixels.
  • SAO uses the Collect Transfer unit (CTU) as the basic unit, including two types of compensation forms: edge offset (EO) and sideband offset (BO).
  • CTU Collect Transfer unit
  • EO edge offset
  • BO sideband offset
  • parameter fusion technology is introduced.
  • the sample offset compensation filtering includes basic sample offset compensation (the above-mentioned SAO), enhanced sample offset compensation (the above-mentioned ESAO), and cross-component sample offset compensation (the above-mentioned CCSAO, which is performed only for chrominance).
  • the basic sample value offset compensation unit is first derived, and then the basic sample value offset compensation information corresponding to the current basic sample value offset compensation unit is derived, and finally the components of each sample in the current basic sample value offset compensation unit are operated to obtain the offset sample value. Otherwise, the value of the corresponding component of the filtered sample is directly used as the value of the sample component after offset.
  • the enhanced sample value offset compensation unit is first derived, and then each component of each sample in the enhanced sample value offset compensation unit is operated to obtain the offset sample value; otherwise, the value of the corresponding component of the filtered sample is directly used as the value of the sample component after offset.
  • the cross-component sample value offset compensation unit is first derived, and then the component samples in the current cross-component sample value offset compensation unit are operated to obtain the cross-component offset sample value. Otherwise, the value of the component corresponding to the offset sample is directly used as the value of the sample component after the cross-component offset.
  • the classification of the current chroma pixel is determined based on the luminance value (the above-mentioned Y5) after deblocking filtering (adjustment) at the corresponding position and the current chroma pixel (the pixel after ESAO). Based on the classification, the compensation value of the current chroma pixel is determined, and the current chroma pixel is added with the compensation value to obtain the chroma pixel value after CCSAO filtering.
  • ALF filtering is the optimal filter in the mean square sense calculated based on the original signal and the distorted signal, that is, the Wiener filter.
  • the adaptive correction filter (ALF) can enable the enhanced adaptive correction filter (EALF) or not. Positive filtering.
  • the value of the offset sample component is directly used as the value of the corresponding reconstructed sample component; otherwise, adaptive correction filtering is performed on the corresponding offset sample component.
  • the unit of the adaptive correction filter is an adaptive correction filter unit derived from the maximum coding unit, which is processed in sequence according to the raster scanning order. First, the adaptive correction filter coefficients of each component are decoded, then the adaptive correction filter unit is derived, and the adaptive correction filter coefficient index of the brightness component of the current adaptive correction filter unit is determined. Finally, the brightness and chrominance components of the adaptive correction filter unit are adaptively corrected to obtain the reconstructed sample.
  • each group of filter coefficients of the ALF of the current image has 15, and the shape is shown in (a) of Figure 4.
  • the maximum number of adaptive correction filters for the brightness component of the current image is 64. Otherwise, each group of filter coefficients of the ALF of the current image has 9, and the shape is shown in (b) of Figure 4.
  • the maximum number of adaptive correction filters for the brightness component of the current image is 16.
  • DBF filtering Regardless of DBF filtering, SAO filtering or ALF filtering, they are all classified based on the current pixel value of the adjacent boundary to be filtered, or the relationship between the pixel value of the current block and the pixel value of the adjacent blocks on the surrounding side of the current block (such as the level of authority), and then different filtering operations are performed based on different categories.
  • the purpose of filtering is to achieve smooth noise reduction and detail removal within a video image block, and to retain the image edge to the greatest extent.
  • electronic devices filter the boundaries of multiple regions in an image to retain the image edge.
  • a permission area refers to an area where only users with relevant permissions can correctly decode the image content of the area. Exemplarily, only users with high permissions can correctly view image areas of any permission level, while users with only low permissions cannot view image areas of higher permission levels, and can only view image areas of low permission levels and image areas of zero permission level areas.
  • the electronic device will not filter the adjacent boundaries of image areas with different permission levels during the video decoding process, resulting in poor image quality.
  • the embodiments of the present application provide an image processing method, device, electronic device, and storage medium.
  • the method divides the image to be processed into multiple image sub-regions through an electronic device, obtains the authority level of each image sub-region, and judges the authority level of each image sub-region. If the authority levels of at least two adjacent image sub-regions in the multiple image sub-regions are different, it means that the above two image sub-regions may still not be filtered after filtering in the decoding process, and the quality of the image to be processed is not high. Therefore, based on the decoding information such as the division of the authority region, the electronic device can filter the adjacent boundaries between at least two image sub-regions again, which can improve the image quality of different authority regions in the image to be processed.
  • the image processing method provided in the embodiment of the present application may be applied to an image processing device 11 as shown in FIG. 5 .
  • the image processing device 11 includes an image dividing unit 101 , an image filtering unit 102 , and an image decoding unit 103 .
  • the image division unit 101 is used to divide the image to be processed into a plurality of image sub-regions.
  • the image decoding unit 103 is used to obtain the permission level of each image sub-region.
  • the image filtering unit 102 is configured to perform filtering processing on a boundary between at least two adjacent image sub-regions among the plurality of image sub-regions if the authority levels of at least two adjacent image sub-regions are different.
  • the image decoding unit 103 is further configured to receive a decoded code stream of the image to be processed, perform decoding based on the decoded code stream, and obtain a decoded image to be processed.
  • the image filtering unit 102 is further used to determine a target area to be filtered on the vertical side of a first sub-region among at least two image sub-regions; the vertical side is the left or right side of a connected boundary of the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the right side of the connected boundary, an area to be filtered on the left side of the connected boundary, an area to be filtered on the right side of the connected boundary, and an area to be filtered on the left side; the image filtering unit 102 is further used to perform vertical filtering to remove blocking effects on the target area to be filtered.
  • the image filtering unit 102 is further used to determine a target area to be filtered on the horizontal side of a first sub-region among at least two image sub-regions; the horizontal side is the upper side or the lower side of the adjacent boundary of the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the lower side of the adjacent boundary, an area to be filtered on the upper side of the adjacent boundary, an area to be filtered on the lower side of the adjacent boundary, and an area to be filtered on the upper side; the image filtering unit 102 is further used to perform horizontal filtering to remove blocking effects on the target area to be filtered.
  • the image filtering unit 102 is further used to determine the target area to be filtered from the surrounding side of the first sub-region of the at least two image sub-regions according to the set filtering order;
  • the surrounding side includes: the left side, the upper side, the right side and the lower side of the boundary between the first sub-region and the other sub-regions, the authority level of the first sub-region is different from the authority level of the other sub-regions, and the target area to be filtered is any one of the following: the first side area in the first sub-region compared to the connected boundary, the second side area outside the first sub-region compared to the connected boundary, the first side area and the second side area; the image filtering unit 102 is further used to filter the target area to be filtered according to the set filtering order.
  • the filter area performs sample adaptive compensation filtering.
  • the image filtering unit 102 is also used to determine the target area to be filtered from the surrounding side of the first sub-region in at least two image sub-regions according to a set filtering order;
  • the surrounding side includes, in sequence: the left side, top side, right side and bottom side of the boundary between the first sub-region and other sub-regions, the authority level of the first sub-region is different from the authority level of other sub-regions, and the target area to be filtered is any one of the following: the first side area in the first sub-region compared to the connected boundary, the second side area outside the first sub-region compared to the connected boundary, the first side area and the second side area; the image filtering unit 102 is also used to perform adaptive loop filtering on the target area to be filtered according to the set filtering order.
  • the image filtering unit 102 is also used to determine whether it is necessary to perform neural network-based filtering processing on the first sub-region of at least two image sub-regions based on the decoded information of the image to be processed; when the first sub-region needs to perform neural network-based filtering processing, the reconstructed pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network; and the filtered reconstructed pixels of the first sub-region are obtained as output.
  • the image filtering unit 102 is further configured to input the permission level of at least one image sub-region adjacent to the first sub-region into the neural network.
  • the image filtering unit 102 is further used to filter the brightness channel component of the adjacent boundary between at least two image sub-regions; or, to filter the brightness channel component of the adjacent boundary between at least two image sub-regions; or, to filter the brightness channel component and the chroma channel component of the adjacent boundary between at least two image sub-regions.
  • FIG6 is a flowchart of an image processing method provided in an embodiment of the present application.
  • the image processing method provided in the present application can be applied to the image processing device shown in FIG5.
  • the image processing method provided in the present application can specifically include the following steps:
  • the permission levels are divided into at least two different permission levels.
  • an image may be provided with a permission area and a non-permission area (zero permission level area).
  • the image sub-area of the non-permission area (zero permission level area) is an image sub-area that any user can view.
  • the permission area may include multiple permission areas of different high and low levels.
  • the permission area may include a first permission level area (high permission level area), a second permission level area (medium permission level area), and a third permission level area (low permission level area).
  • the permission level of the first permission level area is higher than the permission level of the second permission level area
  • the permission level of the second permission level area is higher than the permission level of the third permission level area.
  • Each permission level may also be divided into multiple sub-permission levels, which is not specifically limited in this embodiment.
  • the permission level of the target area in the image is configured according to the category of the target area.
  • the face of a person in the image is a high permission level area
  • the upper body is a low permission level area
  • the lower body is a zero permission level area
  • the license plate part of the vehicle image is a high permission level area
  • the window part is a low permission level area
  • the body part is a zero permission level area, etc.
  • the permission levels of image sub-regions in the image to be processed can be divided into high permission level areas, low permission level areas and zero permission level areas.
  • multiple image sub-regions may include low permission level areas, high permission level areas and zero permission level areas.
  • High-authority users can view image sub-areas at any permission level (for example, high-authority level, low-authority level areas, and zero-authority level areas), low-authority users can view image sub-areas at low-authority levels and image sub-areas at zero-authority levels, and unauthorized users can only view image sub-areas at zero-authority levels.
  • the image decoding unit 103 before dividing the image to be processed into a plurality of image sub-regions, the image decoding unit 103 is used to receive a decoded code stream of the image to be processed, and decoding is performed based on the decoded code stream to obtain the decoded image to be processed.
  • the image decoding unit 103 receives a decoded code stream of the image to be processed, and decodes the target image region based on the decoded code stream. After the target image region is decoded, it is not necessary to wait for the entire image to be processed to be decoded, and the target image region can be directly divided into multiple image sub-regions to obtain the permission level of each image sub-region.
  • the target image area when the image to be processed includes a target image area, when the target image area is used as a filtering processing object, the target image area can be taken as the center and expanded to the surrounding side (left side, right side, upper side or lower side) to obtain a detection area with a width of CW and a height of CH, and the above detection area is divided to obtain multiple NxN (N is preferably 2 or 4 or 8) pixel units of image sub-block areas, wherein the authority level in each image sub-block area is the same.
  • N is preferably 2 or 4 or 8
  • the expansion pixel units of the detection area in the four directions can be different or completely the same.
  • the detection area may be centered on the target image area and extended to the left and upward by T (T is preferably 4, 8, or 16) unit pixels.
  • the detection area may also be increased by an upper right area on the detection area of (a) of FIG8 as the overall detection area.
  • the target image area when the image to be processed includes a target image area that is a filtering object, after the target image area is decoded using the image decoding unit 103, the target image area can be directly divided into multiple image sub-regions. If the authority levels of at least two adjacent image sub-regions among the multiple image sub-regions are different, the connecting boundary between the two image sub-regions can be directly filtered without waiting for the entire image to be processed to be decoded before filtering.
  • the filtering process includes at least one of: deblocking effect vertical filtering, deblocking effect horizontal filtering, sample adaptive compensation filtering, adaptive loop filtering and neural network filtering.
  • the at least two adjacent image sub-regions may be two adjacent image sub-regions, or may be two adjacent image sub-regions that are not adjacent but are relatively close to each other.
  • the boundary between at least two image sub-regions may be filtered for the luminance channel component; or, the boundary between at least two image sub-regions may be filtered for the chrominance channel component; or, the boundary between at least two image sub-regions may be filtered for both the luminance channel component and the chrominance channel component.
  • the image processing device can obtain image area information of any permission level in the image to be processed, as well as image area information of non-authorization areas; or, the image processing device can obtain image area information of the second permission level in the image to be processed, as well as image area information of non-authorization areas.
  • the image to be processed is divided into multiple image sub-regions, and the authority level of each image sub-region is obtained, so as to judge the authority level of each image sub-region. If the authority levels of at least two adjacent image sub-regions in the multiple image sub-regions are different, it means that the two image sub-regions may still not be filtered after filtering in the decoding process, and the quality of the image to be processed is not high. Therefore, based on the decoding information such as the division of the authority region, the boundary between at least two image sub-regions is filtered again, which can improve the image quality of different authority regions in the image to be processed.
  • the filtering process includes deblocking effect vertical filtering, and if the DBF filtering conditions are met, the deblocking effect vertical filtering can be performed on the boundary between the at least two image sub-regions.
  • the decoding method provided in this embodiment includes the following steps Sa1 to Sa2.
  • Sa1 Determine a target area to be filtered on a vertical side of a first sub-region in at least two image sub-regions.
  • the vertical side is the left or right side of the boundary of the first sub-region
  • the target area to be filtered is any one of the following: the area to be filtered on the right side of the boundary, the area to be filtered on the left side of the boundary, the area to be filtered on the right side of the boundary and the area to be filtered on the left side.
  • Sa2 Perform vertical filtering to remove the blocking effect on the target area to be filtered.
  • the at least two adjacent image sub-regions further include a second sub-region, and the second sub-region is horizontally adjacent to the first sub-region, where horizontal adjacent means that the second sub-region is located on the left or right side of the first sub-region in the horizontal direction.
  • the permission levels of the at least two adjacent image sub-regions are different, including any of the following situations:
  • the authority level of the first sub-area is lower than the authority level of the second sub-area.
  • the authority level of the first sub-area is higher than the authority level of the second sub-area.
  • the permission level of the first sub-area is not equal to the permission level of the second sub-area.
  • the authority level of the first sub-area is not equal to the authority level of the second sub-area, and the filtering strength (BS value) of the adjacent boundaries is greater than or equal to the preset filtering strength.
  • Embodiment 1 When the authority level of the first sub-region is lower than the authority level of the second sub-region, the target area to be filtered is the area to be filtered on the right side of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the area to be filtered on the right side is a pixel point area with a width of n columns to the right of the adjacent boundary, and n is preferably 1.
  • Embodiment 2 When the authority level of the first sub-region is higher than the authority level of the second sub-region, the target area to be filtered is the area to be filtered on the right side of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the area to be filtered on the right side is a pixel point area with a width of n columns to the right of the adjacent boundary, and n is preferably 1.
  • Embodiment 3 When the authority level of the first sub-region is not lower than the authority level of the second sub-region, the target area to be filtered is the right side area to be filtered (within the first sub-region) of the adjacent boundary, and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the right side area to be filtered is a pixel point area with a width of n columns to the right of the adjacent boundary, and n is preferably 1.
  • Embodiment 4 When the authority level of the first sub-region is not equal to the authority level of the second sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the area to be filtered on the right side of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the area to be filtered on the right side is a pixel point area with a width of n columns to the right of the adjacent boundary, and n is preferably 1.
  • the target area to be filtered is the right side of the adjacent boundary.
  • the side area to be filtered (within the first sub-area).
  • Embodiment 5 When the authority level of the first sub-region is lower than the authority level of the second sub-region, the target area to be filtered is the area to be filtered on the left side of the adjacent boundary (within the second sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the area to be filtered on the left side is a pixel point area with a width of n columns to the left of the adjacent boundary, and n is preferably 1.
  • Embodiment 6 When the authority level of the first sub-region is higher than the authority level of the second sub-region, the target area to be filtered is the area to be filtered on the left side of the adjacent boundary (within the second sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the area to be filtered on the left side is a pixel point area with a width of n columns to the left of the adjacent boundary, and n is preferably 1.
  • Embodiment 7 When the authority level of the first sub-region is not equal to the authority level of the second sub-region, the target area to be filtered is the area to be filtered on the left side of the adjacent boundary (within the second sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the area to be filtered on the left side is a pixel point area with a width of n columns to the left of the adjacent boundary, and n is preferably 1.
  • Embodiment 8 When the authority level of the first sub-region is not equal to the authority level of the second sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the area to be filtered on the left side of the adjacent boundary (within the second sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the area to be filtered on the left side is a pixel point area with a width of n columns to the left of the adjacent boundary, and n is preferably 1.
  • the target region to be filtered is the region to be filtered on the left side of the adjacent boundary (within the second sub-region).
  • Embodiment 9 When the authority level of the first sub-region is lower than the authority level of the second sub-region, the target area to be filtered is the right area to be filtered and the left area to be filtered (within the first region and the second sub-region) of the adjacent boundary, and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the target area to be filtered is a pixel point area with a width of 2n, which is n columns to the right and n sides to the left of the adjacent boundary, and n is preferably 1.
  • Embodiment 10 When the authority level of the first sub-region is higher than the authority level of the second sub-region, the target area to be filtered is the right area to be filtered and the left area to be filtered (within the first region and the second sub-region) of the adjacent boundary, and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the target area to be filtered is a pixel point area with a width of 2n, which is n columns to the right and n sides to the left of the adjacent boundary, and n is preferably 1.
  • Embodiment 11 When the authority level of the first sub-region is not equal to the authority level of the second sub-region, the target area to be filtered is the right area to be filtered and the left area to be filtered (within the first region and the second sub-region) of the adjacent boundary, and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the target area to be filtered is a pixel point area with a width of 2n, which is n columns to the right and n sides to the left of the adjacent boundary, and n is preferably 1.
  • Embodiment 12 When the authority level of the first sub-region is not equal to the authority level of the second sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the area to be filtered on the right side and the area to be filtered on the left side of the adjacent boundary (within the first region and the second sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect.
  • the target area to be filtered is a pixel area with a width of 2n, which is n columns to the right and n sides to the left of the adjacent boundary, and n is preferably 1.
  • the target region to be filtered is the right region to be filtered and the left region to be filtered (within the first region and the second sub-region) of the adjacent boundaries.
  • the target area to be filtered on the vertical side of the first sub-region in the at least two image sub-regions can be determined, and the target area to be filtered can be vertically filtered for deblocking effects.
  • the corresponding target area to be filtered can be selected for vertical filtering for deblocking effects.
  • the method can meet the needs of users of any authority level to perform vertical filtering for deblocking effects on the decoded image again, improve the image quality of different authority areas in the image to be processed, and thus improve the user experience at each authority level.
  • the filtering process includes deblocking effect horizontal filtering, and when the DBF filtering conditions are met, the deblocking effect horizontal filtering is performed on the boundary between the at least two image sub-regions.
  • the decoding method provided in this embodiment includes the following steps Sb1 to Sb2.
  • Sb1 Determine a target area to be filtered on the horizontal side of a first sub-region in at least two image sub-regions.
  • the horizontal side is the upper side or lower side of the boundary of the first sub-region
  • the target area to be filtered is any one of the following: the upper side area to be filtered of the connected boundary, the lower side area to be filtered of the connected boundary, the upper side area to be filtered of the connected boundary and the lower side area to be filtered.
  • the at least two adjacent image sub-regions further include a third sub-region, and the third sub-region is vertically adjacent to the first sub-region, where vertically adjacent means that the third sub-region is located above or below the first sub-region in the horizontal direction.
  • the permission levels of the at least two adjacent image sub-regions are different, including any of the following situations:
  • the authority level of the first sub-area is lower than the authority level of the third sub-area.
  • the authority level of the first sub-area is higher than the authority level of the third sub-area.
  • the permission level of the first sub-area is not equal to the permission level of the third sub-area.
  • the authority level of the first sub-area is not equal to the authority level of the third sub-area, and the filtering strength (BS value) of the adjacent boundaries is greater than or equal to the preset filtering strength.
  • the third sub-region is located on the upper side of the first sub-region.
  • the following describes in detail the deblocking horizontal filtering of the target area to be filtered according to the different authority levels of the at least two adjacent image sub-regions.
  • Embodiment 13 When the authority level of the first sub-region is lower than the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the lower area to be filtered is a pixel point area with a width of n rows upward from the adjacent boundary, and n is preferably 1.
  • Embodiment 14 When the authority level of the first sub-region is higher than the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the lower area to be filtered is a pixel point area with a width of n rows upward from the adjacent boundary, and n is preferably 1.
  • Embodiment 15 When the authority level of the first sub-region is not lower than the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the lower area to be filtered is a pixel point area with a width of n rows upward from the adjacent boundary, and n is preferably 1.
  • Embodiment 16 When the authority level of the first sub-region is not equal to the authority level of the third sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the lower area to be filtered of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the lower area to be filtered is a pixel point area with a width of n rows upward from the adjacent boundary, and n is preferably 1.
  • the target region to be filtered is the region to be filtered at the lower side of the adjacent boundary (within the first sub-region).
  • Embodiment 17 When the authority level of the first sub-region is lower than the authority level of the third sub-region, the target area to be filtered is the upper area to be filtered of the adjacent boundary (within the third sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the upper area to be filtered is a pixel point area with a width of n rows below the adjacent boundary, and n is preferably 1.
  • Embodiment 18 When the authority level of the first sub-region is higher than the authority level of the third sub-region, the target area to be filtered is the upper area to be filtered of the adjacent boundary (within the third sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the upper area to be filtered is a pixel point area with a width of n rows below the adjacent boundary, and n is preferably 1.
  • Embodiment 19 When the authority level of the first sub-region is not equal to the authority level of the third sub-region, the target area to be filtered is the upper area to be filtered of the adjacent boundary (within the third sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the upper area to be filtered is a pixel point area with a width of n rows below the adjacent boundary, and n is preferably 1.
  • Embodiment 20 When the authority level of the first sub-region is not equal to the authority level of the third sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the upper area to be filtered of the adjacent boundary (within the third sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the upper area to be filtered is a pixel point area with a width of n rows below the adjacent boundary, and n is preferably 1.
  • the target region to be filtered is the region to be filtered on the upper side of the adjacent boundary (within the third sub-region).
  • Embodiment 21 When the authority level of the first sub-region is lower than the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered and the upper area to be filtered (in the first region and the third sub-region) of the adjacent boundary, and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the target area to be filtered is the pixel point area with a width of 2n, which is n rows upward and n sides downward of the adjacent boundary, and n is preferably 1.
  • Embodiment 22 When the authority level of the first sub-region is higher than the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered and the upper area to be filtered (in the first region and the third sub-region) of the adjacent boundary, and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the target area to be filtered is the pixel point area with a width of 2n, which is n rows upward and n sides downward of the adjacent boundary, and n is preferably 1.
  • Embodiment 23 When the authority level of the first sub-region is not equal to the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered and the upper area to be filtered (in the first region and the third sub-region) of the adjacent boundary, and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the target area to be filtered is the pixel point area with a width of 2n, which is n rows upward and n sides downward of the adjacent boundary, and n is preferably 1.
  • Embodiment 24 When the authority level of the first sub-region is not equal to the authority level of the third sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the lower area to be filtered and the upper area to be filtered (in the first region and the third sub-region) of the adjacent boundary, and the target area to be filtered is subjected to horizontal filtering for deblocking effect.
  • the target area to be filtered is the pixel point area with a width of 2n, which is n rows upward and n sides downward of the adjacent boundary, and n is preferably 1.
  • the target area to be filtered is the upper area to be filtered and the lower area to be filtered of the adjacent boundaries (inside the first area and in the third sub-area).
  • the target area to be filtered on the horizontal side of the first sub-region in the at least two image sub-regions can be determined, and the target area to be filtered can be subjected to horizontal filtering for deblocking effects.
  • the corresponding target area to be filtered can be selected for horizontal filtering for deblocking effects.
  • the method can meet the needs of users of any authority level to perform horizontal filtering for deblocking effects on the decoded image again, improve the image quality of different authority areas in the image to be processed, and thus improve the user experience at each authority level.
  • the filtering process includes sample adaptive compensation filtering. If the authority levels of at least two adjacent image sub-regions among multiple image sub-regions are different, sample adaptive compensation filtering is performed on the adjacent boundary between the at least two image sub-regions. Please refer to Figure 13.
  • the decoding method provided in this embodiment includes the following steps Sc1 to Sc2.
  • the surrounding side includes, in sequence: the left side, top side, right side and bottom side of the border between the first sub-region and other sub-regions.
  • the target area to be filtered is any one of the following: the first side area within the first sub-region compared to the border, the second side area outside the first sub-region compared to the border, the first side area and the second side area.
  • the permission levels of other sub-regions around the first sub-region may be determined in sequence according to the set filtering order, and when the permission levels of other sub-regions around the first sub-region are different from the permission level of the first sub-region, the target area to be filtered is determined.
  • the target area to be filtered may include the following two situations:
  • Case 1 If other sub-regions with different authority levels from the first sub-region are located on the vertical side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n columns of pixels from the adjacent boundary toward the other sub-regions.
  • Case 2 If other sub-regions with different authority levels from the first sub-region are located on the horizontal side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n rows of pixels from the adjacent boundary toward the other sub-regions.
  • the first sub-region is surrounded by an adjacent sub-region A on the left, an adjacent sub-region B on the upper left, an adjacent sub-region C on the upper side, and an adjacent sub-region D on the upper right.
  • the authority levels of other sub-regions around the first sub-region are judged in turn.
  • the target area to be filtered is determined to be a column pixel area with a width of 1 in the left direction and a column pixel area with a width of 1 in the right direction of the border connecting with the adjacent sub-region A, and a row pixel area with a width of 1 in the upward direction and a row pixel area with a width of 1 in the downward direction of the border connecting with the adjacent sub-region C, that is, the area of the shaded part shown in FIG14 .
  • the target area to be filtered is determined.
  • the target area to be filtered may include the following two situations:
  • Case 1 If other sub-regions with higher authority levels than the first sub-region are located on the vertical side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n columns of pixels from the adjacent boundary toward the other sub-regions.
  • the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n rows of pixels from the adjacent boundary toward the other sub-regions.
  • sample adaptive compensation filtering is performed on the target area to be filtered, that is, the shaded area in FIG. 14 , in a filtering order from right to left and then from top to bottom.
  • the adjacent sub-regions around the first sub-region that have not been filtered retain their original pixel values. For example, as shown in FIG. 14 , the pixel values of the borders between the first sub-region and the adjacent sub-region B and the borders between the first sub-region and the adjacent sub-region D remain unchanged.
  • the target area to be filtered can be determined from the surrounding side of the first sub-region of the at least two image sub-regions according to the set filtering order, and the target area to be filtered can be subjected to sample adaptive compensation filtering according to the set filtering order.
  • the corresponding target area to be filtered can be selected for sample adaptive compensation filtering.
  • the method can meet the needs of users of any authority level to perform sample adaptive compensation filtering on the decoded image again, improve the image quality of different authority areas in the image to be processed, and thus improve the user experience at each authority level.
  • the filtering process includes adaptive loop filtering. If the authority levels of at least two adjacent image sub-regions among multiple image sub-regions are different, adaptive loop filtering is performed on the adjacent boundary between the at least two image sub-regions. Please refer to Figure 15.
  • the decoding method provided in this embodiment includes the following steps Sd1 to Sd2.
  • Sd1 Determine a target area to be filtered from the surrounding side of a first sub-area in at least two image sub-areas according to a set filtering order.
  • the surrounding side includes, in sequence: the left side, top side, right side and bottom side of the border between the first sub-region and other sub-regions.
  • the target area to be filtered is any one of the following: the first side area within the first sub-region compared to the border, the second side area outside the first sub-region compared to the border, the first side area and the second side area.
  • the permission levels of other sub-regions around the first sub-region may be determined in sequence according to the set filtering order, and when the permission levels of other sub-regions around the first sub-region are different from the permission level of the first sub-region, the target area to be filtered is determined.
  • the target area to be filtered may include the following two situations:
  • Case 1 If other sub-regions with different authority levels from the first sub-region are located on the vertical side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n columns of pixels from the adjacent boundary toward the other sub-regions.
  • Case 2 If other sub-regions with different authority levels from the first sub-region are located on the horizontal side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n rows of pixels from the adjacent boundary toward the other sub-regions.
  • the first sub-region is surrounded by an adjacent sub-region A on the left, an adjacent sub-region B on the upper left, an adjacent sub-region C on the upper side, and an adjacent sub-region D on the upper right.
  • the authority levels of other sub-regions around the first sub-region are judged in turn.
  • the target area to be filtered is determined to be a row pixel area with a width of 1 in the downward direction and a row pixel area with a width of 1 in the upward direction of the boundary connecting the adjacent sub-regions B, C, and D, that is, the area of the shaded part shown in FIG16 .
  • the target area to be filtered is determined.
  • the target area to be filtered may include the following two situations:
  • Case 1 If other sub-regions with higher authority levels than the first sub-region are located on the vertical side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n columns of pixels from the adjacent boundary toward the other sub-regions.
  • the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n rows of pixels from the adjacent boundary toward the other sub-regions.
  • adaptive loop filtering is performed on the target area to be filtered, that is, the shaded area in FIG. 16 , in a filtering order from right to left and then from top to bottom.
  • the adjacent sub-regions around the first sub-region that have not been filtered retain their original pixel values. For example, as shown in FIG16 , the pixel values at the border between the first sub-region and the adjacent sub-region A remain unchanged.
  • the target area to be filtered can be determined from the surrounding side of the first sub-region of the at least two image sub-regions according to the set filtering order, and the target area to be filtered can be subjected to sample adaptive compensation filtering according to the set filtering order.
  • the corresponding target area to be filtered can be selected for adaptive loop filtering.
  • the method can meet the needs of users of any authority level to perform adaptive loop filtering on the decoded image again, improve the image quality of different authority areas in the image to be processed, and thus improve the user experience at each authority level.
  • the filtering process includes filtering process based on a neural network. If the authority levels of at least two adjacent image sub-regions among multiple image sub-regions are different, the connecting boundary between the at least two image sub-regions can be filtered based on a neural network. Please refer to Figure 17.
  • the decoding method provided in this embodiment includes the following steps Se1 to Se2.
  • the pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network.
  • the pixel value of the first sub-region may be a reconstructed pixel value
  • the reconstructed pixel value may be the pixel value of the first sub-region after decoding and filtering, and may be the pixel value after decoding and other filtering (such as deblocking vertical filtering).
  • the pixel value is not specifically limited in this embodiment.
  • the reconstructed pixel value of the first sub-region and the authority level of the first sub-region, as well as other decoded information are input into the neural network.
  • the other decoded information includes the above-mentioned boundary filter strength Bs value, the quantization coefficient of the coding unit transform block, etc. This embodiment is not specifically limited.
  • the neural network may be a convolutional neural network (CNN) or other neural networks, which are not specifically limited in this embodiment.
  • CNN convolutional neural network
  • step Se1 may include step Se12.
  • Se12. Input the authority level of at least one image sub-region adjacent to the first sub-region into the neural network.
  • the permission level of the adjacent sub-region A, the permission level of the adjacent sub-region B, the permission level of the adjacent sub-region C, and the permission level of the adjacent sub-region D around the first sub-region in FIG. 16 are all input into the neural network.
  • the reconstructed pixel value of the first sub-region, the authority level of the first sub-region, the authority level of at least one image sub-region adjacent to the first sub-region, and other decoding information are input into the neural network to obtain the output filtered reconstructed pixel of the first sub-region.
  • the corresponding target area to be filtered can be selected for filtering based on the neural network.
  • this method can meet the needs of users of any authority level to perform filtering based on the neural network on the decoded image again, improve the image quality of different authority areas in the image to be processed, and thus improve the user experience at each authority level.
  • the process of executing Sa1 to Sa2, Sb1 to Sb2, Sc1 to Sc2, and Sd1 to Sd2 can be performed in sequence, that is, the output of Sa1 to Sa2 is the input of Sb1 to Sb2, the output of Sb1 to Sb2 is the input of Sc1 to Sc2, and the output of Sc1 to Sc2 is the input of Sd1 to Sd2.
  • the process of executing Sa1 to Sa2, Sb1 to Sb2, Sc1 to Sc2, Sd1 to Sd2, and Se1 to Se2 may be performed in sequence, that is, the output of Sa1 to Sa2 is the input of Sb1 to Sb2, the output of Sb1 to Sb2 is the input of Sc1 to Sc2, the output of Sc1 to Sc2 is the input of Sd1 to Sd2, and the output of Sd1 to Sd2 is the input of Se1 to Se2.
  • the above-mentioned Sa1 to Sa2, Sb1 to Sb2, Sc1 to Sc2, Sd1 to Sd2, and Se1 to Se2 may be performed in any combination.
  • the corresponding target area to be filtered can be selected for the above filtering process.
  • the pixel points on one side of the adjacent boundary of the image sub-region can be selected for filtering process or the pixel points on both sides can be filtered process.
  • different filtering process methods can also be combined, and the image to be processed can be filtered in the order of combination, so as to improve the image quality of different authority areas in the image to be processed, thereby improving the user experience.
  • the present application also provides an electronic device, as shown in FIG19, which is a schematic diagram of the structure of an electronic device provided by the present application, and the electronic device 12 includes a processor 201 and a communication interface 202.
  • the processor 201 and the communication interface 202 are coupled to each other.
  • the communication interface 202 can be a transceiver or an input-output interface.
  • the electronic device 12 can also include a memory 203 for storing instructions executed by the processor 201 or storing input data required by the processor 201 to run the instructions or storing data generated after the processor 201 runs the instructions.
  • the processor 201 and the communication interface 202 are used to perform the functions of the above-mentioned image division unit 101, the image filtering unit 102, and the image decoding unit 103.
  • connection medium between the communication interface 202, the processor 201 and the memory 203 is not limited in the embodiment of the present application.
  • the communication interface 202, the processor 201 and the memory 203 are connected by a bus 204, and the bus 204 is represented by a bold line in FIG. 19 .
  • the connection mode between other components is only for schematic illustration and is not limited thereto.
  • the bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bold line is used in FIG. 19 , but it does not mean that there is only one bus or one type of bus.
  • the memory 203 can be used to store software programs and modules, such as program instructions/modules corresponding to the decoding method or encoding method provided in the embodiment of the present application.
  • the processor 201 executes the software programs and modules stored in the memory 203 to perform various functional applications and data processing.
  • the communication interface 202 can be used to communicate signaling or data with other devices. In the present application, the electronic device 12 can have multiple communication interfaces 202.
  • processors in the embodiments of the present application may be a central processing unit (CPU), a neural processing unit (NPU) or a graphic processing unit (GPU), or may be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
  • CPU central processing unit
  • NPU neural processing unit
  • GPU graphic processing unit
  • DSP digital signal processors
  • ASIC application specific integrated circuits
  • FPGA field programmable gate arrays
  • a general-purpose processor may be a microprocessor or any conventional processor.
  • the method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions.
  • the software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art.
  • An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium.
  • the storage medium can also be a component of the processor.
  • the processor and the storage medium can be located in an ASIC.
  • the ASIC can be located in a network device or a terminal device.
  • the processor and the storage medium can also be present in a network device or a terminal device as discrete components.
  • the computer program product includes one or more computer programs or instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device.
  • the computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means.
  • the computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server, data center, etc. that integrates one or more available media.
  • the available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD).

Landscapes

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

Abstract

An image processing method and apparatus, and an electronic device and a storage medium, which relate to the field of image processing, and solve the problem of the image quality of different permission areas in an image being relatively poor after the image is decoded and filtered. The image processing method, which is executed by an electronic device, comprises: dividing an image to be processed into a plurality of image sub-areas, and acquiring the permission level of each image sub-area; and if the permission levels of at least two adjacent image sub-areas among the plurality of image sub-areas are different, performing filtering processing on a connection boundary between the at least two image sub-areas.

Description

一种图像处理方法、装置、电子设备及存储介质Image processing method, device, electronic device and storage medium 技术领域Technical Field
本申请涉及图像处理领域,尤其涉及一种图像处理方法、装置、电子设备及存储介质。The present application relates to the field of image processing, and in particular to an image processing method, device, electronic device and storage medium.
背景技术Background technique
在视频编解码中,滤波处理的目的是实现视频图像块内平滑降噪、去细节,并最大程度保留图像边缘。通常,电子设备对图像中多个区域的边界进行滤波处理,以保留图像边缘。然而,不同用户对图像中不同区域的查看权限不同,在低权限用户不具有图像中高权限区域的查看权限的情况下,电子设备在视频解码的过程中,不会对该高权限区域与低权限区域之间的边界进行滤波处理,从而导致图像的质量较差。In video encoding and decoding, the purpose of filtering is to achieve smooth noise reduction and detail removal within the video image block, and to preserve the image edges to the greatest extent possible. Usually, electronic devices filter the boundaries of multiple areas in the image to preserve the image edges. However, different users have different viewing permissions for different areas in the image. When a low-authority user does not have permission to view a high-authority area in the image, the electronic device will not filter the boundary between the high-authority area and the low-authority area during the video decoding process, resulting in poor image quality.
发明内容Summary of the invention
本申请提供一种图像处理方法、装置、电子设备及存储介质,解决了图像在解码滤波后,图像中不同权限区域的图像质量较差的问题。The present application provides an image processing method, device, electronic device and storage medium, which solve the problem that the image quality of different permission areas in the image is poor after decoding and filtering.
本申请采用如下技术方案。This application adopts the following technical solution.
第一方面,本申请提供了一种图像处理方法,该图像处理方法由电子设备执行,包括:将待处理图像划分为多个图像子区域,并获取每个图像子区域的权限等级;若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,对至少两个图像子区域之间的相接边界进行滤波处理。In a first aspect, the present application provides an image processing method, which is executed by an electronic device, and includes: dividing an image to be processed into multiple image sub-regions, and obtaining an authority level for each image sub-region; if the authority levels of at least two adjacent image sub-regions among the multiple image sub-regions are different, filtering the adjacent boundaries between the at least two image sub-regions.
在本实施例中,电子设备将待处理图像划分为多个图像子区域,并获取每个图像子区域的权限等级,对每个图像子区域的权限等级进行判断,若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,说明上述两个图像子区域在经过解码过程的滤波后,可能仍存在着未进行滤波处理的情况,待处理图像的质量不高。因此基于权限区域的划分等解码信息,电子设备对至少两个图像子区域之间的相接边界再次进行滤波处理,从而改善待处理图像中不同权限区域的图像质量。In this embodiment, the electronic device divides the image to be processed into multiple image sub-regions, obtains the authority level of each image sub-region, and judges the authority level of each image sub-region. If the authority levels of at least two adjacent image sub-regions in the multiple image sub-regions are different, it means that the two image sub-regions may still not be filtered after filtering in the decoding process, and the quality of the image to be processed is not high. Therefore, based on the decoding information such as the division of the authority region, the electronic device performs filtering again on the adjacent boundaries between at least two image sub-regions, thereby improving the image quality of different authority regions in the image to be processed.
在一些实施例中,权限等级包括第一权限等级、第二权限等级、零权限等级;零权限等级的图像子区域为任意用户可以查看的图像子区域。In some embodiments, the permission levels include a first permission level, a second permission level, and a zero permission level; an image sub-region of the zero permission level is an image sub-region that can be viewed by any user.
在一些实施例中,上述将待处理图像划分为多个图像子区域,并获取每个图像子区域的权限等级之前,包括:接收待处理图像的解码码流,基于解码码流进行解码,获取解码后的待处理图像。In some embodiments, before dividing the image to be processed into multiple image sub-regions and obtaining the permission level of each image sub-region, the process includes: receiving a decoded code stream of the image to be processed, decoding based on the decoded code stream, and obtaining the decoded image to be processed.
在一些实施例中,滤波处理包括:去块效应垂直滤波、去块效应水平滤波、样本自适应补偿滤波、自适应环路滤波和神经网络滤波中的至少一个。In some embodiments, the filtering process includes at least one of: deblocking effect vertical filtering, deblocking effect horizontal filtering, sample adaptive compensation filtering, adaptive loop filtering and neural network filtering.
在一些实施例中,至少两个图像子区域间存在垂直方向的相接边界,滤波处理包括去块效应垂直滤波,上述对至少两个图像子区域之间的相接边界进行滤波处理,包括:确定至少两个图像子区域中第一子区域的垂直侧的目标待滤波区域;垂直侧为第一子区域相接边界的左侧或右侧,目标待滤波区域为以下任一种:相接边界的右侧待滤波区域、相接边界的左侧待滤波区域、相接边界的右侧待滤波区域和左侧待滤波区域;对目标待滤波区域进行去块效应垂直滤波。In some embodiments, there is a vertical boundary between at least two image sub-regions, and the filtering process includes vertical filtering for deblocking effects. The filtering process for the boundary between at least two image sub-regions includes: determining a target area to be filtered on the vertical side of a first sub-region among the at least two image sub-regions; the vertical side is the left side or right side of the boundary between the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the right side of the boundary, an area to be filtered on the left side of the boundary, an area to be filtered on the right side of the boundary, and an area to be filtered on the left side of the boundary; and performing vertical filtering for deblocking effects on the target area to be filtered.
在一些实施例中,上述相邻的至少两个图像子区域还包括第二子区域,第二子区域与第一子区域水平相邻,这里的水平相邻是指第二子区域位于第一子区域水平方向的左侧或右侧。前述相邻的至少两个图像子区域的权限等级不同,包括:第一子区域的权限等级低于第二子区域的权限等级;或者,第一子区域的权限等级高于第二子区域的权限等级;或者,第一子区域的权限等级不等于第二子区域的权限等级;或者,第一子区域的权限等级不等于第二子区域的权限等级,且相接边界的滤波强度大于或者等于预设滤波强度。In some embodiments, the at least two adjacent image sub-regions further include a second sub-region, and the second sub-region is horizontally adjacent to the first sub-region, where horizontal adjacent means that the second sub-region is located on the left or right side of the first sub-region in the horizontal direction. The at least two adjacent image sub-regions have different authority levels, including: the authority level of the first sub-region is lower than the authority level of the second sub-region; or, the authority level of the first sub-region is higher than the authority level of the second sub-region; or, the authority level of the first sub-region is not equal to the authority level of the second sub-region; or, the authority level of the first sub-region is not equal to the authority level of the second sub-region, and the filtering strength of the adjacent boundaries is greater than or equal to the preset filtering strength.
在一些实施例中,至少两个图像子区域间存在水平方向的相接边界,滤波处理包括去块效应水平滤波,上述对至少两个图像子区域之间的相接边界进行滤波处理,包括:确定至少两个图像子区域中第一子区域的水平侧的目标待滤波区域;水平侧为第一子区域相接边界的上侧或下侧,目标待滤波区域为以下任一种:相接边界的下侧待滤波区域、相接边界的上侧待滤波区域、相接边界的下侧待滤波区域和上侧待滤波区域;对目标待滤波区域进行去块效应水平滤波。In some embodiments, there is a horizontal boundary between at least two image sub-regions, and the filtering process includes horizontal filtering for deblocking effects. The filtering process for the boundary between at least two image sub-regions includes: determining a target area to be filtered on the horizontal side of a first sub-region among the at least two image sub-regions; the horizontal side is the upper side or the lower side of the boundary between the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the lower side of the boundary, an area to be filtered on the upper side of the boundary, an area to be filtered on the lower side of the boundary, and an area to be filtered on the upper side of the boundary; and performing horizontal filtering for deblocking effects on the target area to be filtered.
在一些实施例中,上述相邻的至少两个图像子区域还包括第三子区域,第三子区域与第一子区域垂直相邻,这里的垂直相邻是指第三子区域位于第一子区域水平方向的上侧或下侧。前述相邻的至少两个图像子区域的权限等级不同,包括:第一子区域的权限等级低于第三子区域的权限等级;或者,第一子区域的权限等级高于第三子区域的权限等级;或者,第一子区域的权限等级不等于第三子区域的权限等级;或者,第一子区域的权限等级不等于第三子区域的权限等级,且相接边界的滤波强度大于或者等于预设滤波强度。In some embodiments, the at least two adjacent image sub-regions further include a third sub-region, and the third sub-region is vertically adjacent to the first sub-region, where vertical adjacent means that the third sub-region is located above or below the first sub-region in the horizontal direction. The at least two adjacent image sub-regions have different authority levels, including: the authority level of the first sub-region is lower than the authority level of the third sub-region; or, the authority level of the first sub-region is higher than the authority level of the third sub-region; or, the authority level of the first sub-region is not equal to the authority level of the third sub-region; or, the authority level of the first sub-region is not equal to the authority level of the third sub-region, and the filtering strength of the adjacent boundaries is greater than or equal to the preset filtering strength.
在一些实施例中,滤波处理包括样本自适应补偿滤波,上述对至少两个图像子区域之间的相接边界进行滤波处理,包括:按照设定的滤波顺序,从至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域;周围侧依次包括:第一子区域与其他子区域的相接边界的左侧、上侧、右侧和下侧,第一子区域的权限等级与其他子区域的权限等级不同,目标待滤波区域为以下任一种:第一子 区域内相较于相接边界的第一侧区域、第一子区域外相较于相接边界的第二侧区域、第一侧区域和第二侧区域;按照设定的滤波顺序,对目标待滤波区域进行样本自适应补偿滤波。In some embodiments, the filtering process includes sample adaptive compensation filtering, and the filtering process on the boundary between at least two image sub-regions includes: determining the target area to be filtered from the surrounding side of the first sub-region in the at least two image sub-regions according to the set filtering order; the surrounding side includes: the left side, the upper side, the right side and the lower side of the boundary between the first sub-region and the other sub-regions, the authority level of the first sub-region is different from the authority level of the other sub-regions, and the target area to be filtered is any one of the following: the first sub-region The first side area in the area compared to the connected boundary, the second side area outside the first sub-area compared to the connected boundary, the first side area and the second side area; according to the set filtering order, sample adaptive compensation filtering is performed on the target area to be filtered.
在一些实施例中,滤波处理包括自适应环路滤波,上述对至少两个图像子区域之间的相接边界进行滤波处理,包括:按照设定的滤波顺序,从至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域;周围侧依次包括:第一子区域与其他子区域的相接边界的左侧、上侧、右侧和下侧,第一子区域的权限等级与其他子区域的权限等级不同,目标待滤波区域为以下任一种:第一子区域内相较于相接边界的第一侧区域、第一子区域外相较于相接边界的第二侧区域、第一侧区域和第二侧区域;按照设定的滤波顺序,对目标待滤波区域进行自适应环路滤波。In some embodiments, the filtering process includes adaptive loop filtering, and the above-mentioned filtering process is performed on the adjacent boundary between at least two image sub-regions, including: determining the target area to be filtered from the surrounding side of the first sub-region in the at least two image sub-regions according to the set filtering order; the surrounding side includes, in sequence: the left side, the top side, the right side and the bottom side of the adjacent boundary between the first sub-region and other sub-regions, the authority level of the first sub-region is different from the authority level of other sub-regions, and the target area to be filtered is any one of the following: the first side area within the first sub-region compared to the adjacent boundary, the second side area outside the first sub-region compared to the adjacent boundary, the first side area and the second side area; according to the set filtering order, the target area to be filtered is adaptively loop filtered.
在一些实施例中,根据待处理图像的解码信息,判断是否需要对至少两个图像子区域中第一子区域进行基于神经网络的滤波处理;在第一子区域需要进行基于神经网络的滤波处理的情况下,将第一子区域的重建像素值和第一子区域的权限等级,输入神经网络中;获取输出的第一子区域的滤波重建像素。In some embodiments, based on the decoded information of the image to be processed, it is determined whether a first sub-region of at least two image sub-regions needs to be subjected to neural network-based filtering processing; when the first sub-region needs to be subjected to neural network-based filtering processing, the reconstructed pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network; and the filtered reconstructed pixels of the first sub-region are obtained as output.
在一些实施例中,上述在第一子区域需要进行基于神经网络的滤波处理的情况下,将第一子区域的重建像素值和第一子区域的权限等级,输入神经网络中,还包括:将与第一子区域的相邻的至少一个图像子区域的权限等级,输入神经网络中。In some embodiments, when the first sub-region needs to undergo neural network-based filtering processing, the reconstructed pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network, and the permission level of at least one image sub-region adjacent to the first sub-region is input into the neural network.
在一些实施例中,电子设备可以根据用户的权限等级,获取低于或者等于用户的权限等级的图像子区域的信息;图像区域的信息包括图像子区域的像素值。In some embodiments, the electronic device may obtain information of an image sub-region that is lower than or equal to the user's authority level according to the user's authority level; the information of the image region includes pixel values of the image sub-region.
在一些实施例中,上述若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,对至少两个图像子区域之间的相接边界进行滤波处理,包括:对至少两个图像子区域之间的相接边界进行亮度通道分量的滤波处理;或者,对至少两个图像子区域之间的相接边界进行色度通道分量的滤波处理;或者,对至少两个图像子区域之间的相接边界进行亮度通道分量和色度通道分量的滤波处理。In some embodiments, if the authority levels of at least two adjacent image sub-regions among the multiple image sub-regions are different, filtering processing is performed on the connecting boundary between the at least two image sub-regions, including: filtering processing of the brightness channel component of the connecting boundary between the at least two image sub-regions; or, filtering processing of the chrominance channel component of the connecting boundary between the at least two image sub-regions; or, filtering processing of the brightness channel component and the chrominance channel component of the connecting boundary between the at least two image sub-regions.
第二方面,本申请提供一种图像的处理装置,该图像处理装置包括:图像划分单元、图像滤波单元;图像划分单元用于,将待处理图像划分为多个图像子区域;图像解码单元,用于获取每个图像子区域的权限等级;图像滤波单元,用于若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,对至少两个图像子区域之间的相接边界进行滤波处理。In a second aspect, the present application provides an image processing device, which includes: an image division unit and an image filtering unit; the image division unit is used to divide the image to be processed into multiple image sub-regions; an image decoding unit is used to obtain the authority level of each image sub-region; and the image filtering unit is used to filter the adjacent boundaries between at least two image sub-regions if the authority levels of at least two adjacent image sub-regions among the multiple image sub-regions are different.
在一些实施例中,每个图像子区域的权限等级用于指示:每个图像子区域是否为设定的权限区域,以及,若每个图像子区域为权限区域,电子设备对每个图像子区域的权限等级进行判断;权限等级包括第一权限等级和第二权限等级。In some embodiments, the permission level of each image sub-region is used to indicate: whether each image sub-region is a set permission region, and if each image sub-region is a permission region, the electronic device determines the permission level of each image sub-region; the permission level includes a first permission level and a second permission level.
在一些实施例中,图像解码单元,还用于接收待处理图像的解码码流,基于解码码流进行解码,获取解码后的待处理图像。In some embodiments, the image decoding unit is further used to receive a decoded code stream of the image to be processed, perform decoding based on the decoded code stream, and obtain the decoded image to be processed.
在一些实施例中,图像滤波单元,还用于确定至少两个图像子区域中第一子区域的垂直侧的目标待滤波区域;垂直侧为第一子区域相接边界的左侧或右侧,目标待滤波区域为以下任一种:相接边界的右侧待滤波区域、相接边界的左侧待滤波区域、相接边界的右侧待滤波区域和左侧待滤波区域;图像滤波单元,还用于对目标待滤波区域进行去去块效应垂直滤波。In some embodiments, the image filtering unit is further used to determine a target area to be filtered on the vertical side of a first sub-region among at least two image sub-regions; the vertical side is the left or right side of a connected boundary of the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the right side of the connected boundary, an area to be filtered on the left side of the connected boundary, an area to be filtered on the right side of the connected boundary, and an area to be filtered on the left side; the image filtering unit is further used to perform vertical filtering to remove blocking effects on the target area to be filtered.
在一些实施例中,上述相邻的至少两个图像子区域还包括第二子区域,第二子区域与第一子区域水平相邻,这里的水平相邻是指第二子区域位于第一子区域水平方向的左侧或右侧。相邻的至少两个图像子区域的权限等级不同,包括:第一子区域的权限等级低于第二子区域的权限等级;或者,第一子区域的权限等级高于第二子区域的权限等级;或者,第一子区域的权限等级不等于第二子区域的权限等级;或者,第一子区域的权限等级不等于第二子区域的权限等级,且相接边界的滤波强度大于或者等于预设滤波强度。In some embodiments, the at least two adjacent image sub-regions further include a second sub-region, and the second sub-region is horizontally adjacent to the first sub-region, where horizontal adjacent means that the second sub-region is located on the left or right side of the first sub-region in the horizontal direction. The at least two adjacent image sub-regions have different authority levels, including: the authority level of the first sub-region is lower than the authority level of the second sub-region; or the authority level of the first sub-region is higher than the authority level of the second sub-region; or the authority level of the first sub-region is not equal to the authority level of the second sub-region; or the authority level of the first sub-region is not equal to the authority level of the second sub-region, and the filtering strength of the adjacent boundaries is greater than or equal to the preset filtering strength.
在一些实施例中,图像滤波单元,还用于确定至少两个图像子区域中第一子区域的水平侧的目标待滤波区域;水平侧为第一子区域相接边界的上侧或下侧,目标待滤波区域为以下任一种:相接边界的下侧待滤波区域、相接边界的上侧待滤波区域、相接边界的下侧待滤波区域和上侧待滤波区域;图像滤波单元,还用于对目标待滤波区域进行去去块效应水平滤波。In some embodiments, the image filtering unit is further used to determine a target area to be filtered on the horizontal side of a first sub-region among at least two image sub-regions; the horizontal side is the upper side or the lower side of the adjacent boundary of the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the lower side of the adjacent boundary, an area to be filtered on the upper side of the adjacent boundary, an area to be filtered on the lower side of the adjacent boundary, and an area to be filtered on the upper side of the adjacent boundary; the image filtering unit is further used to perform horizontal filtering to remove blocking effects on the target area to be filtered.
在一些实施例中,上述相邻的至少两个图像子区域还包括第三子区域,第三子区域与第一子区域垂直相邻,这里的垂直相邻是指第三子区域位于第一子区域水平方向的上侧或下侧。相邻的至少两个图像子区域的权限等级不同,包括:第一子区域的权限等级低于第三子区域的权限等级;或者,第一子区域的权限等级高于第三子区域的权限等级;或者,第一子区域的权限等级不等于第三子区域的权限等级;或者,第一子区域的权限等级不等于第三子区域的权限等级,且相接边界的滤波强度大于或者等于预设滤波强度。In some embodiments, the at least two adjacent image sub-regions further include a third sub-region, and the third sub-region is vertically adjacent to the first sub-region, where vertical adjacent means that the third sub-region is located on the upper side or the lower side of the first sub-region in the horizontal direction. The at least two adjacent image sub-regions have different authority levels, including: the authority level of the first sub-region is lower than the authority level of the third sub-region; or the authority level of the first sub-region is higher than the authority level of the third sub-region; or the authority level of the first sub-region is not equal to the authority level of the third sub-region; or the authority level of the first sub-region is not equal to the authority level of the third sub-region, and the filtering strength of the adjacent boundaries is greater than or equal to the preset filtering strength.
在一些实施例中,图像滤波单元,还用于按照设定的滤波顺序,从至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域;周围侧依次包括:第一子区域与其他子区域的相接边界的左侧、上侧、右侧和下侧,第一子区域的权限等级与其他子区域的权限等级不同,目标待滤波区域为以下 任一种:第一子区域内相较于相接边界的第一侧区域、第一子区域外相较于相接边界的第二侧区域、第一侧区域和第二侧区域;图像滤波单元,还用于按照设定的滤波顺序,对目标待滤波区域进行样本自适应补偿滤波。In some embodiments, the image filtering unit is further used to determine the target area to be filtered from the surrounding side of the first sub-region of at least two image sub-regions according to the set filtering order; the surrounding side includes: the left side, the upper side, the right side and the lower side of the boundary between the first sub-region and the other sub-regions, the authority level of the first sub-region is different from the authority level of the other sub-regions, and the target area to be filtered is as follows Any one: the first side area within the first sub-area compared to the connected boundary, the second side area outside the first sub-area compared to the connected boundary, the first side area and the second side area; the image filtering unit is also used to perform sample adaptive compensation filtering on the target area to be filtered according to the set filtering order.
在一些实施例中,图像滤波单元,还用于按照设定的滤波顺序,从至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域;周围侧依次包括:第一子区域与其他子区域的相接边界的左侧、上侧、右侧和下侧,第一子区域的权限等级与其他子区域的权限等级不同,目标待滤波区域为以下任一种:第一子区域内相较于相接边界的第一侧区域、第一子区域外相较于相接边界的第二侧区域、第一侧区域和第二侧区域;图像滤波单元,还用于按照设定的滤波顺序,对目标待滤波区域进行自适应环路滤波。In some embodiments, the image filtering unit is also used to determine the target area to be filtered from the surrounding side of the first sub-region in at least two image sub-regions according to a set filtering order; the surrounding side includes, in sequence: the left side, top side, right side and bottom side of the boundary between the first sub-region and other sub-regions, the authority level of the first sub-region is different from the authority level of other sub-regions, and the target area to be filtered is any one of the following: the first side area in the first sub-region compared to the connected boundary, the second side area outside the first sub-region compared to the connected boundary, the first side area and the second side area; the image filtering unit is also used to perform adaptive loop filtering on the target area to be filtered according to the set filtering order.
在一些实施例中,图像滤波单元,还用于根据待处理图像的解码信息,判断是否需要对至少两个图像子区域中第一子区域进行基于神经网络的滤波处理;在第一子区域需要进行基于神经网络的滤波处理的情况下,将第一子区域的重建像素值和第一子区域的权限等级,输入神经网络中;获取输出的第一子区域的滤波重建像素。In some embodiments, the image filtering unit is also used to determine whether it is necessary to perform neural network-based filtering processing on the first sub-region of at least two image sub-regions based on the decoded information of the image to be processed; when the first sub-region needs to perform neural network-based filtering processing, the reconstructed pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network; and the filtered reconstructed pixels of the first sub-region are obtained as output.
在一些实施例中,图像滤波单元,还用于将与第一子区域的相邻的至少一个图像子区域的权限等级,输入神经网络中。In some embodiments, the image filtering unit is further used to input the authority level of at least one image sub-region adjacent to the first sub-region into the neural network.
在一些实施例中,图像滤波单元,还用于对至少两个图像子区域之间的相接边界进行亮度通道分量的滤波处理;或者,对至少两个图像子区域之间的相接边界进行色度通道分量的滤波处理;或者,对至少两个图像子区域之间的相接边界进行亮度通道分量和色度通道分量的滤波处理。In some embodiments, the image filtering unit is further used to filter the brightness channel component of the adjacent boundary between at least two image sub-regions; or, to filter the chrominance channel component of the adjacent boundary between at least two image sub-regions; or, to filter the brightness channel component and the chrominance channel component of the adjacent boundary between at least two image sub-regions.
第三方面,本申请提供一种电子设备,包括:存储器和处理器;存储器和处理器耦合;存储器用于存储计算机程序代码,计算机程序代码包括计算机指令;其中,当处理器执行计算机指令时,使得图像处理装置执行如第一方面及其任一种可能的实现方式的图像处理方法。In a third aspect, the present application provides an electronic device, comprising: a memory and a processor; the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code includes computer instructions; wherein, when the processor executes the computer instructions, the image processing device executes the image processing method as in the first aspect and any possible implementation thereof.
第四方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质包括:计算机软件指令;当计算机软件指令在图像处理装置中运行时,使得图像处理装置实现上述第一方面及其任一种可能的实现方式的图像处理方法。In a fourth aspect, the present application provides a computer-readable storage medium, which includes: computer software instructions; when the computer software instructions are executed in an image processing device, the image processing device implements the image processing method of the first aspect and any possible implementation method thereof.
第五方面,本申请提供一种计算机程序产品,当该计算机程序产品在图像处理装置上运行时,使得图像处理装置执行上述第一方面及其任一种可能的实现方式的图像处理方法。上述第二方面至第五方面的有益效果可以参考第一方面的对应描述,不再赘述。In a fifth aspect, the present application provides a computer program product, which, when executed on an image processing device, enables the image processing device to execute the image processing method of the first aspect and any possible implementation thereof. The beneficial effects of the second to fifth aspects can be referred to the corresponding description of the first aspect, and will not be repeated here.
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请提供的一种图像处理流程框架示意图;FIG1 is a schematic diagram of an image processing flow framework provided by the present application;
图2为本申请提供的一种去方块滤波的区域示意图;FIG2 is a schematic diagram of a region for deblocking filtering provided by the present application;
图3为本申请提供的一种滤波块边界示意图;FIG3 is a schematic diagram of a filter block boundary provided by the present application;
图4为本申请提供的一种滤波器的示意图;FIG4 is a schematic diagram of a filter provided by the present application;
图5为本申请提供的一种图像处理装置的结构示意图;FIG5 is a schematic diagram of the structure of an image processing device provided by the present application;
图6为本申请提供的一种图像处理方法的流程示意图;FIG6 is a schematic diagram of a flow chart of an image processing method provided by the present application;
图7为本申请提供的一种检测区域示意图;FIG7 is a schematic diagram of a detection area provided by the present application;
图8为本申请提供的又一种图像处理方法的流程示意图;FIG8 is a schematic diagram of a flow chart of another image processing method provided by the present application;
图9为本申请提供的一种滤波区域示意图;FIG9 is a schematic diagram of a filtering area provided by the present application;
图10为本申请提供的又一种滤波区域示意图;FIG10 is a schematic diagram of another filtering area provided by the present application;
图11为本申请提供的又一种图像处理方法的流程示意图;FIG11 is a schematic diagram of a flow chart of another image processing method provided by the present application;
图12为本申请提供的又一种滤波区域示意图;FIG12 is a schematic diagram of another filtering area provided by the present application;
图13为本申请提供的又一种图像处理方法的流程示意图;FIG13 is a schematic diagram of a flow chart of another image processing method provided by the present application;
图14为本申请提供的又一种滤波区域示意图;FIG14 is a schematic diagram of another filtering area provided by the present application;
图15为本申请提供的又一种图像处理方法的流程示意图;FIG15 is a schematic diagram of a flow chart of another image processing method provided by the present application;
图16为本申请提供的又一种滤波区域示意图;FIG16 is a schematic diagram of another filtering area provided by the present application;
图17为本申请提供的又一种图像处理方法的流程示意图;FIG17 is a schematic diagram of a flow chart of another image processing method provided by the present application;
图18为本申请提供的又一种图像处理方法的流程示意图;FIG18 is a schematic diagram of a flow chart of another image processing method provided by the present application;
图19为本申请提供的一种电子设备的硬件结构示意图。FIG19 is a schematic diagram of the hardware structure of an electronic device provided in this application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
需要说明的是,本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。 本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that, in the embodiments of the present application, words such as “exemplarily” or “for example” are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分,本领域技术人员可以理解“第一”、“第二”等字样并不是在对数量和执行次序进行限定。In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical items or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order.
为了使本领域技术人员更好地理解本申请实施例提供的技术方案,下面先对本申请实施例涉及的部分技术术语以及视频编解码的主要流程进行简单说明。In order to enable those skilled in the art to better understand the technical solution provided by the embodiments of the present application, some technical terms involved in the embodiments of the present application and the main processes of video encoding and decoding are briefly described below.
一、技术术语1. Technical terms
1、去方块滤波(deblocking filter,DBF):用于去除分块编码产生的块边界效应,包括去块效应垂直滤波和去块效应水平滤波。1. Deblocking filter (DBF): used to remove the block boundary effect caused by block coding, including vertical deblocking filter and horizontal deblocking filter.
2、样本自适应补偿滤波(sample adaptive offset,SAO):通过基于样本的像素值和周围块的梯度值进行分类,对于每个类别的像素值加上不同的补偿值,使得重建图像更接近于原始图像。SAO的基本原理就是对重构曲线中的波峰像素加上负值进行补偿,波谷像素加上正值进行补充。SAO以采集传输单元(Collect Transfer unit,CTU)为基本单位,包括两大类补偿形式:边界补偿(Edge Offset,EO)和边带补偿(Band Offset,BO),此外还引入了参数融合技术。样本偏移补偿滤波包括基本样值偏移补偿(上述的SAO),增强样值偏移补偿(ESAO),跨分量样值偏移补偿(CCSAO,只针对色度进行)。2. Sample adaptive offset (SAO): By classifying the pixel values of the samples and the gradient values of the surrounding blocks, different compensation values are added to the pixel values of each category, so that the reconstructed image is closer to the original image. The basic principle of SAO is to add negative values to compensate the peak pixels in the reconstructed curve and add positive values to supplement the trough pixels. SAO uses the Collect Transfer unit (CTU) as the basic unit, including two major types of compensation: edge compensation (EO) and sideband compensation (BO). In addition, parameter fusion technology is introduced. Sample offset compensation filtering includes basic sample value offset compensation (the above-mentioned SAO), enhanced sample value offset compensation (ESAO), and cross-component sample value offset compensation (CCSAO, only for chroma).
3、自适应环路滤波(adaptive loop filter、ALF):通过维纳滤波器,对重建图像进行增强滤波,使得重建图像更接近于原始图像。其中自适应环路滤波可以启用增强自适应修正滤波(EALF)。3. Adaptive loop filter (ALF): The reconstructed image is enhanced and filtered through the Wiener filter to make the reconstructed image closer to the original image. The adaptive loop filter can enable the enhanced adaptive correction filter (EALF).
4、神经网络(Neural Network,NN):神经网络是一种运算模型,由大量的节点(或称神经元)之间相互联接构成。人工神经网络中,神经元处理单元可表示不同的对象,例如特征、字母、概念,或者一些有意义的抽象模式。网络中处理单元的类型分为三类:输入单元、输出单元和隐单元。输入单元接受外部世界的信号与数据;输出单元实现系统处理结果的输出;隐单元是处在输入和输出单元之间,不能由系统外部观察的单元。神经元间的连接权值反映了单元间的连接强度,信息的表示和处理体现在网络处理单元的连接关系中。人工神经网络是一种非程序化、类大脑风格的信息处理方式,其本质是通过网络的变换和动力学行为得到一种并行分布式的信息处理功能,并在不同程度和层次上模仿人脑神经系统的信息处理功能。目前,在视频处理领域,常用的神经网络包括卷积神经网络(CNN)、循环神经网络(RNN)、全连接网络等。4. Neural Network (NN): A neural network is a computational model consisting of a large number of interconnected nodes (or neurons). In an artificial neural network, a neuron processing unit can represent different objects, such as features, letters, concepts, or some meaningful abstract patterns. The types of processing units in the network are divided into three categories: input units, output units, and hidden units. The input unit receives signals and data from the outside world; the output unit realizes the output of the system processing results; the hidden unit is a unit between the input and output units that cannot be observed from outside the system. The connection weights between neurons reflect the connection strength between units, and the representation and processing of information are reflected in the connection relationship of the network processing units. Artificial neural network is a non-programmed, brain-like information processing method. Its essence is to obtain a parallel distributed information processing function through the transformation and dynamic behavior of the network, and imitate the information processing function of the human brain nervous system to varying degrees and levels. At present, in the field of video processing, commonly used neural networks include convolutional neural networks (CNN), recurrent neural networks (RNN), fully connected networks, etc.
二、视频编解码的主要流程2. The main process of video encoding and decoding
如图1所示,以视频编码为例,视频编码一般包括预测、变换、量化、熵编码等过程,进一步地,编码过程还可以按照图1中的框架来实现。As shown in FIG. 1 , taking video coding as an example, video coding generally includes processes such as prediction, transformation, quantization, and entropy coding. Furthermore, the coding process can also be implemented according to the framework in FIG. 1 .
其中,预测可以分为帧内预测和帧间预测,帧内预测是利用周围已编码块作为参考对当前未编码块进行预测,有效去除空域上的冗余。帧间预测是使用邻近已编码图像对当前图像进行预测,有效去除时域上的冗余。Among them, prediction can be divided into intra-frame prediction and inter-frame prediction. Intra-frame prediction uses the surrounding coded blocks as references to predict the current uncoded block, effectively removing redundancy in the spatial domain. Inter-frame prediction uses the neighboring coded images to predict the current image, effectively removing redundancy in the temporal domain.
变换是指将图像从空间域转换至变换域,利用变换系数对图像加以表示。绝大多数图像都含有较多平坦区域和缓慢变化的区域,适当的变换可以使图像由在空间域的分散分布转换为在变换域的相对集中分布,去除信号之间的频域相关性,配合量化过程,可以有效压缩码流。Transformation refers to converting an image from the spatial domain to the transform domain, and using transform coefficients to represent the image. Most images contain many flat areas and slowly changing areas. Appropriate transformation can transform the image from a dispersed distribution in the spatial domain to a relatively concentrated distribution in the transform domain, remove the frequency domain correlation between signals, and cooperate with the quantization process to effectively compress the bit stream.
熵编码是一种无损编码方式,可以把一系列元素符号转变为一个用来传输或存储的二进制码流,输入的符号可能包括量化后的变换系数、运动矢量信息、预测模式信息,变换量化相关语法等。熵编码可以有效地去除视频元素符号的冗余。Entropy coding is a lossless coding method that can transform a series of element symbols into a binary code stream for transmission or storage. The input symbols may include quantized transform coefficients, motion vector information, prediction mode information, transform quantization related syntax, etc. Entropy coding can effectively remove the redundancy of video element symbols.
上述是以编码为例进行介绍,视频解码与视频编码的过程是相对的,即视频解码通常包括熵解码、预测、反量化、反变换、滤波等过程,各个过程的实现原理与熵编码相同或相似。其中,滤波处理包括去方块滤波、样本自适应补偿滤波、自适应环路滤波和基于神经网络的滤波。The above is an introduction based on encoding as an example. The process of video decoding is relative to that of video encoding, that is, video decoding usually includes entropy decoding, prediction, inverse quantization, inverse transformation, filtering and other processes. The implementation principles of each process are the same or similar to entropy encoding. Among them, filtering processing includes deblocking filtering, sample adaptive compensation filtering, adaptive loop filtering and filtering based on neural network.
三、DBF滤波3. DBF Filtering
下面再对DBF滤波处理的实现进行简单说明。The implementation of DBF filtering is briefly described below.
DBF滤波处理包括两个过程:滤波决策和滤波操作。DBF filtering processing includes two processes: filtering decision and filtering operation.
滤波决策包括:1)获取边界滤波强度(BS值);2)滤波开关决策;3)滤波强弱选择。对于色度,仅存在步骤1),且直接复用亮度的BS值。对于色度,只有BS值为2时(即两侧的图像区域至少有一个采用intra模式),才进行滤波操作。The filtering decision includes: 1) obtaining the boundary filter strength (BS value); 2) filtering switch decision; 3) filtering strength selection. For chroma, only step 1) exists, and the BS value of brightness is directly reused. For chroma, filtering is performed only when the BS value is 2 (that is, at least one of the image areas on both sides adopts intra mode).
滤波操作包括:1)对于亮度的强滤波和弱滤波;2)对于色度的滤波。The filtering operations include: 1) strong filtering and weak filtering for luminance; 2) filtering for chrominance.
满足以下条件之一的待滤波边界不需要进行DBF滤波:The boundary to be filtered that meets one of the following conditions does not need DBF filtering:
条件1:如果待滤波边界是图像边界,则该边界不需要滤波。 Condition 1: If the boundary to be filtered is an image boundary, then the boundary does not need to be filtered.
条件2:如果待滤波边界是片边界且跨片环路滤波允许标志为0,则该边界不需要滤波。Condition 2: If the boundary to be filtered is a slice boundary and the cross-slice loop filtering enable flag is 0, then filtering is not required for this boundary.
条件3:如果待滤波边界是亮度滤波边界,且该亮度滤波边界不是亮度编码块或亮度变换块的边界,则该边界不需要滤波。Condition 3: If the boundary to be filtered is a luminance filtering boundary, and the luminance filtering boundary is not a boundary of a luminance coding block or a luminance transform block, then the boundary does not need to be filtered.
条件4:如果待滤波边界是色度滤波边界,且该色度滤波边界不是色度编码块或色度变换块的边界,且该色度滤波边界对应的亮度滤波边界不是亮度编码块的边界,则该边界不需要滤波。Condition 4: If the boundary to be filtered is a chroma filter boundary, and the chroma filter boundary is not a boundary of a chroma coding block or a chroma transform block, and the luminance filter boundary corresponding to the chroma filter boundary is not a boundary of a luminance coding block, then the boundary does not need to be filtered.
条件5:如果待滤波边界是亮度滤波边界,且该亮度滤波边界所在的编码单元的子块变换标志为1,且该亮度滤波边界不是亮度编码块的边界,则该边界不需要滤波。Condition 5: If the boundary to be filtered is a luminance filtering boundary, and the sub-block transform flag of the coding unit where the luminance filtering boundary is located is 1, and the luminance filtering boundary is not a boundary of a luminance coding block, then the boundary does not need to be filtered.
条件6:如果待滤波边界所在的编码单元的串复制帧内预测模式标志为1,则该边界不需要滤波。Condition 6: If the string copy intra prediction mode flag of the coding unit where the boundary to be filtered is located is 1, then the boundary does not need to be filtered.
DBF滤波处理一般以8x8为单位进行去块效应垂直滤波和去块效应水平滤波,且DBF滤波处理最多对当前块(待滤波图像区域)相接边界两侧的3个像素点进行滤波,且最多利用到相接边界两侧的4个像素点进行滤波,因此不同块垂直/水平滤波互不影响,可以并行进行。如图2所示,对于当前8x8块,先进行当前块左侧3列和左边块右侧3列的垂直滤波,再进行当前块上侧3行和上边块下侧3行像素的水平滤波。DBF filtering generally performs deblocking vertical filtering and deblocking horizontal filtering in units of 8x8, and DBF filtering filters at most 3 pixels on both sides of the border of the current block (image area to be filtered), and uses at most 4 pixels on both sides of the border for filtering, so vertical/horizontal filtering of different blocks does not affect each other and can be performed in parallel. As shown in Figure 2, for the current 8x8 block, vertical filtering is first performed on the 3 columns on the left side of the current block and the 3 columns on the right side of the left block, and then horizontal filtering is performed on the 3 rows on the upper side of the current block and the 3 rows on the lower side of the upper block.
(一)对边界强度,即BS值的推导过程如下:(I) The derivation process of boundary strength, i.e. BS value, is as follows:
如图3所示,示出了当前块的垂直侧的相接边界(垂直边界)和水平侧的相接边界(水平边界)的示意图,垂直边界/水平边界两侧的8个像素样本分别记为p0、p1、p2、p3和q0、q1、q2、q3。需要注意的是,在计算边界滤波强度BS值时,是针对当前块的像素点计算边界滤波强度BS值,即边界是针对当前块的像素点的边界,而不是针对当前亮度块或者当前色度块的边界。As shown in Fig. 3, a schematic diagram of the vertical side connecting boundary (vertical boundary) and the horizontal side connecting boundary (horizontal boundary) of the current block is shown, and the 8 pixel samples on both sides of the vertical boundary/horizontal boundary are recorded as p 0 , p 1 , p 2 , p 3 and q 0 , q 1 , q 2 , q 3 respectively. It should be noted that when calculating the boundary filter strength BS value, the boundary filter strength BS value is calculated for the pixel points of the current block, that is, the boundary is the boundary of the pixel points of the current block, rather than the boundary of the current luminance block or the current chrominance block.
边界滤波强度确定方式一、Boundary filter strength determination method 1:
如果满足以下所有条件,则边界滤波强度BS值等于0。If all of the following conditions are met, the boundary filter strength BS value is equal to 0.
a)p0和q0所在的编码单元变换块的量化系数均为0。其中,如果p0(或q0)是亮度样本且p0(或q0)所在的编码单元只包含亮度样本,则p0(或q0)所在的编码单元指包含p0(或q0)的亮度编码单元;如果p0(或q0)是色度样本且p0(或q0)所在的编码单元只包含色度样本,则p0(或q0)所在的编码单元指包含p0(或q0)对应亮度样本的编码单元;否则(即p0或q0所在的编码单元同时包含亮度样本和色度样本),则p0(或q0)所在的编码单元指包含p0(或q0)的编码单元。a) The quantization coefficients of the transform blocks of the coding units where p 0 and q 0 are located are all 0. If p 0 (or q 0 ) is a luma sample and the coding unit where p 0 (or q 0 ) is located only contains luma samples, then the coding unit where p 0 (or q 0 ) is located refers to the luma coding unit containing p 0 (or q 0 ); if p 0 (or q 0 ) is a chroma sample and the coding unit where p 0 (or q 0 ) is located only contains chroma samples, then the coding unit where p 0 (or q 0 ) is located refers to the coding unit containing the luma sample corresponding to p 0 (or q 0 ); otherwise (i.e., the coding unit where p 0 or q 0 is located contains both luma samples and chroma samples), then the coding unit where p 0 (or q 0 ) is located refers to the coding unit containing p 0 (or q 0 ).
b)p0和q0所在的编码单元的预测类型不是帧内。b) The prediction type of the coding unit where p 0 and q 0 are located is not intra frame.
c)记BP和BQ分别是p0和q0所在的4×4亮度编码块,BP和BQ的运动信息同时满足下列条件1和2或同时满足条件3、4和5。c) Let BP and BQ be the 4×4 luminance coding blocks where p0 and q0 are located respectively, and the motion information of BP and BQ satisfies the following conditions 1 and 2 at the same time or satisfies conditions 3, 4 and 5 at the same time.
1)BP和BQ分别对应的空域运动信息存储单元的L0参考索引均等于-1,或BP和BQ分别对应的空域运动信息存储单元的L0参考索引对应的参考帧为同一帧且空域运动信息存储单元的L0运动矢量的所有分量的差均小于一个整像素点。1) The L0 reference indexes of the spatial motion information storage units corresponding to BP and BQ are both equal to -1, or the reference frames corresponding to the L0 reference indexes of the spatial motion information storage units corresponding to BP and BQ are the same frame and the differences of all components of the L0 motion vectors of the spatial motion information storage units are less than an integer pixel.
2)BP和BQ分别对应的空域运动信息存储单元的L1参考索引均等于-1,或BP和BQ分别对应的空域运动信息存储单元的L1参考索引对应的参考帧为同一帧且空域运动信息存储单元的L1运动矢量的所有分量的差均小于一个整像素点。2) The L1 reference indexes of the spatial motion information storage units corresponding to BP and BQ are both equal to -1, or the reference frames corresponding to the L1 reference indexes of the spatial motion information storage units corresponding to BP and BQ are the same frame and the differences of all components of the L1 motion vectors of the spatial motion information storage units are less than an integer pixel.
3)满足以下条件之一:3) Meet one of the following conditions:
BP对应的空域运动信息存储单元的L0参考索引等于-1且BQ对应的空域运动信息存储单元的L1参考索引等于-1。The L0 reference index of the spatial motion information storage unit corresponding to BP is equal to -1 and the L1 reference index of the spatial motion information storage unit corresponding to BQ is equal to -1.
BP对应的空域运动信息存储单元的L0参考索引对应的参考帧与BQ对应的空域运动信息存储单元的L1参考索引对应的参考帧为同一帧且BP对应的空域运动信息存储单元的L0运动矢量和BQ对应的空域运动信息存储单元的L1运动矢量的所有分量的差均小于一个整像素点。The reference frame corresponding to the L0 reference index of the spatial motion information storage unit corresponding to BP and the reference frame corresponding to the L1 reference index of the spatial motion information storage unit corresponding to BQ are the same frame, and the differences between all components of the L0 motion vector of the spatial motion information storage unit corresponding to BP and the L1 motion vector of the spatial motion information storage unit corresponding to BQ are less than an integer pixel.
4)满足以下条件之一:4) Meet one of the following conditions:
条件1:BQ对应的空域运动信息存储单元的L0参考索引等于-1且BP对应的空域运动信息存储单元的L1参考索引等于-1。Condition 1: The L0 reference index of the spatial motion information storage unit corresponding to B Q is equal to -1 and the L1 reference index of the spatial motion information storage unit corresponding to BP is equal to -1.
条件2:BQ对应的空域运动信息存储单元的L0参考索引对应的参考帧与BP对应的空域运动信息存储单元的L1参考索引对应的参考帧为同一帧且BQ对应的空域运动信息存储单元的L0运动矢量和BP对应的空域运动信息存储单元的L1运动矢量的所有分量的差均小于一个整像素点。Condition 2: The reference frame corresponding to the L0 reference index of the spatial motion information storage unit corresponding to B Q and the reference frame corresponding to the L1 reference index of the spatial motion information storage unit corresponding to BP are the same frame and the differences between all components of the L0 motion vector of the spatial motion information storage unit corresponding to B Q and the L1 motion vector of the spatial motion information storage unit corresponding to BP are less than an integer pixel.
5)BP对应的空域运动信息存储单元的L0参考索引对应的参考帧和BQ对应的空域运动信息存储单元的L0参考索引对应的参考帧不为同一帧;BP对应的空域运动信息存储单元的L1参考索引对应的参考帧和BQ对应的空域运动信息存储单元的L1参考索引对应的参考帧不为同一帧。5) The reference frame corresponding to the L0 reference index of the spatial motion information storage unit corresponding to BP and the reference frame corresponding to the L0 reference index of the spatial motion information storage unit corresponding to BQ are not the same frame; the reference frame corresponding to the L1 reference index of the spatial motion information storage unit corresponding to BP and the reference frame corresponding to the L1 reference index of the spatial motion information storage unit corresponding to BQ are not the same frame.
否则,按边界滤波强度确定方式二,计算边界滤波强度Bs值。Otherwise, the boundary filter strength Bs value is calculated according to the second boundary filter strength determination method.
边界滤波强度确定方式二、Boundary filter strength determination method 2:
步骤一、计算p0和q0所在的编码单元的平均量化参数QPav。如果是亮度样本,应使用亮度编码块的量化参数;如果是色度样本,应使用色度编码块的量化参数。令p0所在编码单元的量化参数 为QPp,q0所在编码单元的量化参数为QPq,平均量化参数为:
Step 1: Calculate the average quantization parameter QPav of the coding unit where p0 and q0 are located. If it is a luma sample, the quantization parameter of the luma coding block should be used; if it is a chroma sample, the quantization parameter of the chroma coding block should be used. Let the quantization parameter of the coding unit where p0 is located be is QP p , the quantization parameter of the coding unit where q 0 is located is QP q , and the average quantization parameter is:
步骤二、计算索引IndexA和IndexB。
Step 2: Calculate indexes IndexA and IndexB.
步骤三、分别根据IndexA和IndexB查表得到α'和β'的值,再根据BitDepth得到α、β的值。
Step 3: Look up the table according to IndexA and IndexB to get the values of α' and β' respectively, and then get the values of α and β according to BitDepth.
示例性的,“>>”为右移位运算,用于替代除法,即“>>5”相当于除以25(即32)。此外,本申请实施例中,乘法(即“*”)在实际实现时可以通过左移位的方式来替代。例如,a乘以4可以通过左移2位替代,即通过a<<2替代;a乘以10,可以通过(a<<3)+(a<<1)替代。Exemplarily, “>>” is a right shift operation, which is used to replace division, that is, “>>5” is equivalent to division by 25 (that is, 32). In addition, in the embodiment of the present application, multiplication (that is, “*”) can be replaced by left shift in actual implementation. For example, a multiplied by 4 can be replaced by left shifting 2 bits, that is, by a<<2; a multiplied by 10 can be replaced by (a<<3)+(a<<1).
示例性的,“<<”为左移位运算,用于替代乘法,即“a<<2”相当于乘以22(即4)。Exemplarily, “<<” is a left shift operation, which is used to replace multiplication, that is, “a<<2” is equivalent to multiplication by 22 (ie, 4).
示例性的,考虑到通过移位的方式实现除法运算时,对于运算结果通常直接取整,For example, when a division operation is implemented by shifting, the operation result is usually directly rounded.
即当运算结果为N~N+1之间的非整数时,取结果为N,而考虑到当小数部分大于0.5时,取结果为N+1的准确性会更高,因此,为了提高所确定的像素值的准确性,进行计算时,可以为上述加权和的分子加上分母(即被除数)的1/2,以达到四舍五入的效果。That is, when the calculation result is a non-integer between N and N+1, the result is N. Considering that when the decimal part is greater than 0.5, the accuracy of taking the result as N+1 will be higher, therefore, in order to improve the accuracy of the determined pixel value, when performing the calculation, the numerator of the above weighted sum can be added with 1/2 of the denominator (i.e., the dividend) to achieve the effect of rounding.
步骤四、如果DeblockingFilterType为1,且Abs(p0-q0)大于或等于4×α,则Bs等于0;否则,按以下方法计算Bs值。Step 4: If DeblockingFilterType is 1 and Abs(p0-q0) is greater than or equal to 4×α, Bs is equal to 0; otherwise, calculate the Bs value as follows.
1)将fL和fR的值均置为0,计算fS。
1) Set the values of fL and fR to 0 and calculate fS.
2)根据fS确定Bs值,存在以下情况。2) Determine the Bs value based on fS, and the following situations exist.
情况一、当fS等于6时,如果Abs(p0-p1)小于或等于β/4且Abs(q0-q1)小于或等于β/4且Abs(p0-q0)小于α,则Bs值等于4;否则Bs值等于3。Case 1: when fS is equal to 6, if Abs(p 0 -p 1 ) is less than or equal to β/4 and Abs(q 0 -q 1 ) is less than or equal to β/4 and Abs(p 0 -q 0 ) is less than α, then the Bs value is equal to 4; otherwise, the Bs value is equal to 3.
情况二、当fS等于6且DeblockingFilterType等于1时,如果Abs(p0-p1)小于或等于β/4且Abs(q0-q1)小于或等于β/4且Abs(p0-p3)小于或等于β/2且Abs(q0-q3)小于或等于β/2且Abs(p0-q0)小于α,则Bs值等于4;否则Bs值等于3。Case 2: When fS is equal to 6 and DeblockingFilterType is equal to 1, if Abs(p0-p1) is less than or equal to β/4 and Abs(q0-q1) is less than or equal to β/4 and Abs(p0-p3) is less than or equal to β/2 and Abs(q0-q3) is less than or equal to β/2 and Abs(p0-q0) is less than α, then the Bs value is equal to 4; otherwise, the Bs value is equal to 3.
情况三、当fS等于5时,如果p0等于p1且q0等于q1,则Bs值等于3;否则Bs值等于2。Case 3: When fS is equal to 5, if p0 is equal to p1 and q0 is equal to q1 , then the Bs value is equal to 3; otherwise, the Bs value is equal to 2.
情况四、当fS等于5且DeblockingFilterType等于1时,如果p0等于p1且q0等于q1且Abs(p2-q2)小于α,则Bs值等于3;否则Bs值等于2。Case 4: When fS is equal to 5 and DeblockingFilterType is equal to 1, if p0 is equal to p1 and q0 is equal to q1 and Abs(p2-q2) is less than α, then the Bs value is equal to 3; otherwise, the Bs value is equal to 2.
情况五、当fS等于4时,如果fL等于2,则Bs值等于2;否则Bs值等于1。Case 5: When fS is equal to 4, if fL is equal to 2, the Bs value is equal to 2; otherwise, the Bs value is equal to 1.
情况六、当fS等于3时,如果Abs(p1-q1)小于β,则Bs值等于1;否则Bs值等于0。Case 6: When fS is equal to 3, if Abs(p 1 -q 1 ) is less than β, the Bs value is equal to 1; otherwise, the Bs value is equal to 0.
情况七、当fS为其它值时,Bs值等于0。Case 7: When fS is other value, Bs value is equal to 0.
3)如果步骤2)得到的Bs值不等于0且滤波的边界是色度编码块边界,则Bs值减1。3) If the Bs value obtained in step 2) is not equal to 0 and the filtered boundary is a chroma coding block boundary, the Bs value is reduced by 1.
(二)确定去块滤波调整参数(II) Determine the deblocking filter adjustment parameters
确定去块滤波调整参数DbrThresold、DbrOffset0、DbrOffset1、DbrAltOffset0和DbrAltOffset1。Deblocking filter adjustment parameters DbrThresold, DbrOffset0, DbrOffset1, DbrAltOffset0 and DbrAltOffset1 are determined.
如果当前为垂直边界且PictureDbrVEnableFlag为1,或当前为水平边界且PictureDbrHEnableFlag为1,则PictureDbrEnableFlag的值为1;否则,PictureDbrEnableFlag的值为0。If the current boundary is a vertical boundary and PictureDbrVEnableFlag is 1, or if the current boundary is a horizontal boundary and PictureDbrHEnableFlag is 1, the value of PictureDbrEnableFlag is 1; otherwise, the value of PictureDbrEnableFlag is 0.
如果当前为垂直边界且PictureAltDbrVEnableFlag为1,或当前为水平边界且PictureAltDbrHEnableFlag为1,则PictureAltDbrEnableFlag的值为1;否则,PictureAltDbrEnableFlag的值为0。If the current boundary is a vertical boundary and PictureAltDbrVEnableFlag is 1, or if the current boundary is a horizontal boundary and PictureAltDbrHEnableFlag is 1, the value of PictureAltDbrEnableFlag is 1; otherwise, the value of PictureAltDbrEnableFlag is 0.
对于垂直边界:
For vertical borders:
对于水平边界:
For horizontal borders:
(三)亮度分量Bs等于4时的边界滤波过程(III) Boundary filtering process when the brightness component Bs is equal to 4
边界滤波强度Bs的值为4时,对p0、p1、p2和q0、q1、q2滤波的计算过程如下(P0、P1、P2和Q0、Q1、Q2是滤波后的值):
When the value of the boundary filter strength Bs is 4, the calculation process of filtering p0 , p1 , p2 and q0 , q1 , q2 is as follows ( P0 , P1 , P2 and Q0 , Q1 , Q2 are the values after filtering):
如果PictureDbrEnableFlag的值为1,按下面的“(九)去块效应滤波调整过程”调整P0、P1、P2、Q0、Q1和Q2的值。If the value of PictureDbrEnableFlag is 1, the values of P 0 , P 1 , P 2 , Q 0 , Q 1 and Q 2 are adjusted according to the following “(IX) Deblocking filter adjustment process”.
(四)亮度分量Bs等于3时的边界滤波过程(IV) Boundary filtering process when the brightness component Bs is equal to 3
边界滤波强度Bs的值为3时,对p0、p1和q0、q1滤波的计算过程如下(P0、P1和Q0、Q1是滤波后的值):
When the value of the boundary filter strength Bs is 3, the calculation process of filtering p0 , p1 and q0 , q1 is as follows ( P0 , P1 and Q0 , Q1 are the values after filtering):
如果PictureDbrEnableFlag的值为1,按下面的“(九)去块效应滤波调整过程”调整P0、P1、Q0和Q1的值。If the value of PictureDbrEnableFlag is 1, the values of P 0 , P 1 , Q 0 and Q 1 are adjusted according to the following “(IX) Deblocking filter adjustment process”.
(五)亮度分量Bs等于2时的边界滤波过程(V) Boundary filtering process when the brightness component Bs is equal to 2
边界滤波强度Bs的值为2时,对p0和q0滤波的计算过程如下(P0和Q0是滤波后的值):
When the value of the boundary filter strength Bs is 2, the calculation process for filtering p0 and q0 is as follows ( P0 and Q0 are the values after filtering):
如果PictureDbrEnableFlag的值为1,按下面的“(九)去块效应滤波调整过程”调整P0和Q0的值。If the value of PictureDbrEnableFlag is 1, adjust the values of P0 and Q0 according to the following "(IX) Deblocking filter adjustment process".
(六)亮度分量Bs等于1时的边界滤波过程(VI) Boundary filtering process when the brightness component Bs is equal to 1
边界滤波强度Bs的值为1时,对p0和q0滤波的计算过程如下(P0和Q0是滤波后的值):
When the value of the boundary filter strength Bs is 1, the calculation process of the p 0 and q 0 filtering is as follows (P 0 and Q 0 are the values after filtering):
如果PictureDbrEnableFlag的值为1,按下面的“(九)去块效应滤波调整过程”调整P0和Q0的值。If the value of PictureDbrEnableFlag is 1, adjust the values of P0 and Q0 according to the following "(IX) Deblocking filter adjustment process".
(七)亮度分量Bs等于0时的边界滤波过程(VII) Boundary filtering process when the brightness component Bs is equal to 0
边界滤波强度Bs的值为0且PictureAltDbrEnableFlag的值为1时,对p0和q0滤波调整的计算过程如下(P0和Q0是滤波调整后的值):

When the value of the boundary filter strength Bs is 0 and the value of PictureAltDbrEnableFlag is 1, the calculation process for the filter adjustment of p 0 and q 0 is as follows (P 0 and Q 0 are the values after the filter adjustment):

(八)色度分量Bs大于0时的边界滤波过程(VIII) Boundary filtering process when the chrominance component Bs is greater than 0
边界滤波强度Bs的值大于0时,对p0和q0滤波的计算过程如下(P0和Q0是滤波后的值):
When the value of the boundary filter strength Bs is greater than 0, the calculation process of the p 0 and q 0 filtering is as follows (P 0 and Q 0 are the values after filtering):
边界滤波强度Bs的值等于3时,对p1和q1滤波的计算过程如下(P1和Q1是滤波后的值):
When the value of the boundary filter strength Bs is equal to 3, the calculation process of the p1 and q1 filtering is as follows ( P1 and Q1 are the filtered values):
(九)去块效应滤波调整过程(IX) Deblocking filter adjustment process
调整Pi和Qi(i可为0、1或2)的值:
Adjust the values of Pi and Qi (i can be 0, 1 or 2):
Clip1(x)表示将x限制在[0,2^(bit_depth)-1]之间(包括0和2^(bit_depth)-1)。bit_depth表示图像的比特深度,一般为8、10、12等。Clip1(x) means to limit x to the range [0,2^(bit_depth)-1] (including 0 and 2^(bit_depth)-1). bit_depth represents the bit depth of the image, which is usually 8, 10, 12, etc.
四、SAO滤波4. SAO Filter
SAO滤波用于消除振铃效应。振铃效应是由于高频交流系数的量化失真,解码后会在边缘周围产生波纹的现象,变换块尺寸越大振铃效应越明显。SAO的基本原理就是对重构曲线中的波峰像素加上负值进行补偿,波谷像素加上正值进行补充。SAO以采集传输单元(Collect Transfer unit,CTU)为基本单位,包括两大类补偿形式:边界补偿(Edge Offset,EO)和边带补偿(Band Offset,BO),此外还引入了参数融合技术。SAO filtering is used to eliminate the ringing effect. The ringing effect is caused by the quantization distortion of the high-frequency AC coefficient. After decoding, ripples will appear around the edge. The larger the transform block size, the more obvious the ringing effect. The basic principle of SAO is to add negative values to compensate the peak pixels in the reconstructed curve and add positive values to supplement the trough pixels. SAO uses the Collect Transfer unit (CTU) as the basic unit, including two types of compensation forms: edge offset (EO) and sideband offset (BO). In addition, parameter fusion technology is introduced.
样本偏移补偿滤波包括基本样值偏移补偿(上述的SAO),增强样值偏移补偿(上述的ESAO),跨分量样值偏移补偿(上述的CCSAO,只针对色度进行)。The sample offset compensation filtering includes basic sample offset compensation (the above-mentioned SAO), enhanced sample offset compensation (the above-mentioned ESAO), and cross-component sample offset compensation (the above-mentioned CCSAO, which is performed only for chrominance).
SAO的基本过程:The basic process of SAO:
如果当前块的当前分量启用SAO,则先导出基本样值偏移补偿单元,再导出与当前基本样值偏移补偿单元对应的基本样值偏移补偿信息,最后对当前基本样值偏移补偿单元内的各个样本的各分量进行操作,得到偏移后样本值。否则,直接将滤波后样本对应分量的值作为偏移后该样本分量的值。If the current component of the current block enables SAO, the basic sample value offset compensation unit is first derived, and then the basic sample value offset compensation information corresponding to the current basic sample value offset compensation unit is derived, and finally the components of each sample in the current basic sample value offset compensation unit are operated to obtain the offset sample value. Otherwise, the value of the corresponding component of the filtered sample is directly used as the value of the sample component after offset.
ESAO的基本过程(ESAO和SAO是互斥的,即启用SAO则不启用ESAO):The basic process of ESAO (ESAO and SAO are mutually exclusive, that is, if SAO is enabled, ESAO is not enabled):
如果当前块的当前分量启用ESAO,先导出增强样值偏移补偿单元,再对增强样值偏移补偿单元内的各个样本的各个分量进行操作,得到偏移后样本值;否则,直接将滤波后样本对应分量的值作为偏移后该样本分量的值。If ESAO is enabled for the current component of the current block, the enhanced sample value offset compensation unit is first derived, and then each component of each sample in the enhanced sample value offset compensation unit is operated to obtain the offset sample value; otherwise, the value of the corresponding component of the filtered sample is directly used as the value of the sample component after offset.
CCSAO的基本过程:The basic process of CCSAO:
如果当前块的当前分量启用CCSAO,先导出跨分量样值偏移补偿单元,然后对当前跨分量样值偏移补偿单元内的各分量样本进行操作,得到跨分量偏移后样本值。否则,直接将偏移后样本对应分量的值作为跨分量偏移后该样本分量的值。If CCSAO is enabled for the current component of the current block, the cross-component sample value offset compensation unit is first derived, and then the component samples in the current cross-component sample value offset compensation unit are operated to obtain the cross-component offset sample value. Otherwise, the value of the component corresponding to the offset sample is directly used as the value of the sample component after the cross-component offset.
对于需要进行CCSAO的色度像素,基于对应位置的去块滤波(调整)后的亮度值(上述的Y5)和当前色度像素(经过ESAO之后的像素),确定当前色度像素的分类。基于分类,确定当前色度像素的补偿值,将当前色度像素加上该补偿值,得到CCSAO滤波后的色度像素值。For the chroma pixel that needs to be CCSAO, the classification of the current chroma pixel is determined based on the luminance value (the above-mentioned Y5) after deblocking filtering (adjustment) at the corresponding position and the current chroma pixel (the pixel after ESAO). Based on the classification, the compensation value of the current chroma pixel is determined, and the current chroma pixel is added with the compensation value to obtain the chroma pixel value after CCSAO filtering.
五、ALF滤波5. ALF Filtering
ALF滤波是根据原始信号和失真信号计算得到均方意义下的最优滤波器,即维纳滤波器。自适应修正滤波(上述ALF)可以启用增强自适应修正滤波(上述EALF),也可以不启用增强自适应修 正滤波。ALF filtering is the optimal filter in the mean square sense calculated based on the original signal and the distorted signal, that is, the Wiener filter. The adaptive correction filter (ALF) can enable the enhanced adaptive correction filter (EALF) or not. Positive filtering.
ALF的基本过程如下:The basic process of ALF is as follows:
如果当前图像的当前分量不启用ALF,则直接将偏移后样本分量的值作为对应重建样本分量的值;否则,对相应的偏移后样本分量进行自适应修正滤波。If the current component of the current image does not enable ALF, the value of the offset sample component is directly used as the value of the corresponding reconstructed sample component; otherwise, adaptive correction filtering is performed on the corresponding offset sample component.
自适应修正滤波的单位是由最大编码单元导出的自适应修正滤波单元,按照光栅扫描顺序依次处理。首先解码各分量的自适应修正滤波系数,再导出自适应修正滤波单元,并确定当前自适应修正滤波单元亮度分量的自适应修正滤波系数索引,最后对自适应修正滤波单元的亮度和色度分量进行自适应修正滤波,得到重建样本。The unit of the adaptive correction filter is an adaptive correction filter unit derived from the maximum coding unit, which is processed in sequence according to the raster scanning order. First, the adaptive correction filter coefficients of each component are decoded, then the adaptive correction filter unit is derived, and the adaptive correction filter coefficient index of the brightness component of the current adaptive correction filter unit is determined. Finally, the brightness and chrominance components of the adaptive correction filter unit are adaptively corrected to obtain the reconstructed sample.
如果当前图像启用EALF,则当前图像的ALF的每组滤波系数有15个,形状如图4中的(a)所示,当前图像亮度分量自适应修正滤波器的个数的最大值为64;否则,当前图像的ALF的每组滤波系数有9个,形状图4中的(b)所示,当前图像亮度分量自适应修正滤波器的个数的最大值为16。If EALF is enabled for the current image, each group of filter coefficients of the ALF of the current image has 15, and the shape is shown in (a) of Figure 4. The maximum number of adaptive correction filters for the brightness component of the current image is 64. Otherwise, each group of filter coefficients of the ALF of the current image has 9, and the shape is shown in (b) of Figure 4. The maximum number of adaptive correction filters for the brightness component of the current image is 16.
不管是DBF滤波处理、SAO处理滤波还是ALF滤波处理,均是基于待滤波的相接边界的当前像素值,或当前块的像素值和当前块的周围侧的相邻块的像素值的关系(例如权限等级的高低)进行分类,再基于不同类别进行不同滤波操作。Regardless of DBF filtering, SAO filtering or ALF filtering, they are all classified based on the current pixel value of the adjacent boundary to be filtered, or the relationship between the pixel value of the current block and the pixel value of the adjacent blocks on the surrounding side of the current block (such as the level of authority), and then different filtering operations are performed based on different categories.
如前文所述,在视频编解码中,滤波处理的目的是实现视频图像块内平滑降噪、去细节,并最大程度保留图像边缘的功能。通常,电子设备对图像中多个区域的边界进行滤波处理,以保留图像边缘。As mentioned above, in video coding and decoding, the purpose of filtering is to achieve smooth noise reduction and detail removal within a video image block, and to retain the image edge to the greatest extent. Generally, electronic devices filter the boundaries of multiple regions in an image to retain the image edge.
而为了保护用户的数据安全,一般的图像可以设置有权限区域(例如,高权限等级区域、低权限等级区域)和非权限区域(零权限等级区域),权限区域可以包括多个高低等级不同的权限区域。权限区域是指只有具有相关权限的用户才能正确解码该区域图像内容的区域。示例性的,只有具有高权限的用户可以正确查看任意权限等级的图像区域,而只具有低权限的用户无法查看更高权限等级的图像区域,其只能查看低权限等级的图像区域和零权限等级区域的图像区域。In order to protect the data security of users, general images can be set with permission areas (for example, high permission level areas, low permission level areas) and non-permission areas (zero permission level areas), and the permission areas can include multiple permission areas of different high and low levels. A permission area refers to an area where only users with relevant permissions can correctly decode the image content of the area. Exemplarily, only users with high permissions can correctly view image areas of any permission level, while users with only low permissions cannot view image areas of higher permission levels, and can only view image areas of low permission levels and image areas of zero permission level areas.
因此由于不同用户对图像中不同区域的查看权限不同,在低权限用户不具有图像中高权限区域的查看权限的情况下,电子设备在视频解码的过程中,不会对权限等级存在差异的图像区域的相接边界进行滤波处理,从而导致图像的质量较差。Therefore, since different users have different viewing permissions for different areas in the image, when a low-authority user does not have viewing permissions for high-authority areas in the image, the electronic device will not filter the adjacent boundaries of image areas with different permission levels during the video decoding process, resulting in poor image quality.
针对该问题,本申请实施例提供一种图像处理方法、装置、电子设备及存储介质,该方法通过电子设备将待处理图像划分为多个图像子区域,并获取每个图像子区域的权限等级,对每个图像子区域的权限等级进行判断,若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,说明上述两个图像子区域在经过解码过程的滤波后,可能仍存在着未进行滤波处理的情况,待处理图像的质量不高。因此基于权限区域的划分等解码信息,电子设备可以对至少两个图像子区域之间的相接边界再次进行滤波处理,可以改善待处理图像中不同权限区域的图像质量。To address this problem, the embodiments of the present application provide an image processing method, device, electronic device, and storage medium. The method divides the image to be processed into multiple image sub-regions through an electronic device, obtains the authority level of each image sub-region, and judges the authority level of each image sub-region. If the authority levels of at least two adjacent image sub-regions in the multiple image sub-regions are different, it means that the above two image sub-regions may still not be filtered after filtering in the decoding process, and the quality of the image to be processed is not high. Therefore, based on the decoding information such as the division of the authority region, the electronic device can filter the adjacent boundaries between at least two image sub-regions again, which can improve the image quality of different authority regions in the image to be processed.
本申请实施例提供的图像处理方法,可以应用于如图5所示的图像处理装置11中,该图像处理装置11包括图像划分单元101、图像滤波单元102,图像解码单元103。The image processing method provided in the embodiment of the present application may be applied to an image processing device 11 as shown in FIG. 5 . The image processing device 11 includes an image dividing unit 101 , an image filtering unit 102 , and an image decoding unit 103 .
图像划分单元101,用于将待处理图像划分为多个图像子区域,The image division unit 101 is used to divide the image to be processed into a plurality of image sub-regions.
图像解码单元103,用于获取每个图像子区域的权限等级。The image decoding unit 103 is used to obtain the permission level of each image sub-region.
图像滤波单元102,用于若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,对至少两个图像子区域之间的相接边界进行滤波处理。The image filtering unit 102 is configured to perform filtering processing on a boundary between at least two adjacent image sub-regions among the plurality of image sub-regions if the authority levels of at least two adjacent image sub-regions are different.
图像解码单元103,还用于接收待处理图像的解码码流,基于解码码流进行解码,获取解码后的待处理图像。The image decoding unit 103 is further configured to receive a decoded code stream of the image to be processed, perform decoding based on the decoded code stream, and obtain a decoded image to be processed.
在一些实施例中,图像滤波单元102,还用于确定至少两个图像子区域中第一子区域的垂直侧的目标待滤波区域;垂直侧为第一子区域相接边界的左侧或右侧,目标待滤波区域为以下任一种:相接边界的右侧待滤波区域、相接边界的左侧待滤波区域、相接边界的右侧待滤波区域和左侧待滤波区域;图像滤波单元102,还用于对目标待滤波区域进行去去块效应垂直滤波。In some embodiments, the image filtering unit 102 is further used to determine a target area to be filtered on the vertical side of a first sub-region among at least two image sub-regions; the vertical side is the left or right side of a connected boundary of the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the right side of the connected boundary, an area to be filtered on the left side of the connected boundary, an area to be filtered on the right side of the connected boundary, and an area to be filtered on the left side; the image filtering unit 102 is further used to perform vertical filtering to remove blocking effects on the target area to be filtered.
在一些实施例中,图像滤波单元102,还用于确定至少两个图像子区域中第一子区域的水平侧的目标待滤波区域;水平侧为第一子区域相接边界的上侧或下侧,目标待滤波区域为以下任一种:相接边界的下侧待滤波区域、相接边界的上侧待滤波区域、相接边界的下侧待滤波区域和上侧待滤波区域;图像滤波单元102,还用于对目标待滤波区域进行去去块效应水平滤波。In some embodiments, the image filtering unit 102 is further used to determine a target area to be filtered on the horizontal side of a first sub-region among at least two image sub-regions; the horizontal side is the upper side or the lower side of the adjacent boundary of the first sub-region, and the target area to be filtered is any one of the following: an area to be filtered on the lower side of the adjacent boundary, an area to be filtered on the upper side of the adjacent boundary, an area to be filtered on the lower side of the adjacent boundary, and an area to be filtered on the upper side; the image filtering unit 102 is further used to perform horizontal filtering to remove blocking effects on the target area to be filtered.
在一些实施例中,图像滤波单元102,还用于按照设定的滤波顺序,从至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域;周围侧依次包括:第一子区域与其他子区域的相接边界的左侧、上侧、右侧和下侧,第一子区域的权限等级与其他子区域的权限等级不同,目标待滤波区域为以下任一种:第一子区域内相较于相接边界的第一侧区域、第一子区域外相较于相接边界的第二侧区域、第一侧区域和第二侧区域;图像滤波单元102,还用于按照设定的滤波顺序,对目标待 滤波区域进行样本自适应补偿滤波。In some embodiments, the image filtering unit 102 is further used to determine the target area to be filtered from the surrounding side of the first sub-region of the at least two image sub-regions according to the set filtering order; the surrounding side includes: the left side, the upper side, the right side and the lower side of the boundary between the first sub-region and the other sub-regions, the authority level of the first sub-region is different from the authority level of the other sub-regions, and the target area to be filtered is any one of the following: the first side area in the first sub-region compared to the connected boundary, the second side area outside the first sub-region compared to the connected boundary, the first side area and the second side area; the image filtering unit 102 is further used to filter the target area to be filtered according to the set filtering order. The filter area performs sample adaptive compensation filtering.
在一些实施例中,图像滤波单元102,还用于按照设定的滤波顺序,从至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域;周围侧依次包括:第一子区域与其他子区域的相接边界的左侧、上侧、右侧和下侧,第一子区域的权限等级与其他子区域的权限等级不同,目标待滤波区域为以下任一种:第一子区域内相较于相接边界的第一侧区域、第一子区域外相较于相接边界的第二侧区域、第一侧区域和第二侧区域;图像滤波单元102,还用于按照设定的滤波顺序,对目标待滤波区域进行自适应环路滤波。In some embodiments, the image filtering unit 102 is also used to determine the target area to be filtered from the surrounding side of the first sub-region in at least two image sub-regions according to a set filtering order; the surrounding side includes, in sequence: the left side, top side, right side and bottom side of the boundary between the first sub-region and other sub-regions, the authority level of the first sub-region is different from the authority level of other sub-regions, and the target area to be filtered is any one of the following: the first side area in the first sub-region compared to the connected boundary, the second side area outside the first sub-region compared to the connected boundary, the first side area and the second side area; the image filtering unit 102 is also used to perform adaptive loop filtering on the target area to be filtered according to the set filtering order.
在一些实施例中,图像滤波单元102,还用于根据待处理图像的解码信息,判断是否需要对至少两个图像子区域中第一子区域进行基于神经网络的滤波处理;在第一子区域需要进行基于神经网络的滤波处理的情况下,将第一子区域的重建像素值和第一子区域的权限等级,输入神经网络中;获取输出的第一子区域的滤波重建像素。In some embodiments, the image filtering unit 102 is also used to determine whether it is necessary to perform neural network-based filtering processing on the first sub-region of at least two image sub-regions based on the decoded information of the image to be processed; when the first sub-region needs to perform neural network-based filtering processing, the reconstructed pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network; and the filtered reconstructed pixels of the first sub-region are obtained as output.
在一些实施例中,图像滤波单元102,还用于将与第一子区域的相邻的至少一个图像子区域的权限等级,输入神经网络中。In some embodiments, the image filtering unit 102 is further configured to input the permission level of at least one image sub-region adjacent to the first sub-region into the neural network.
在一些实施例中,图像滤波单元102,还用于对至少两个图像子区域之间的相接边界进行亮度通道分量的滤波处理;或者,对至少两个图像子区域之间的相接边界进行色度通道分量的滤波处理;或者,对至少两个图像子区域之间的相接边界进行亮度通道分量和色度通道分量的滤波处理。In some embodiments, the image filtering unit 102 is further used to filter the brightness channel component of the adjacent boundary between at least two image sub-regions; or, to filter the brightness channel component of the adjacent boundary between at least two image sub-regions; or, to filter the brightness channel component and the chroma channel component of the adjacent boundary between at least two image sub-regions.
图6为本申请实施例提供的一种图像处理方法的流程示意图。示例性的,本申请提供的图像处理方法,可以应用于图5所示的图像处理装置。如图6所示,本申请提供图像处理方法具体可以包括以下步骤:FIG6 is a flowchart of an image processing method provided in an embodiment of the present application. Exemplarily, the image processing method provided in the present application can be applied to the image processing device shown in FIG5. As shown in FIG6, the image processing method provided in the present application can specifically include the following steps:
S101、待处理图像划分为多个图像子区域,并获取每个图像子区域的权限等级。S101. Divide an image to be processed into a plurality of image sub-regions, and obtain the permission level of each image sub-region.
其中,权限等级分为至少两个等级不同的权限等级。The permission levels are divided into at least two different permission levels.
在一些实施例中,图像可以设置有权限区域和非权限区域(零权限等级区域)。非权限区域(零权限等级区域)的图像子区域为任意用户可以查看图像子区域。其中,权限区域可以包括多个高低等级不同的权限区域,例如,权限区域可以包括第一权限等级区域(高权限等级区域)、第二权限等级区域(中权限等级区域),第三权限等级区域(低权限等级区域),第一权限等级区域的权限等级高于第二权限等级区域的权限等级,第二权限等级区域的权限等级高于第三权限等级区域的权限等级。而每个权限等级也可以被划分为多个子权限等级,本实施例不作具体限制。In some embodiments, an image may be provided with a permission area and a non-permission area (zero permission level area). The image sub-area of the non-permission area (zero permission level area) is an image sub-area that any user can view. Among them, the permission area may include multiple permission areas of different high and low levels. For example, the permission area may include a first permission level area (high permission level area), a second permission level area (medium permission level area), and a third permission level area (low permission level area). The permission level of the first permission level area is higher than the permission level of the second permission level area, and the permission level of the second permission level area is higher than the permission level of the third permission level area. Each permission level may also be divided into multiple sub-permission levels, which is not specifically limited in this embodiment.
在一些实施例中,图像中的目标区域的权限等级,是根据目标区域的类别进行配置的。例如,图像中的人的脸部为高权限等级区域,上半身部分为低权限等级区域、下半身部分为零权限等级区域;车辆图像中的车牌部分为高权限等级区域、车窗部分为低权限等级区域、车身部分为零权限等级区域等。In some embodiments, the permission level of the target area in the image is configured according to the category of the target area. For example, the face of a person in the image is a high permission level area, the upper body is a low permission level area, and the lower body is a zero permission level area; the license plate part of the vehicle image is a high permission level area, the window part is a low permission level area, and the body part is a zero permission level area, etc.
在一些实施例中,待处理图像中的图像子区域的权限等级可以划分为高权限等级、低权限等级区域和零权限等级区域,示例性的,如图7所示,多个图像子区域可以包括低权限等级区域、高权限等级区域和零权限等级区域。In some embodiments, the permission levels of image sub-regions in the image to be processed can be divided into high permission level areas, low permission level areas and zero permission level areas. For example, as shown in Figure 7, multiple image sub-regions may include low permission level areas, high permission level areas and zero permission level areas.
可理解的是,不同用户对图像中不同区域的查看权限不同,高权限用户可以查看任意权限等级下(例如,高权限等级、低权限等级区域、零权限等级区域)的图像子区域,低权限用户可以查看低权限等级的图像子区域和零权限等级的图像子区域,而无权限的用户只可以查看零权限等级的图像子区域。It is understandable that different users have different viewing permissions for different areas in the image. High-authority users can view image sub-areas at any permission level (for example, high-authority level, low-authority level areas, and zero-authority level areas), low-authority users can view image sub-areas at low-authority levels and image sub-areas at zero-authority levels, and unauthorized users can only view image sub-areas at zero-authority levels.
在一些实施例中,在将待处理图像划分为多个图像子区域之前,利用图像解码单元103接收待处理图像的解码码流,基于解码码流进行解码,获取解码后的待处理图像。In some embodiments, before dividing the image to be processed into a plurality of image sub-regions, the image decoding unit 103 is used to receive a decoded code stream of the image to be processed, and decoding is performed based on the decoded code stream to obtain the decoded image to be processed.
在另一些实施例中,当待处理图像包括目标图像区域时,将目标图像区域作为滤波处理对象时,利用图像解码单元103接收待处理图像的解码码流,基于解码码流对目标图像区域进行解码。在目标图像区域完成解码后,不需要等待整个待处理图像完成解码,可以直接将该目标图像区域划分为多个图像子区域,获取每个图像子区域的权限等级。In other embodiments, when the image to be processed includes a target image region, when the target image region is used as a filtering processing object, the image decoding unit 103 receives a decoded code stream of the image to be processed, and decodes the target image region based on the decoded code stream. After the target image region is decoded, it is not necessary to wait for the entire image to be processed to be decoded, and the target image region can be directly divided into multiple image sub-regions to obtain the permission level of each image sub-region.
在另一些实施例中,当待处理图像包括目标图像区域时,将目标图像区域作为滤波处理对象时,可以将目标图像区域为中心,向进行周围侧(左侧、右侧、上侧或下侧)进行扩展,得到宽CW,高CH的检测区域,将上述检测区域进行划分,得到多个NxN(N优选为2或4或8)像素单位的图像子块区域,其中,每个图像子块区域内的权限等级相同。其中,检测区域在四个方向上的扩展像素单位可以不同,也可以完全相同。In other embodiments, when the image to be processed includes a target image area, when the target image area is used as a filtering processing object, the target image area can be taken as the center and expanded to the surrounding side (left side, right side, upper side or lower side) to obtain a detection area with a width of CW and a height of CH, and the above detection area is divided to obtain multiple NxN (N is preferably 2 or 4 or 8) pixel units of image sub-block areas, wherein the authority level in each image sub-block area is the same. Among them, the expansion pixel units of the detection area in the four directions can be different or completely the same.
示例性的,如图8中的(a)所示,检测区域可以是以目标图像区域为中心,向左和向上扩展T(T优选为4或8或16)个单位像素点。Exemplarily, as shown in (a) of FIG. 8 , the detection area may be centered on the target image area and extended to the left and upward by T (T is preferably 4, 8, or 16) unit pixels.
示例性的,如图8中的(b)所示,检测区域也可以在上述图8中的(a)的检测区域上再增加右上侧一块区域,作为整体检测区域。 Exemplarily, as shown in (b) of FIG8 , the detection area may also be increased by an upper right area on the detection area of (a) of FIG8 as the overall detection area.
S102、若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,对至少两个图像子区域之间的相接边界(待滤波边界)进行滤波处理。S102: If the authority levels of at least two adjacent image sub-regions among the plurality of image sub-regions are different, filtering is performed on a boundary (boundary to be filtered) between the at least two image sub-regions.
在一些实施例中,当待处理图像包括滤波处理对象目标图像区域时,在利用图像解码单元103对目标图像区域进行解码后,可以直接将该目标图像区域划分为多个图像子区域,若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,可以直接对该两个图像子区域之间的相接边界进行滤波处理,不用等待整个待处理图像完成解码之后再进行滤波处理。In some embodiments, when the image to be processed includes a target image area that is a filtering object, after the target image area is decoded using the image decoding unit 103, the target image area can be directly divided into multiple image sub-regions. If the authority levels of at least two adjacent image sub-regions among the multiple image sub-regions are different, the connecting boundary between the two image sub-regions can be directly filtered without waiting for the entire image to be processed to be decoded before filtering.
在一些实施例中,滤波处理包括:去块效应垂直滤波、去块效应水平滤波、样本自适应补偿滤波、自适应环路滤波和神经网络滤波中的至少一个。In some embodiments, the filtering process includes at least one of: deblocking effect vertical filtering, deblocking effect horizontal filtering, sample adaptive compensation filtering, adaptive loop filtering and neural network filtering.
在一些实施例中,相邻的至少两个图像子区域可以为相接的两个图像子区域,也可以为不相接但距离较近的两个图像子区域。In some embodiments, the at least two adjacent image sub-regions may be two adjacent image sub-regions, or may be two adjacent image sub-regions that are not adjacent but are relatively close to each other.
在一些实施例中,可以对至少两个图像子区域之间的相接边界进行亮度通道分量的滤波处理;或者,对至少两个图像子区域之间的相接边界进行色度通道分量的滤波处理;或者,对至少两个图像子区域之间的相接边界进行亮度通道分量和色度通道分量的滤波处理。In some embodiments, the boundary between at least two image sub-regions may be filtered for the luminance channel component; or, the boundary between at least two image sub-regions may be filtered for the chrominance channel component; or, the boundary between at least two image sub-regions may be filtered for both the luminance channel component and the chrominance channel component.
在一些实施例中,图像处理装置可以获取待处理图像中任一权限等级的图像区域信息,以及非权限区域的图像区域信息;或者,图像处理装置可以获取待处理图像中第二权限等级的图像区域信息,以及非权限的图像区域信息。In some embodiments, the image processing device can obtain image area information of any permission level in the image to be processed, as well as image area information of non-authorization areas; or, the image processing device can obtain image area information of the second permission level in the image to be processed, as well as image area information of non-authorization areas.
可理解的是,将待处理图像划分为多个图像子区域,并获取每个图像子区域的权限等级,从而对每个图像子区域的权限等级进行判断,若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,说明上述两个图像子区域在经过解码过程的滤波后,可能仍存在着未进行滤波处理的情况,待处理图像的质量不高。因此基于权限区域的划分等解码信息,对至少两个图像子区域之间的相接边界再次进行滤波处理,可以改善待处理图像中不同权限区域的图像质量。It is understandable that the image to be processed is divided into multiple image sub-regions, and the authority level of each image sub-region is obtained, so as to judge the authority level of each image sub-region. If the authority levels of at least two adjacent image sub-regions in the multiple image sub-regions are different, it means that the two image sub-regions may still not be filtered after filtering in the decoding process, and the quality of the image to be processed is not high. Therefore, based on the decoding information such as the division of the authority region, the boundary between at least two image sub-regions is filtered again, which can improve the image quality of different authority regions in the image to be processed.
在一些实施例中,若上述至少两个图像子区域间存在垂直方向的相接边界(即两个图像子区域的位置关系是水平相接的),滤波处理包括去块效应垂直滤波,且满足DBF滤波的条件的情况下,可以对至少两个图像子区域之间的相接边界进行去块效应垂直滤波,请参见图9,本实施例提供的解码方法包括以下步骤Sa1至Sa2。In some embodiments, if there is a vertically connected boundary between the at least two image sub-regions (i.e., the positional relationship between the two image sub-regions is horizontally connected), the filtering process includes deblocking effect vertical filtering, and if the DBF filtering conditions are met, the deblocking effect vertical filtering can be performed on the boundary between the at least two image sub-regions. Please refer to Figure 9. The decoding method provided in this embodiment includes the following steps Sa1 to Sa2.
Sa1、确定至少两个图像子区域中第一子区域的垂直侧的目标待滤波区域。Sa1. Determine a target area to be filtered on a vertical side of a first sub-region in at least two image sub-regions.
其中,垂直侧为第一子区域相接边界的左侧或右侧,目标待滤波区域为以下任一种:相接边界的右侧待滤波区域、相接边界的左侧待滤波区域、相接边界的右侧待滤波区域和左侧待滤波区域。Among them, the vertical side is the left or right side of the boundary of the first sub-region, and the target area to be filtered is any one of the following: the area to be filtered on the right side of the boundary, the area to be filtered on the left side of the boundary, the area to be filtered on the right side of the boundary and the area to be filtered on the left side.
Sa2、对目标待滤波区域进行去块效应垂直滤波。Sa2. Perform vertical filtering to remove the blocking effect on the target area to be filtered.
在一些实施例中,相邻的至少两个图像子区域还包括第二子区域,第二子区域与第一子区域水平相邻,这里的水平相邻是指第二子区域位于第一子区域水平方向的左侧或右侧。相邻的至少两个图像子区域的权限等级不同,包括以下任一情况:In some embodiments, the at least two adjacent image sub-regions further include a second sub-region, and the second sub-region is horizontally adjacent to the first sub-region, where horizontal adjacent means that the second sub-region is located on the left or right side of the first sub-region in the horizontal direction. The permission levels of the at least two adjacent image sub-regions are different, including any of the following situations:
1、第一子区域的权限等级低于第二子区域的权限等级。1. The authority level of the first sub-area is lower than the authority level of the second sub-area.
2、第一子区域的权限等级高于第二子区域的权限等级。2. The authority level of the first sub-area is higher than the authority level of the second sub-area.
3、第一子区域的权限等级不等于第二子区域的权限等级。3. The permission level of the first sub-area is not equal to the permission level of the second sub-area.
4、第一子区域的权限等级不等于第二子区域的权限等级,且相接边界的滤波强度(BS值)大于或者等于预设滤波强度。4. The authority level of the first sub-area is not equal to the authority level of the second sub-area, and the filtering strength (BS value) of the adjacent boundaries is greater than or equal to the preset filtering strength.
如图10中的(a)所示,在第二子区域位于第一子区域的左侧的情况下,针对上述相邻的至少两个图像子区域的权限等级的不同情况,对目标待滤波区域进行去块效应垂直滤波,进行详细描述。As shown in (a) of FIG. 10 , when the second sub-region is located on the left side of the first sub-region, a deblocking vertical filtering is performed on the target area to be filtered according to the different authority levels of the at least two adjacent image sub-regions, and a detailed description is given.
实施例一、在第一子区域的权限等级低于第二子区域的权限等级的情况下,目标待滤波区域为相接边界的右侧待滤波区域(第一子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,右侧待滤波区域为相接边界向右宽为n列的像素点区域n优选为1。Embodiment 1: When the authority level of the first sub-region is lower than the authority level of the second sub-region, the target area to be filtered is the area to be filtered on the right side of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect. The area to be filtered on the right side is a pixel point area with a width of n columns to the right of the adjacent boundary, and n is preferably 1.
实施例二、在第一子区域的权限等级高于第二子区域的权限等级的情况下,目标待滤波区域为相接边界的右侧待滤波区域(第一子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,右侧待滤波区域为相接边界向右宽为n列的像素点区域n优选为1。Embodiment 2: When the authority level of the first sub-region is higher than the authority level of the second sub-region, the target area to be filtered is the area to be filtered on the right side of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect. The area to be filtered on the right side is a pixel point area with a width of n columns to the right of the adjacent boundary, and n is preferably 1.
实施例三、在第一子区域的权限等级不低于第二子区域的权限等级的情况下,目标待滤波区域为相接边界的右侧待滤波区域(第一子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,右侧待滤波区域为相接边界向右宽为n列的像素点区域n优选为1。Embodiment 3: When the authority level of the first sub-region is not lower than the authority level of the second sub-region, the target area to be filtered is the right side area to be filtered (within the first sub-region) of the adjacent boundary, and the target area to be filtered is subjected to vertical filtering for deblocking effect. The right side area to be filtered is a pixel point area with a width of n columns to the right of the adjacent boundary, and n is preferably 1.
实施例四、在第一子区域的权限等级不等于第二子区域的权限等级,且相接边界的BS值大于或者等于1的情况下,目标待滤波区域为相接边界的右侧待滤波区域(第一子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,右侧待滤波区域为相接边界向右宽为n列的像素点区域n优选为1。Embodiment 4: When the authority level of the first sub-region is not equal to the authority level of the second sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the area to be filtered on the right side of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect. Among them, the area to be filtered on the right side is a pixel point area with a width of n columns to the right of the adjacent boundary, and n is preferably 1.
其中,如图10中的(b)所示,在实施例一至实施例四中,目标待滤波区域均为相接边界的右 侧待滤波区域(第一子区域内)。As shown in (b) of FIG10 , in the first to fourth embodiments, the target area to be filtered is the right side of the adjacent boundary. The side area to be filtered (within the first sub-area).
实施例五、在第一子区域的权限等级低于第二子区域的权限等级的情况下,目标待滤波区域为相接边界的左侧待滤波区域(第二子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,左侧待滤波区域为相接边界向左宽为n列的像素点区域n优选为1。Embodiment 5: When the authority level of the first sub-region is lower than the authority level of the second sub-region, the target area to be filtered is the area to be filtered on the left side of the adjacent boundary (within the second sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect. The area to be filtered on the left side is a pixel point area with a width of n columns to the left of the adjacent boundary, and n is preferably 1.
实施例六、在第一子区域的权限等级高于第二子区域的权限等级的情况下,目标待滤波区域为相接边界的左侧待滤波区域(第二子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,左侧待滤波区域为相接边界向左宽为n列的像素点区域n优选为1。Embodiment 6: When the authority level of the first sub-region is higher than the authority level of the second sub-region, the target area to be filtered is the area to be filtered on the left side of the adjacent boundary (within the second sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect. The area to be filtered on the left side is a pixel point area with a width of n columns to the left of the adjacent boundary, and n is preferably 1.
实施例七、在第一子区域的权限等级不等于第二子区域的权限等级的情况下,目标待滤波区域为相接边界的左侧待滤波区域(第二子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,左侧待滤波区域为相接边界向左宽为n列的像素点区域n优选为1。Embodiment 7: When the authority level of the first sub-region is not equal to the authority level of the second sub-region, the target area to be filtered is the area to be filtered on the left side of the adjacent boundary (within the second sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect. The area to be filtered on the left side is a pixel point area with a width of n columns to the left of the adjacent boundary, and n is preferably 1.
实施例八、在第一子区域的权限等级不等于第二子区域的权限等级,且相接边界的BS值大于或者等于1的情况下,目标待滤波区域为相接边界的左侧待滤波区域(第二子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,左侧待滤波区域为相接边界向左宽为n列的像素点区域n优选为1。Embodiment 8: When the authority level of the first sub-region is not equal to the authority level of the second sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the area to be filtered on the left side of the adjacent boundary (within the second sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect. Among them, the area to be filtered on the left side is a pixel point area with a width of n columns to the left of the adjacent boundary, and n is preferably 1.
其中,如图10中的(c)所示,在实施例五至实施例八中,目标待滤波区域均为相接边界的左侧待滤波区域(第二子区域内)。As shown in (c) of FIG. 10 , in the fifth to eighth embodiments, the target region to be filtered is the region to be filtered on the left side of the adjacent boundary (within the second sub-region).
实施例九、在第一子区域的权限等级低于第二子区域的权限等级的情况下,目标待滤波区域为相接边界的右侧待滤波区域和左侧待滤波区域(第一区域内和第二子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,目标待滤波区域为相接边界的向右n列和向左n侧,宽度为2n的像素点区域,n优选为1。Embodiment 9: When the authority level of the first sub-region is lower than the authority level of the second sub-region, the target area to be filtered is the right area to be filtered and the left area to be filtered (within the first region and the second sub-region) of the adjacent boundary, and the target area to be filtered is subjected to vertical filtering for deblocking effect. The target area to be filtered is a pixel point area with a width of 2n, which is n columns to the right and n sides to the left of the adjacent boundary, and n is preferably 1.
实施例十、在第一子区域的权限等级高于第二子区域的权限等级的情况下,目标待滤波区域为相接边界的右侧待滤波区域和左侧待滤波区域(第一区域内和第二子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,目标待滤波区域为相接边界的向右n列和向左n侧,宽度为2n的像素点区域,n优选为1。Embodiment 10: When the authority level of the first sub-region is higher than the authority level of the second sub-region, the target area to be filtered is the right area to be filtered and the left area to be filtered (within the first region and the second sub-region) of the adjacent boundary, and the target area to be filtered is subjected to vertical filtering for deblocking effect. The target area to be filtered is a pixel point area with a width of 2n, which is n columns to the right and n sides to the left of the adjacent boundary, and n is preferably 1.
实施例十一、在第一子区域的权限等级不等于第二子区域的权限等级的情况下,目标待滤波区域为相接边界的右侧待滤波区域和左侧待滤波区域(第一区域内和第二子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,目标待滤波区域为相接边界的向右n列和向左n侧,宽度为2n的像素点区域,n优选为1。Embodiment 11: When the authority level of the first sub-region is not equal to the authority level of the second sub-region, the target area to be filtered is the right area to be filtered and the left area to be filtered (within the first region and the second sub-region) of the adjacent boundary, and the target area to be filtered is subjected to vertical filtering for deblocking effect. The target area to be filtered is a pixel point area with a width of 2n, which is n columns to the right and n sides to the left of the adjacent boundary, and n is preferably 1.
实施例十二、在第一子区域的权限等级不等于第二子区域的权限等级,且相接边界的BS值大于或者等于1的情况下,目标待滤波区域为相接边界的右侧待滤波区域和左侧待滤波区域(第一区域内和第二子区域内),对目标待滤波区域进行去块效应垂直滤波。其中,目标待滤波区域为相接边界的向右n列和向左n侧,宽度为2n的像素点区域,n优选为1。Embodiment 12: When the authority level of the first sub-region is not equal to the authority level of the second sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the area to be filtered on the right side and the area to be filtered on the left side of the adjacent boundary (within the first region and the second sub-region), and the target area to be filtered is subjected to vertical filtering for deblocking effect. The target area to be filtered is a pixel area with a width of 2n, which is n columns to the right and n sides to the left of the adjacent boundary, and n is preferably 1.
其中,如图10中的(d)所示,在实施例九至实施例十二中,目标待滤波区域为相接边界的右侧待滤波区域和左侧待滤波区域(第一区域内和第二子区域内)。As shown in (d) of FIG. 10 , in Embodiments 9 to 12, the target region to be filtered is the right region to be filtered and the left region to be filtered (within the first region and the second sub-region) of the adjacent boundaries.
可理解的是,若上述至少两个图像子区域间存在垂直方向的相接边界,且滤波处理包括去块效应垂直滤波,可以确定至少两个图像子区域中第一子区域的垂直侧的目标待滤波区域,对目标待滤波区域进行去块效应垂直滤波。其中,基于两个图像子区域的权限等级的高低情况,可以选择相应的目标待滤波区域进行去块效应垂直滤波。在图像处理装置根据用户的权限等级获取相应图像区域的信息的情况下,该方法可以满足任意权限等级的用户,对解码后的图像再次进行去块效应垂直滤波的需求,改善待处理图像中不同权限区域的图像质量,从而提高各权限等级下的用户使用体验感。It is understandable that if there is a vertical boundary between the at least two image sub-regions, and the filtering process includes vertical filtering for deblocking effects, the target area to be filtered on the vertical side of the first sub-region in the at least two image sub-regions can be determined, and the target area to be filtered can be vertically filtered for deblocking effects. Among them, based on the authority levels of the two image sub-regions, the corresponding target area to be filtered can be selected for vertical filtering for deblocking effects. In the case where the image processing device obtains the information of the corresponding image area according to the authority level of the user, the method can meet the needs of users of any authority level to perform vertical filtering for deblocking effects on the decoded image again, improve the image quality of different authority areas in the image to be processed, and thus improve the user experience at each authority level.
在一些实施例中,若上述至少两个图像子区域间存在水平方向的相接边界(即两个图像子区域的位置关系是竖直相接的),滤波处理包括去块效应水平滤波,且满足DBF滤波的条件的情况下,对至少两个图像子区域之间的相接边界进行去块效应水平滤波,请参见图11,本实施例提供的解码方法包括以下步骤Sb1至Sb2。In some embodiments, if there is a horizontal boundary between the at least two image sub-regions (i.e., the positional relationship between the two image sub-regions is vertically connected), the filtering process includes deblocking effect horizontal filtering, and when the DBF filtering conditions are met, the deblocking effect horizontal filtering is performed on the boundary between the at least two image sub-regions. Please refer to Figure 11. The decoding method provided in this embodiment includes the following steps Sb1 to Sb2.
Sb1、确定至少两个图像子区域中第一子区域的水平侧的目标待滤波区域。Sb1. Determine a target area to be filtered on the horizontal side of a first sub-region in at least two image sub-regions.
其中,水平侧为第一子区域相接边界的上侧或下侧,目标待滤波区域为以下任一种:相接边界的上侧待滤波区域、相接边界的下侧待滤波区域、相接边界的上侧待滤波区域和下侧待滤波区域。Among them, the horizontal side is the upper side or lower side of the boundary of the first sub-region, and the target area to be filtered is any one of the following: the upper side area to be filtered of the connected boundary, the lower side area to be filtered of the connected boundary, the upper side area to be filtered of the connected boundary and the lower side area to be filtered.
Sb2、对目标待滤波区域进行去块效应水平滤波。Sb2. Perform deblocking horizontal filtering on the target area to be filtered.
在一些实施例中,相邻的至少两个图像子区域还包括第三子区域,第三子区域与第一子区域垂直相邻,这里的垂直相邻是指第三子区域位于第一子区域水平方向的上侧或下侧。相邻的至少两个图像子区域的权限等级不同,包括以下任一情况:In some embodiments, the at least two adjacent image sub-regions further include a third sub-region, and the third sub-region is vertically adjacent to the first sub-region, where vertically adjacent means that the third sub-region is located above or below the first sub-region in the horizontal direction. The permission levels of the at least two adjacent image sub-regions are different, including any of the following situations:
1、第一子区域的权限等级低于第三子区域的权限等级。1. The authority level of the first sub-area is lower than the authority level of the third sub-area.
2、第一子区域的权限等级高于第三子区域的权限等级。 2. The authority level of the first sub-area is higher than the authority level of the third sub-area.
3、第一子区域的权限等级不等于第三子区域的权限等级。3. The permission level of the first sub-area is not equal to the permission level of the third sub-area.
4、第一子区域的权限等级不等于第三子区域的权限等级,且相接边界的滤波强度(BS值)大于或者等于预设滤波强度。4. The authority level of the first sub-area is not equal to the authority level of the third sub-area, and the filtering strength (BS value) of the adjacent boundaries is greater than or equal to the preset filtering strength.
如图12中的(a)所示,第三子区域位于第一子区域的上侧,下面针对上述相邻的至少两个图像子区域的权限等级的不同情况,对目标待滤波区域进行去块效应水平滤波,进行详细描述。As shown in (a) of FIG. 12 , the third sub-region is located on the upper side of the first sub-region. The following describes in detail the deblocking horizontal filtering of the target area to be filtered according to the different authority levels of the at least two adjacent image sub-regions.
实施例十三、在第一子区域的权限等级低于第三子区域的权限等级的情况下,目标待滤波区域为相接边界的下侧待滤波区域(第一子区域内),对目标待滤波区域进行去块效应水平滤波。其中,下侧待滤波区域为相接边界向上宽为n行的像素点区域,n优选为1。Embodiment 13: When the authority level of the first sub-region is lower than the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The lower area to be filtered is a pixel point area with a width of n rows upward from the adjacent boundary, and n is preferably 1.
实施例十四、在第一子区域的权限等级高于第三子区域的权限等级的情况下,目标待滤波区域为相接边界的下侧待滤波区域(第一子区域内),对目标待滤波区域进行去块效应水平滤波。其中,下侧待滤波区域为相接边界向上宽为n行的像素点区域,n优选为1。Embodiment 14: When the authority level of the first sub-region is higher than the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The lower area to be filtered is a pixel point area with a width of n rows upward from the adjacent boundary, and n is preferably 1.
实施例十五、在第一子区域的权限等级不低于第三子区域的权限等级的情况下,目标待滤波区域为相接边界的下侧待滤波区域(第一子区域内),对目标待滤波区域进行去块效应水平滤波。其中,下侧待滤波区域为相接边界向上宽为n行的像素点区域,n优选为1。Embodiment 15: When the authority level of the first sub-region is not lower than the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The lower area to be filtered is a pixel point area with a width of n rows upward from the adjacent boundary, and n is preferably 1.
实施例十六、在第一子区域的权限等级不等于第三子区域的权限等级,且相接边界的BS值大于或者等于1的情况下,目标待滤波区域为相接边界的下侧待滤波区域(第一子区域内),对目标待滤波区域进行去块效应水平滤波。其中,下侧待滤波区域为相接边界向上宽为n行的像素点区域,n优选为1。Embodiment 16: When the authority level of the first sub-region is not equal to the authority level of the third sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the lower area to be filtered of the adjacent boundary (within the first sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The lower area to be filtered is a pixel point area with a width of n rows upward from the adjacent boundary, and n is preferably 1.
其中,如图12中的(b)所示,在实施例十三至实施例十六中,目标待滤波区域均为相接边界的下侧待滤波区域(第一子区域内)。As shown in (b) of FIG. 12 , in Embodiment 13 to Embodiment 16 , the target region to be filtered is the region to be filtered at the lower side of the adjacent boundary (within the first sub-region).
实施例十七、在第一子区域的权限等级低于第三子区域的权限等级的情况下,目标待滤波区域为相接边界的上侧待滤波区域(第三子区域内),对目标待滤波区域进行去块效应水平滤波。其中,上侧待滤波区域为相接边界向下宽为n行的像素点区域,n优选为1。Embodiment 17: When the authority level of the first sub-region is lower than the authority level of the third sub-region, the target area to be filtered is the upper area to be filtered of the adjacent boundary (within the third sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The upper area to be filtered is a pixel point area with a width of n rows below the adjacent boundary, and n is preferably 1.
实施例十八、在第一子区域的权限等级高于第三子区域的权限等级的情况下,目标待滤波区域为相接边界的上侧待滤波区域(第三子区域内),对目标待滤波区域进行去块效应水平滤波。其中,上侧待滤波区域为相接边界向下宽为n行的像素点区域,n优选为1。Embodiment 18: When the authority level of the first sub-region is higher than the authority level of the third sub-region, the target area to be filtered is the upper area to be filtered of the adjacent boundary (within the third sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The upper area to be filtered is a pixel point area with a width of n rows below the adjacent boundary, and n is preferably 1.
实施例十九、在第一子区域的权限等级不等于第三子区域的权限等级的情况下,目标待滤波区域为相接边界的上侧待滤波区域(第三子区域内),对目标待滤波区域进行去块效应水平滤波。其中,上侧待滤波区域为相接边界向下宽为n行的像素点区域,n优选为1。Embodiment 19: When the authority level of the first sub-region is not equal to the authority level of the third sub-region, the target area to be filtered is the upper area to be filtered of the adjacent boundary (within the third sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The upper area to be filtered is a pixel point area with a width of n rows below the adjacent boundary, and n is preferably 1.
实施例二十、在第一子区域的权限等级不等于第三子区域的权限等级,且相接边界的BS值大于或者等于1的情况下,目标待滤波区域为相接边界的上侧待滤波区域(第三子区域内),对目标待滤波区域进行去块效应水平滤波。其中,上侧待滤波区域为相接边界向下宽为n行的像素点区域,n优选为1。Embodiment 20: When the authority level of the first sub-region is not equal to the authority level of the third sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the upper area to be filtered of the adjacent boundary (within the third sub-region), and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The upper area to be filtered is a pixel point area with a width of n rows below the adjacent boundary, and n is preferably 1.
其中,如图12中的(c)所示,在实施例十七至实施例二十中,目标待滤波区域均为相接边界的上侧待滤波区域(第三子区域内)。As shown in (c) of FIG. 12 , in Embodiments 17 to 20, the target region to be filtered is the region to be filtered on the upper side of the adjacent boundary (within the third sub-region).
实施例二十一、在第一子区域的权限等级低于第三子区域的权限等级的情况下,目标待滤波区域为相接边界的下侧待滤波区域和上侧待滤波区域(第一区域内和第三子区域内),对目标待滤波区域进行去块效应水平滤波。其中,目标待滤波区域为相接边界的向上n行和向下n侧,宽度为2n的像素点区域,n优选为1。Embodiment 21: When the authority level of the first sub-region is lower than the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered and the upper area to be filtered (in the first region and the third sub-region) of the adjacent boundary, and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The target area to be filtered is the pixel point area with a width of 2n, which is n rows upward and n sides downward of the adjacent boundary, and n is preferably 1.
实施例二十二、在第一子区域的权限等级高于第三子区域的权限等级的情况下,目标待滤波区域为相接边界的下侧待滤波区域和上侧待滤波区域(第一区域内和第三子区域内),对目标待滤波区域进行去块效应水平滤波。其中,目标待滤波区域为相接边界的向上n行和向下n侧,宽度为2n的像素点区域,n优选为1。Embodiment 22: When the authority level of the first sub-region is higher than the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered and the upper area to be filtered (in the first region and the third sub-region) of the adjacent boundary, and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The target area to be filtered is the pixel point area with a width of 2n, which is n rows upward and n sides downward of the adjacent boundary, and n is preferably 1.
实施例二十三、在第一子区域的权限等级不等于第三子区域的权限等级的情况下,目标待滤波区域为相接边界的下侧待滤波区域和上侧待滤波区域(第一区域内和第三子区域内),对目标待滤波区域进行去块效应水平滤波。其中,目标待滤波区域为相接边界的向上n行和向下n侧,宽度为2n的像素点区域,n优选为1。Embodiment 23: When the authority level of the first sub-region is not equal to the authority level of the third sub-region, the target area to be filtered is the lower area to be filtered and the upper area to be filtered (in the first region and the third sub-region) of the adjacent boundary, and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The target area to be filtered is the pixel point area with a width of 2n, which is n rows upward and n sides downward of the adjacent boundary, and n is preferably 1.
实施例二十四、在第一子区域的权限等级不等于第三子区域的权限等级,且相接边界的BS值大于或者等于1的情况下,目标待滤波区域为相接边界的下侧待滤波区域和上侧待滤波区域(第一区域内和第三子区域内),对目标待滤波区域进行去块效应水平滤波。其中,目标待滤波区域为相接边界的向上n行和向下n侧,宽度为2n的像素点区域,n优选为1。Embodiment 24: When the authority level of the first sub-region is not equal to the authority level of the third sub-region, and the BS value of the adjacent boundary is greater than or equal to 1, the target area to be filtered is the lower area to be filtered and the upper area to be filtered (in the first region and the third sub-region) of the adjacent boundary, and the target area to be filtered is subjected to horizontal filtering for deblocking effect. The target area to be filtered is the pixel point area with a width of 2n, which is n rows upward and n sides downward of the adjacent boundary, and n is preferably 1.
其中,如图12中的(d)所示,在实施例二十一至实施例二十四中,目标待滤波区域为相接边界的上侧待滤波区域和下侧待滤波区域(第一区域内和第三子区域内)。 Among them, as shown in (d) of Figure 12, in Examples 21 to 24, the target area to be filtered is the upper area to be filtered and the lower area to be filtered of the adjacent boundaries (inside the first area and in the third sub-area).
可理解的是,若上述至少两个图像子区域间存在水平方向的相接边界,且滤波处理包括去块效应水平滤波,可以确定至少两个图像子区域中第一子区域的水平侧的目标待滤波区域,对目标待滤波区域进行去块效应水平滤波。其中,基于两个图像子区域的权限等级的高低情况,可以选择相应的目标待滤波区域进行去块效应水平滤波。在图像处理装置根据用户的权限等级获取相应图像区域的信息的情况下,该方法可以满足任意权限等级的用户,对解码后的图像再次进行去块效应水平滤波的需求,改善待处理图像中不同权限区域的图像质量,从而提高各权限等级下的用户使用体验感。It is understandable that if there is a horizontal boundary between the at least two image sub-regions mentioned above, and the filtering process includes horizontal filtering for deblocking effects, the target area to be filtered on the horizontal side of the first sub-region in the at least two image sub-regions can be determined, and the target area to be filtered can be subjected to horizontal filtering for deblocking effects. Among them, based on the authority levels of the two image sub-regions, the corresponding target area to be filtered can be selected for horizontal filtering for deblocking effects. In the case where the image processing device obtains the information of the corresponding image area according to the authority level of the user, the method can meet the needs of users of any authority level to perform horizontal filtering for deblocking effects on the decoded image again, improve the image quality of different authority areas in the image to be processed, and thus improve the user experience at each authority level.
在一些实施例中,滤波处理包括样本自适应补偿滤波,若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,对至少两个图像子区域之间的相接边界进行样本自适应补偿滤波,请参见图13,本实施例提供的解码方法包括以下步骤Sc1至Sc2。In some embodiments, the filtering process includes sample adaptive compensation filtering. If the authority levels of at least two adjacent image sub-regions among multiple image sub-regions are different, sample adaptive compensation filtering is performed on the adjacent boundary between the at least two image sub-regions. Please refer to Figure 13. The decoding method provided in this embodiment includes the following steps Sc1 to Sc2.
Sc1、按照设定的滤波顺序,从至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域。Sc1. According to a set filtering order, determine a target area to be filtered from the surrounding side of a first sub-area in at least two image sub-areas.
其中,周围侧依次包括:第一子区域与其他子区域的相接边界的左侧、上侧、右侧和下侧,在第一子区域的权限等级与其他子区域的权限等级不同的情况下,目标待滤波区域为以下任一种:第一子区域内相较于相接边界的第一侧区域、第一子区域外相较于相接边界的第二侧区域、第一侧区域和第二侧区域。Among them, the surrounding side includes, in sequence: the left side, top side, right side and bottom side of the border between the first sub-region and other sub-regions. When the authority level of the first sub-region is different from the authority level of other sub-regions, the target area to be filtered is any one of the following: the first side area within the first sub-region compared to the border, the second side area outside the first sub-region compared to the border, the first side area and the second side area.
在一些实施例中,可以按照设定的滤波顺序,依次判断第一子区域周围侧的其他子区域的权限等级,在第一子区域周围侧的其他子区域的权限等级与所述第一子区域的权限等级不同的情况下,确定目标待滤波区域。目标待滤波区域可以包括以下两种情况:In some embodiments, the permission levels of other sub-regions around the first sub-region may be determined in sequence according to the set filtering order, and when the permission levels of other sub-regions around the first sub-region are different from the permission level of the first sub-region, the target area to be filtered is determined. The target area to be filtered may include the following two situations:
情况一、若与第一子区域的权限等级不同的其他子区域位于第一子区域的垂直侧时,第一侧区域为相接边界向第一子区域方向的宽度为n列像素区域;第二侧区域为相接边界向其他子区域方向的宽度为n列像素区域。Case 1: If other sub-regions with different authority levels from the first sub-region are located on the vertical side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n columns of pixels from the adjacent boundary toward the other sub-regions.
情况二、若与第一子区域的权限等级不同的其他子区域位于第一子区域的水平侧时,第一侧区域为相接边界向第一子区域方向的宽度为n列像素区域;第二侧区域为相接边界向其他子区域方向的宽度为n行像素区域。Case 2: If other sub-regions with different authority levels from the first sub-region are located on the horizontal side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n rows of pixels from the adjacent boundary toward the other sub-regions.
上述两种情况可以同时存在。The above two situations can exist at the same time.
示例性的,如图14所示,第一子区域周围存在着左侧的相邻子区域A、左上侧的相邻子区域B、上侧的相邻子区域C、右上侧的相邻子区域D。按照从右到左再从上到下的滤波顺序,依次判断第一子区域周围侧的其他子区域的权限等级,在相邻子区域A和相邻子区域C的权限等级与第一子区域的权限等级不同,在相邻子区域B和相邻子区域D的权限等级与第一子区域的权限等级相同的情况下,确定目标待滤波区域为与相邻子区域A的相接边界向左方向的宽度为1的列像素区域和向右方向的宽度为1的列像素区域,以及与相邻子区域C的相接边界向上方向的宽度为1的行像素区域和向下方向的宽度为1的行像素区域,即图14所示的阴影部分的区域。Exemplarily, as shown in FIG14 , the first sub-region is surrounded by an adjacent sub-region A on the left, an adjacent sub-region B on the upper left, an adjacent sub-region C on the upper side, and an adjacent sub-region D on the upper right. According to the filtering order from right to left and then from top to bottom, the authority levels of other sub-regions around the first sub-region are judged in turn. When the authority levels of the adjacent sub-regions A and C are different from the authority level of the first sub-region, and when the authority levels of the adjacent sub-regions B and D are the same as the authority level of the first sub-region, the target area to be filtered is determined to be a column pixel area with a width of 1 in the left direction and a column pixel area with a width of 1 in the right direction of the border connecting with the adjacent sub-region A, and a row pixel area with a width of 1 in the upward direction and a row pixel area with a width of 1 in the downward direction of the border connecting with the adjacent sub-region C, that is, the area of the shaded part shown in FIG14 .
在另一些实施例中,在第一子区域周围侧的其他子区域的权限等级高于所述第一子区域的权限等级的情况下,确定目标待滤波区域。目标待滤波区域可以包括以下两种情况:In some other embodiments, when the authority level of other sub-regions around the first sub-region is higher than the authority level of the first sub-region, the target area to be filtered is determined. The target area to be filtered may include the following two situations:
情况一、若高于第一子区域的权限等级的其他子区域位于第一子区域的垂直侧时,第一侧区域为相接边界向第一子区域方向的宽度为n列像素区域;第二侧区域为相接边界向其他子区域方向的宽度为n列像素区域。Case 1: If other sub-regions with higher authority levels than the first sub-region are located on the vertical side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n columns of pixels from the adjacent boundary toward the other sub-regions.
情况二、若高于第一子区域的权限等级的其他子区域位于第一子区域的水平侧时,第一侧区域为相接边界向第一子区域方向的宽度为n列像素区域;第二侧区域为相接边界向其他子区域方向的宽度为n行像素区域。Case 2: If other sub-regions with higher authority levels than the first sub-region are located on the horizontal side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n rows of pixels from the adjacent boundary toward the other sub-regions.
上述两种情况可以同时存在。The above two situations can exist at the same time.
Sc2、按照设定的滤波顺序,对目标待滤波区域进行样本自适应补偿滤波。Sc2. Perform sample adaptive compensation filtering on the target area to be filtered according to the set filtering order.
在一些实施例中,如上述图14所示,按照从右到左再从上到下的滤波顺序,对目标待滤波区域,即图14中的阴影部分的区域进行样本自适应补偿滤波。In some embodiments, as shown in FIG. 14 above, sample adaptive compensation filtering is performed on the target area to be filtered, that is, the shaded area in FIG. 14 , in a filtering order from right to left and then from top to bottom.
在一些实施例中,第一子区域周围侧的未进行滤波处理的相邻子区域,保持原有的像素值。例如,上述图14所示,第一子区域与相邻子区域B的相接边界,第一子区域与相邻子区域D的相接边界的像素值保持不变。In some embodiments, the adjacent sub-regions around the first sub-region that have not been filtered retain their original pixel values. For example, as shown in FIG. 14 , the pixel values of the borders between the first sub-region and the adjacent sub-region B and the borders between the first sub-region and the adjacent sub-region D remain unchanged.
可理解的是,若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,可以按照设定的滤波顺序,从至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域,并且按照设定的滤波顺序,对目标待滤波区域进行样本自适应补偿滤波。其中,基于第一子区域周围侧的相邻子区域的权限等级的高低情况,可以选择相应的目标待滤波区域进行样本自适应补偿滤波。在图像处理装置根据用户的权限等级获取相应图像区域的信息的情况下,该方法可以满足任意权限等级的用户,对解码后的图像再次进行样本自适应补偿滤波的需求,改善待处理图像中不同权限区域的图像质量,从而提高各权限等级下的用户使用体验感。 It is understandable that if the authority levels of at least two adjacent image sub-regions in a plurality of image sub-regions are different, the target area to be filtered can be determined from the surrounding side of the first sub-region of the at least two image sub-regions according to the set filtering order, and the target area to be filtered can be subjected to sample adaptive compensation filtering according to the set filtering order. Among them, based on the authority level of the adjacent sub-regions on the surrounding side of the first sub-region, the corresponding target area to be filtered can be selected for sample adaptive compensation filtering. In the case where the image processing device obtains the information of the corresponding image area according to the authority level of the user, the method can meet the needs of users of any authority level to perform sample adaptive compensation filtering on the decoded image again, improve the image quality of different authority areas in the image to be processed, and thus improve the user experience at each authority level.
在一些实施例中,滤波处理包括自适应环路滤波,若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,对至少两个图像子区域之间的相接边界进行自适应环路滤波,请参见图15,本实施例提供的解码方法包括以下步骤Sd1至Sd2。In some embodiments, the filtering process includes adaptive loop filtering. If the authority levels of at least two adjacent image sub-regions among multiple image sub-regions are different, adaptive loop filtering is performed on the adjacent boundary between the at least two image sub-regions. Please refer to Figure 15. The decoding method provided in this embodiment includes the following steps Sd1 to Sd2.
Sd1、按照设定的滤波顺序,从至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域。Sd1. Determine a target area to be filtered from the surrounding side of a first sub-area in at least two image sub-areas according to a set filtering order.
其中,周围侧依次包括:第一子区域与其他子区域的相接边界的左侧、上侧、右侧和下侧,在第一子区域的权限等级与其他子区域的权限等级不同的情况下,目标待滤波区域为以下任一种:第一子区域内相较于相接边界的第一侧区域、第一子区域外相较于相接边界的第二侧区域、第一侧区域和第二侧区域。Among them, the surrounding side includes, in sequence: the left side, top side, right side and bottom side of the border between the first sub-region and other sub-regions. When the authority level of the first sub-region is different from the authority level of other sub-regions, the target area to be filtered is any one of the following: the first side area within the first sub-region compared to the border, the second side area outside the first sub-region compared to the border, the first side area and the second side area.
在一些实施例中,可以按照设定的滤波顺序,依次判断第一子区域周围侧的其他子区域的权限等级,在第一子区域周围侧的其他子区域的权限等级与所述第一子区域的权限等级不同的情况下,确定目标待滤波区域。目标待滤波区域可以包括以下两种情况:In some embodiments, the permission levels of other sub-regions around the first sub-region may be determined in sequence according to the set filtering order, and when the permission levels of other sub-regions around the first sub-region are different from the permission level of the first sub-region, the target area to be filtered is determined. The target area to be filtered may include the following two situations:
情况一、若与第一子区域的权限等级不同的其他子区域位于第一子区域的垂直侧时,第一侧区域为相接边界向第一子区域方向的宽度为n列像素区域;第二侧区域为相接边界向其他子区域方向的宽度为n列像素区域。Case 1: If other sub-regions with different authority levels from the first sub-region are located on the vertical side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n columns of pixels from the adjacent boundary toward the other sub-regions.
情况二、若与第一子区域的权限等级不同的其他子区域位于第一子区域的水平侧时,第一侧区域为相接边界向第一子区域方向的宽度为n列像素区域;第二侧区域为相接边界向其他子区域方向的宽度为n行像素区域。Case 2: If other sub-regions with different authority levels from the first sub-region are located on the horizontal side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n rows of pixels from the adjacent boundary toward the other sub-regions.
上述两种情况可以同时存在。The above two situations can exist at the same time.
示例性的,如图16所示,第一子区域周围存在着左侧的相邻子区域A、左上侧的相邻子区域B、上侧的相邻子区域C、右上侧的相邻子区域D。按照从右到左再从上到下的滤波顺序,依次判断第一子区域周围侧的其他子区域的权限等级,在相邻子区域B、相邻子区域C和相邻子区域D的权限等级与第一子区域的权限等级不同,在相邻子区域A的权限等级与第一子区域的权限等级相同的情况下,确定目标待滤波区域为与相邻子区域B、相邻子区域C和相邻子区域D的相接边界向下方向的宽度为1的行像素区域和向上方向的宽度为1的行像素区域,即图16所示的阴影部分的区域。Exemplarily, as shown in FIG16 , the first sub-region is surrounded by an adjacent sub-region A on the left, an adjacent sub-region B on the upper left, an adjacent sub-region C on the upper side, and an adjacent sub-region D on the upper right. According to the filtering order from right to left and then from top to bottom, the authority levels of other sub-regions around the first sub-region are judged in turn. When the authority levels of the adjacent sub-regions B, C, and D are different from the authority level of the first sub-region, and when the authority level of the adjacent sub-region A is the same as the authority level of the first sub-region, the target area to be filtered is determined to be a row pixel area with a width of 1 in the downward direction and a row pixel area with a width of 1 in the upward direction of the boundary connecting the adjacent sub-regions B, C, and D, that is, the area of the shaded part shown in FIG16 .
在另一些实施例中,在第一子区域周围侧的其他子区域的权限等级高于所述第一子区域的权限等级的情况下,确定目标待滤波区域。目标待滤波区域可以包括以下两种情况:In some other embodiments, when the authority level of other sub-regions around the first sub-region is higher than the authority level of the first sub-region, the target area to be filtered is determined. The target area to be filtered may include the following two situations:
情况一、若高于第一子区域的权限等级的其他子区域位于第一子区域的垂直侧时,第一侧区域为相接边界向第一子区域方向的宽度为n列像素区域;第二侧区域为相接边界向其他子区域方向的宽度为n列像素区域。Case 1: If other sub-regions with higher authority levels than the first sub-region are located on the vertical side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n columns of pixels from the adjacent boundary toward the other sub-regions.
情况二、若高于第一子区域的权限等级的其他子区域位于第一子区域的水平侧时,第一侧区域为相接边界向第一子区域方向的宽度为n列像素区域;第二侧区域为相接边界向其他子区域方向的宽度为n行像素区域。Case 2: If other sub-regions with higher authority levels than the first sub-region are located on the horizontal side of the first sub-region, the first side region is a region with a width of n columns of pixels from the adjacent boundary toward the first sub-region; the second side region is a region with a width of n rows of pixels from the adjacent boundary toward the other sub-regions.
上述两种情况可以同时存在。The above two situations can exist at the same time.
Sd2、按照设定的滤波顺序,对目标待滤波区域进行自适应环路滤波。Sd2: According to the set filtering order, adaptive loop filtering is performed on the target area to be filtered.
在一些实施例中,如上述图16所示,按照从右到左再从上到下的滤波顺序,对目标待滤波区域,即图16中的阴影部分的区域进行自适应环路滤波。In some embodiments, as shown in FIG. 16 above, adaptive loop filtering is performed on the target area to be filtered, that is, the shaded area in FIG. 16 , in a filtering order from right to left and then from top to bottom.
在一些实施例中,第一子区域周围侧的未进行滤波处理的相邻子区域,保持原有的像素值。例如,上述图16所示,第一子区域与相邻子区域A的相接边界的像素值保持不变。In some embodiments, the adjacent sub-regions around the first sub-region that have not been filtered retain their original pixel values. For example, as shown in FIG16 , the pixel values at the border between the first sub-region and the adjacent sub-region A remain unchanged.
可理解的是,若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,可以按照设定的滤波顺序,从至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域,并且按照设定的滤波顺序,对目标待滤波区域进行样本自适应补偿滤波。其中,基于第一子区域周围侧的相邻子区域的权限等级的高低情况,可以选择相应的目标待滤波区域进行自适应环路滤波。在图像处理装置根据用户的权限等级获取相应图像区域的信息的情况下,该方法可以满足任意权限等级的用户,对解码后的图像再次进行自适应环路滤波的需求,改善待处理图像中不同权限区域的图像质量,从而提高各权限等级下的用户使用体验感。It is understandable that if the authority levels of at least two adjacent image sub-regions in a plurality of image sub-regions are different, the target area to be filtered can be determined from the surrounding side of the first sub-region of the at least two image sub-regions according to the set filtering order, and the target area to be filtered can be subjected to sample adaptive compensation filtering according to the set filtering order. Among them, based on the authority level of the adjacent sub-regions on the surrounding side of the first sub-region, the corresponding target area to be filtered can be selected for adaptive loop filtering. In the case where the image processing device obtains the information of the corresponding image area according to the authority level of the user, the method can meet the needs of users of any authority level to perform adaptive loop filtering on the decoded image again, improve the image quality of different authority areas in the image to be processed, and thus improve the user experience at each authority level.
在一些实施例中,滤波处理包括基于神经网络的滤波处理,若多个图像子区域中相邻的至少两个图像子区域的权限等级不同,可以对至少两个图像子区域之间的相接边界进行基于神经网络的滤波处理,请参见图17,本实施例提供的解码方法包括以下步骤Se1至Se2。In some embodiments, the filtering process includes filtering process based on a neural network. If the authority levels of at least two adjacent image sub-regions among multiple image sub-regions are different, the connecting boundary between the at least two image sub-regions can be filtered based on a neural network. Please refer to Figure 17. The decoding method provided in this embodiment includes the following steps Se1 to Se2.
Se1、在第一子区域需要进行基于神经网络的滤波处理的情况下,将第一子区域的像素值和第一子区域的权限等级,输入神经网络中。Se1. When the first sub-region needs to be subjected to filtering processing based on a neural network, the pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network.
在一些实施例中,第一子区域的的像素值可以是重建像素值,重建像素值为第一子区域在经过解码滤波处理后的像素值,可以是在解码之后,经过其他滤波处理(例如去块效应垂直滤波)后的 像素值,本实施例不作具体限制。In some embodiments, the pixel value of the first sub-region may be a reconstructed pixel value, and the reconstructed pixel value may be the pixel value of the first sub-region after decoding and filtering, and may be the pixel value after decoding and other filtering (such as deblocking vertical filtering). The pixel value is not specifically limited in this embodiment.
在一些实施例中,在第一子区域需要进行基于神经网络的滤波处理的情况下,将第一子区域的重建像素值和第一子区域的权限等级,以及其他的解码信息输入神经网络中。其中,其他解码信息包括上述提到的边界滤波强度Bs值、编码单元变换块的量化系数等。本实施例不作具体限制。In some embodiments, when the first sub-region needs to be filtered based on a neural network, the reconstructed pixel value of the first sub-region and the authority level of the first sub-region, as well as other decoded information, are input into the neural network. The other decoded information includes the above-mentioned boundary filter strength Bs value, the quantization coefficient of the coding unit transform block, etc. This embodiment is not specifically limited.
在一些实施例中,神经网络可以是卷积神经网络(CNN),也可以是其他的神经网络。本实施例不作具体限制。In some embodiments, the neural network may be a convolutional neural network (CNN) or other neural networks, which are not specifically limited in this embodiment.
在一些实施例中,步骤Se1可以包括步骤Se12。In some embodiments, step Se1 may include step Se12.
Se12、将与第一子区域的相邻的至少一个图像子区域的权限等级,输入神经网络中。Se12. Input the authority level of at least one image sub-region adjacent to the first sub-region into the neural network.
示例性的,将上述图16中的第一子区域周围的相邻子区域A的权限等级、相邻子区域B的权限等级、相邻子区域C的权限等级、相邻子区域D的权限等级,均输入神经网络中。Exemplarily, the permission level of the adjacent sub-region A, the permission level of the adjacent sub-region B, the permission level of the adjacent sub-region C, and the permission level of the adjacent sub-region D around the first sub-region in FIG. 16 are all input into the neural network.
Se2、获取输出的第一子区域的滤波像素。Se2. Obtain the filtered pixels of the first sub-region of the output.
如图18所示,将第一子区域的重建像素值、第一子区域的权限等级,与第一子区域相邻的至少一个图像子区域的权限等级、以及其他的解码信息输入神经网络,获取输出的第一子区域的滤波重建像素。As shown in FIG18 , the reconstructed pixel value of the first sub-region, the authority level of the first sub-region, the authority level of at least one image sub-region adjacent to the first sub-region, and other decoding information are input into the neural network to obtain the output filtered reconstructed pixel of the first sub-region.
可理解的是,基于图像子区域的权限等级的高低情况,可以选择相应的目标待滤波区域进行基于神经网络的滤波处理。在图像处理装置根据用户的权限等级获取相应图像区域的信息的情况下,该方法可以满足任意权限等级的用户,对解码后的图像再次进行基于神经网络的滤波处理的需求,改善待处理图像中不同权限区域的图像质量,从而提高各权限等级下的用户使用体验感。It is understandable that, based on the level of authority of the image sub-region, the corresponding target area to be filtered can be selected for filtering based on the neural network. In the case where the image processing device obtains the information of the corresponding image area according to the user's authority level, this method can meet the needs of users of any authority level to perform filtering based on the neural network on the decoded image again, improve the image quality of different authority areas in the image to be processed, and thus improve the user experience at each authority level.
在一些实施例中,可以按照执行Sa1至Sa2,Sb1至Sb2,Sc1至Sc2,Sd1至Sd2的过程依次进行,即Sa1至Sa2的输出是Sb1至Sb2的输入,Sb1至Sb2的输出是Sc1至Sc2的输入,Sc1至Sc2的输出是Sd1至Sd2的输入。In some embodiments, the process of executing Sa1 to Sa2, Sb1 to Sb2, Sc1 to Sc2, and Sd1 to Sd2 can be performed in sequence, that is, the output of Sa1 to Sa2 is the input of Sb1 to Sb2, the output of Sb1 to Sb2 is the input of Sc1 to Sc2, and the output of Sc1 to Sc2 is the input of Sd1 to Sd2.
在另一些实施例中,可以按照执行Sa1至Sa2,Sb1至Sb2,Sc1至Sc2,Sd1至Sd2,Se1至Se2的过程依次进行,即Sa1至Sa2的输出是Sb1至Sb2的输入,Sb1至Sb2的输出是Sc1至Sc2的输入,Sc1至Sc2的输出是Sd1至Sd2的输入,Sd1至Sd2的输出是Se1至Se2的输入。In other embodiments, the process of executing Sa1 to Sa2, Sb1 to Sb2, Sc1 to Sc2, Sd1 to Sd2, and Se1 to Se2 may be performed in sequence, that is, the output of Sa1 to Sa2 is the input of Sb1 to Sb2, the output of Sb1 to Sb2 is the input of Sc1 to Sc2, the output of Sc1 to Sc2 is the input of Sd1 to Sd2, and the output of Sd1 to Sd2 is the input of Se1 to Se2.
在另一些实施例中,上述Sa1至Sa2,Sb1至Sb2,Sc1至Sc2,Sd1至Sd2,Se1至Se2可以任意组合执行。In other embodiments, the above-mentioned Sa1 to Sa2, Sb1 to Sb2, Sc1 to Sc2, Sd1 to Sd2, and Se1 to Se2 may be performed in any combination.
可理解的是,基于图像子区域的权限等级的高低情况,可以选择相应的目标待滤波区域进行上述滤波处理。并且可以根据待处理图像的滤波处理需求,选择对图像子区域的相接边界的单侧边的像素点进行滤波处理或者双侧边的像素点进行滤波处理,同时也可以对不同滤波处理方法进行组合,按照组合顺序对待处理图像进行滤波处理,改善待处理图像中不同权限区域的图像质量,从而可以提高用户的使用体验感。It is understandable that, based on the level of authority of the image sub-region, the corresponding target area to be filtered can be selected for the above filtering process. And according to the filtering process requirements of the image to be processed, the pixel points on one side of the adjacent boundary of the image sub-region can be selected for filtering process or the pixel points on both sides can be filtered process. At the same time, different filtering process methods can also be combined, and the image to be processed can be filtered in the order of combination, so as to improve the image quality of different authority areas in the image to be processed, thereby improving the user experience.
本申请还提供一种电子设备,如图19所示,图19为本申请提供的一种电子设备的结构示意图,电子设备12包括处理器201和通信接口202。处理器201和通信接口202之间相互耦合。可以理解的是,通信接口202可以为收发器或输入输出接口。可选的,电子设备12还可以包括存储器203,用于存储处理器201执行的指令或存储处理器201运行指令所需要的输入数据或存储处理器201运行指令后产生的数据。The present application also provides an electronic device, as shown in FIG19, which is a schematic diagram of the structure of an electronic device provided by the present application, and the electronic device 12 includes a processor 201 and a communication interface 202. The processor 201 and the communication interface 202 are coupled to each other. It is understandable that the communication interface 202 can be a transceiver or an input-output interface. Optionally, the electronic device 12 can also include a memory 203 for storing instructions executed by the processor 201 or storing input data required by the processor 201 to run the instructions or storing data generated after the processor 201 runs the instructions.
在一些实施例中,处理器201和通信接口202用于执行上述图像划分单元101、图像滤波单元102,图像解码单元103的功能。In some embodiments, the processor 201 and the communication interface 202 are used to perform the functions of the above-mentioned image division unit 101, the image filtering unit 102, and the image decoding unit 103.
本申请实施例中不限定上述通信接口202、处理器201以及存储器203之间的具体连接介质。本申请实施例在图17中以通信接口202、处理器201以及存储器203之间通过总线204连接,总线204在图19中以粗线表示,其它部件之间的连接方式,仅是进行示意性说明,并不引以为限。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图19中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The specific connection medium between the communication interface 202, the processor 201 and the memory 203 is not limited in the embodiment of the present application. In FIG. 17 , the communication interface 202, the processor 201 and the memory 203 are connected by a bus 204, and the bus 204 is represented by a bold line in FIG. 19 . The connection mode between other components is only for schematic illustration and is not limited thereto. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bold line is used in FIG. 19 , but it does not mean that there is only one bus or one type of bus.
存储器203可用于存储软件程序及模块,如本申请实施例所提供的解码方法或编码方法对应的程序指令/模块,处理器201通过执行存储在存储器203内的软件程序及模块,从而执行各种功能应用以及数据处理。该通信接口202可用于与其他设备进行信令或数据的通信。在本申请中该电子设备12可以具有多个通信接口202。The memory 203 can be used to store software programs and modules, such as program instructions/modules corresponding to the decoding method or encoding method provided in the embodiment of the present application. The processor 201 executes the software programs and modules stored in the memory 203 to perform various functional applications and data processing. The communication interface 202 can be used to communicate signaling or data with other devices. In the present application, the electronic device 12 can have multiple communication interfaces 202.
可以理解的是,本申请的实施例中的处理器可以是中央处理单元(central processing Unit,CPU)、神经处理器(neural processing unit,NPU)或图形处理器(graphic processing unit,GPU),还可以是其它通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其它可编程逻辑器件、晶体管逻辑器件,硬件部件或者其任意组合。通用处理器可以是微处理器,也可以是任何常规的处理器。 It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), a neural processing unit (NPU) or a graphic processing unit (GPU), or may be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. A general-purpose processor may be a microprocessor or any conventional processor.
本申请的实施例中的方法步骤可以通过硬件的方式来实现,也可以由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(random access memory,RAM)、闪存、只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于网络设备或终端设备中。当然,处理器和存储介质也可以作为分立组件存在于网络设备或终端设备中。The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a network device or a terminal device. Of course, the processor and the storage medium can also be present in a network device or a terminal device as discrete components.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机程序或指令。在计算机上加载和执行所述计算机程序或指令时,全部或部分地执行本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、网络设备、用户设备或者其它可编程装置。所述计算机程序或指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机程序或指令可以从一个网站站点、计算机、服务器或数据中心通过有线或无线方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是集成一个或多个可用介质的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,例如,软盘、硬盘、磁带;也可以是光介质,例如,数字视频光盘(digital video disc,DVD);还可以是半导体介质,例如,固态硬盘(solid state drive,SSD)。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc (DVD); it may also be a semiconductor medium, for example, a solid state drive (SSD).
在本申请的各个实施例中,如果没有特殊说明以及逻辑冲突,不同的实施例之间的术语和/或描述具有一致性、且可以相互引用,不同的实施例中的技术特征根据其内在的逻辑关系可以组合形成新的实施例。本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。在本申请的文字描述中,字符“/”,一般表示前后关联对象是一种“或”的关系;在本申请的公式中,字符“/”,表示前后关联对象是一种“相除”的关系。In the various embodiments of the present application, if there is no special explanation and logical conflict, the terms and/or descriptions between different embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships. In the present application, "at least one" means one or more, and "more" means two or more. "And/or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In the text description of the present application, the character "/" generally indicates that the previous and next associated objects are in an "or" relationship; in the formula of the present application, the character "/" indicates that the previous and next associated objects are in a "division" relationship.
可以理解的是,在本申请的实施例中涉及的各种数字编号仅为描述方便进行的区分,并不用来限制本申请的实施例的范围。上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定。 It is understood that the various numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic.

Claims (17)

  1. 一种图像处理方法,其特征在于,所述图像处理方法由电子设备执行,包括:An image processing method, characterized in that the image processing method is executed by an electronic device, comprising:
    将待处理图像划分为多个图像子区域,并获取每个图像子区域的权限等级;Divide the image to be processed into multiple image sub-regions, and obtain the permission level of each image sub-region;
    若所述多个图像子区域中相邻的至少两个图像子区域的权限等级不同,对所述至少两个图像子区域之间的相接边界进行滤波处理。If the authority levels of at least two adjacent image sub-regions among the multiple image sub-regions are different, filtering processing is performed on a connecting boundary between the at least two image sub-regions.
  2. 根据权利要求1所述的方法,其特征在于,所述权限等级包括第一权限等级、第二权限等级、零权限等级,所述零权限等级的图像子区域为任意权限等级的用户可以查看的图像子区域。The method according to claim 1 is characterized in that the permission levels include a first permission level, a second permission level, and a zero permission level, and the image sub-area of the zero permission level is an image sub-area that can be viewed by users of any permission level.
  3. 根据权利要求1或2所述的方法,其特征在于,将待处理图像划分为多个图像子区域,并获取每个图像子区域的权限等级之前,包括:The method according to claim 1 or 2, characterized in that before dividing the image to be processed into a plurality of image sub-regions and obtaining the permission level of each image sub-region, it comprises:
    接收所述待处理图像的解码码流,基于所述解码码流进行解码,获取解码后的待处理图像和所述待处理图像的解码信息。A decoded code stream of the image to be processed is received, and decoding is performed based on the decoded code stream to obtain the decoded image to be processed and decoding information of the image to be processed.
  4. 根据权利要求1或2所述的方法,其特征在于,所述滤波处理包括:去块效应垂直滤波、去块效应水平滤波、样本自适应补偿滤波、自适应环路滤波和神经网络滤波中的至少一个。The method according to claim 1 or 2 is characterized in that the filtering processing includes: at least one of deblocking effect vertical filtering, deblocking effect horizontal filtering, sample adaptive compensation filtering, adaptive loop filtering and neural network filtering.
  5. 根据权利要求4所述的方法,其特征在于,所述至少两个图像子区域间存在垂直方向的相接边界,所述滤波处理包括去块效应垂直滤波,所述对所述至少两个图像子区域之间的相接边界进行滤波处理,包括:The method according to claim 4, characterized in that there is a vertical boundary between the at least two image sub-regions, the filtering process includes deblocking vertical filtering, and the filtering process on the boundary between the at least two image sub-regions includes:
    确定所述至少两个图像子区域中第一子区域的垂直侧的目标待滤波区域;所述垂直侧为所述第一子区域相接边界的左侧或右侧,所述目标待滤波区域为以下任一种:相接边界的右侧待滤波区域、相接边界的左侧待滤波区域、相接边界的右侧待滤波区域和左侧待滤波区域;Determine a target area to be filtered on a vertical side of a first sub-region of the at least two image sub-regions; the vertical side is a left side or a right side of a boundary between the first sub-regions, and the target area to be filtered is any one of the following: a right side area to be filtered on a boundary between the two sub-regions, a left side area to be filtered on a boundary between the two sub-regions, a right side area to be filtered on a boundary between the two sub-regions, and a left side area to be filtered on a boundary between the two sub-regions;
    对所述目标待滤波区域进行去块效应垂直滤波。Performing a deblocking vertical filter on the target area to be filtered.
  6. 根据权利要求5所述的方法,其特征在于,所述相邻的至少两个图像子区域还包括第二子区域,所述第二子区域与所述第一子区域水平相邻,所述相邻的至少两个图像子区域的权限等级不同,包括:The method according to claim 5, characterized in that the at least two adjacent image sub-regions further include a second sub-region, the second sub-region is horizontally adjacent to the first sub-region, and the at least two adjacent image sub-regions have different authority levels, including:
    所述第一子区域的权限等级低于所述第二子区域的权限等级;The authority level of the first sub-area is lower than the authority level of the second sub-area;
    或者,第一子区域的权限等级高于所述第二子区域的权限等级;Alternatively, the authority level of the first sub-area is higher than the authority level of the second sub-area;
    或者,第一子区域的权限等级不等于所述第二子区域的权限等级;Alternatively, the authority level of the first sub-area is not equal to the authority level of the second sub-area;
    或者,第一子区域的权限等级不等于所述第二子区域的权限等级,且所述相接边界的滤波强度大于或者等于预设滤波强度。Alternatively, the authority level of the first sub-region is not equal to the authority level of the second sub-region, and the filtering strength of the adjacent boundary is greater than or equal to a preset filtering strength.
  7. 根据权利要求4所述的方法,其特征在于,所述至少两个图像子区域间存在水平方向的相接边界,所述滤波处理包括去块效应水平滤波,所述对所述至少两个图像子区域之间的相接边界进行滤波处理,包括:The method according to claim 4, characterized in that there is a horizontal boundary between the at least two image sub-regions, the filtering process includes deblocking effect horizontal filtering, and the filtering process on the boundary between the at least two image sub-regions comprises:
    确定所述至少两个图像子区域中第一子区域的水平侧的目标待滤波区域;所述水平侧为所述第一子区域相接边界的上侧或下侧,所述目标待滤波区域为以下任一种:相接边界的下侧待滤波区域、相接边界的上侧待滤波区域、相接边界的下侧待滤波区域和上侧待滤波区域;Determine a target area to be filtered on the horizontal side of a first sub-region of the at least two image sub-regions; the horizontal side is an upper side or a lower side of a boundary between the first sub-regions, and the target area to be filtered is any one of the following: a lower side area to be filtered of the boundary, an upper side area to be filtered of the boundary, a lower side area to be filtered of the boundary, and an upper side area to be filtered;
    对所述目标待滤波区域进行去块效应水平滤波。Performing a deblocking horizontal filter on the target area to be filtered.
  8. 根据权利要求7所述的方法,其特征在于,所述相邻的至少两个图像子区域还包括第三子区域,所述第三子区域与所述第一子区域垂直相邻,所述相邻的至少两个图像子区域的权限等级不同,包括:The method according to claim 7, characterized in that the at least two adjacent image sub-regions further include a third sub-region, the third sub-region is vertically adjacent to the first sub-region, and the at least two adjacent image sub-regions have different authority levels, including:
    所述第一子区域的权限等级低于所述第三子区域的权限等级;The authority level of the first sub-area is lower than the authority level of the third sub-area;
    或者,第一子区域的权限等级高于所述第三子区域的权限等级;Alternatively, the authority level of the first sub-area is higher than the authority level of the third sub-area;
    或者,第一子区域的权限等级不等于所述第三子区域的权限等级;Alternatively, the authority level of the first sub-area is not equal to the authority level of the third sub-area;
    或者,第一子区域的权限等级不等于所述第三子区域的权限等级,且所述相接边界的滤波强度大于或者等于预设滤波强度。Alternatively, the authority level of the first sub-region is not equal to the authority level of the third sub-region, and the filtering strength of the adjacent boundary is greater than or equal to a preset filtering strength.
  9. 根据权利要求4所述的方法,其特征在于,所述滤波处理包括样本自适应补偿滤波,所述对所述至少两个图像子区域之间的相接边界进行滤波处理,包括:The method according to claim 4, characterized in that the filtering process comprises sample adaptive compensation filtering, and the filtering process on the boundary between the at least two image sub-regions comprises:
    按照设定的滤波顺序,从所述至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域;所述周围侧依次包括:所述第一子区域与其他子区域的相接边界的左侧、上侧、右侧和下侧,所述第一子区域的权限等级与所述其他子区域的权限等级不同,所述目标待滤波区域为以下任一种:所述第一子区域内相较于所述相接边界的第一侧区域、所述第一子区域外相较于所述相接边界的第二侧区域、所述第一侧区域和所述第二侧区域;According to the set filtering order, a target area to be filtered is determined from the surrounding side of the first sub-region in the at least two image sub-regions; the surrounding side sequentially includes: the left side, the upper side, the right side and the lower side of the boundary between the first sub-region and other sub-regions, the authority level of the first sub-region is different from the authority level of the other sub-regions, and the target area to be filtered is any one of the following: a first side area in the first sub-region compared to the boundary, a second side area outside the first sub-region compared to the boundary, the first side area and the second side area;
    按照所述设定的滤波顺序,对所述目标待滤波区域进行样本自适应补偿滤波。According to the set filtering order, sample adaptive compensation filtering is performed on the target area to be filtered.
  10. 根据权利要求4所述的方法,其特征在于,所述滤波处理包括自适应环路滤波,所述对所述至少两个图像子区域之间的相接边界进行滤波处理,包括: The method according to claim 4, characterized in that the filtering process comprises adaptive loop filtering, and the filtering process on the boundary between the at least two image sub-regions comprises:
    按照设定的滤波顺序,从所述至少两个图像子区域中第一子区域的周围侧确定目标待滤波区域;所述周围侧依次包括:所述第一子区域与其他子区域的相接边界的左侧、上侧、右侧和下侧,所述第一子区域的权限等级与所述其他子区域的权限等级不同,所述目标待滤波区域为以下任一种:所述第一子区域内相较于所述相接边界的第一侧区域、所述第一子区域外相较于所述相接边界的第二侧区域、所述第一侧区域和所述第二侧区域;According to the set filtering order, a target area to be filtered is determined from the surrounding side of the first sub-region in the at least two image sub-regions; the surrounding side sequentially includes: the left side, the upper side, the right side and the lower side of the boundary between the first sub-region and other sub-regions, the authority level of the first sub-region is different from the authority level of the other sub-regions, and the target area to be filtered is any one of the following: a first side area in the first sub-region compared to the boundary, a second side area outside the first sub-region compared to the boundary, the first side area and the second side area;
    按照所述设定的滤波顺序,对所述目标待滤波区域进行自适应环路滤波。According to the set filtering order, adaptive loop filtering is performed on the target area to be filtered.
  11. 根据权利要求4所述的方法,其特征在于,还包括:The method according to claim 4, further comprising:
    根据所述待处理图像的解码信息,判断是否需要对所述至少两个图像子区域中第一子区域进行基于神经网络的滤波处理;Determining whether it is necessary to perform a neural network-based filtering process on a first sub-region of the at least two image sub-regions according to the decoded information of the image to be processed;
    在所述第一子区域需要进行基于神经网络的滤波处理的情况下,将所述第一子区域的重建像素值和所述第一子区域的权限等级,输入所述神经网络中;In the case where the first sub-region needs to be subjected to filtering processing based on a neural network, the reconstructed pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network;
    获取输出的所述第一子区域的滤波重建像素。Obtain output filtered reconstructed pixels of the first sub-region.
  12. 根据权利要求11所述的方法,其特征在于,在所述第一子区域需要进行基于神经网络的滤波处理的情况下,将所述第一子区域的像素值和所述第一子区域的权限等级,输入所述神经网络中,还包括:The method according to claim 11, characterized in that, when the first sub-region needs to be subjected to filtering processing based on a neural network, the pixel value of the first sub-region and the authority level of the first sub-region are input into the neural network, and further comprising:
    将与所述第一子区域的相邻的至少一个图像子区域的权限等级,输入所述神经网络中。The authority level of at least one image sub-region adjacent to the first sub-region is input into the neural network.
  13. 根据权利要求1所述的方法,其特征在于,所述电子设备根据用户的权限等级,获取低于或者等于所述用户的权限等级的图像子区域的信息;所述图像子区域的信息包括所述图像子区域的像素值。The method according to claim 1 is characterized in that the electronic device obtains information of an image sub-region that is lower than or equal to the user's authority level based on the user's authority level; the information of the image sub-region includes a pixel value of the image sub-region.
  14. 根据权利要求1所述的方法,其特征在于,所述若所述多个图像子区域中相邻的至少两个图像子区域的权限等级不同,对所述至少两个图像子区域之间的相接边界进行滤波处理,包括:The method according to claim 1, characterized in that if the authority levels of at least two adjacent image sub-regions among the multiple image sub-regions are different, filtering the connected boundary between the at least two image sub-regions comprises:
    对所述至少两个图像子区域之间的相接边界进行亮度通道分量的滤波处理;Performing filtering processing on the brightness channel component on the boundary between the at least two image sub-regions;
    或者,对所述至少两个图像子区域之间的相接边界进行色度通道分量的滤波处理;Alternatively, filtering of the chrominance channel component is performed on the boundary between the at least two image sub-regions;
    或者,对所述至少两个图像子区域之间的相接边界进行亮度通道分量和色度通道分量的滤波处理。Alternatively, filtering processing of the brightness channel component and the chrominance channel component is performed on the adjacent boundary between the at least two image sub-regions.
  15. 一种图像处理装置,其特征在于,所述图像处理装置包括:图像划分单元、图像滤波单元、图像解码单元;An image processing device, characterized in that the image processing device comprises: an image division unit, an image filtering unit, and an image decoding unit;
    所述图像划分单元,所述图像滤波单元,所述图像解码单元用于实现权利要求1至权利要求14中任一项所述的方法。The image division unit, the image filtering unit, and the image decoding unit are used to implement the method according to any one of claims 1 to 14.
  16. 一种电子设备,其特征在于,包括处理器和存储器,所述存储器用于存储计算机指令,所述处理器用于从存储器中调用并运行所述计算机指令,实现权利要求1至权利要求14中任一项所述的方法。An electronic device, characterized in that it includes a processor and a memory, wherein the memory is used to store computer instructions, and the processor is used to call and execute the computer instructions from the memory to implement any one of claims 1 to 14.
  17. 一种非暂态计算机可读存储介质,其特征在于,所述存储介质中存储有计算机程序或指令,当所述计算机程序或指令被电子设备执行时,实现权利要求1至14中任一项所述的方法。 A non-transitory computer-readable storage medium, characterized in that a computer program or instruction is stored in the storage medium, and when the computer program or instruction is executed by an electronic device, the method described in any one of claims 1 to 14 is implemented.
PCT/CN2024/072113 2022-11-14 2024-01-12 Image processing method and apparatus, and electronic device and storage medium WO2024104504A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211423122.2A CN118042163A (en) 2022-11-14 2022-11-14 Image processing method and device, electronic equipment and storage medium
CN202211423122.2 2022-11-14

Publications (1)

Publication Number Publication Date
WO2024104504A1 true WO2024104504A1 (en) 2024-05-23

Family

ID=90984626

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/072113 WO2024104504A1 (en) 2022-11-14 2024-01-12 Image processing method and apparatus, and electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN118042163A (en)
WO (1) WO2024104504A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060061741A (en) * 2004-12-02 2006-06-08 한국전자통신연구원 Blocking artifacts reduction apparatus and method using the characteristics of block boundary area
CN105491443A (en) * 2014-09-19 2016-04-13 中兴通讯股份有限公司 Method and device for processing and accessing images
CN111971961A (en) * 2018-03-28 2020-11-20 华为技术有限公司 Image processing apparatus and method for performing efficient deblocking
CN112514390A (en) * 2020-03-31 2021-03-16 深圳市大疆创新科技有限公司 Method and apparatus for video encoding
CN113557736A (en) * 2019-03-11 2021-10-26 华为技术有限公司 Sub-picture level filtering in video coding
CN114078134A (en) * 2020-08-21 2022-02-22 Oppo广东移动通信有限公司 Image processing method, device, equipment, computer storage medium and system
KR20220126641A (en) * 2021-03-09 2022-09-16 현대자동차주식회사 Video Coding Method and Apparatus Using De-blocking Filtering Based on Segmentation Information

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060061741A (en) * 2004-12-02 2006-06-08 한국전자통신연구원 Blocking artifacts reduction apparatus and method using the characteristics of block boundary area
CN105491443A (en) * 2014-09-19 2016-04-13 中兴通讯股份有限公司 Method and device for processing and accessing images
CN111971961A (en) * 2018-03-28 2020-11-20 华为技术有限公司 Image processing apparatus and method for performing efficient deblocking
CN113557736A (en) * 2019-03-11 2021-10-26 华为技术有限公司 Sub-picture level filtering in video coding
CN112514390A (en) * 2020-03-31 2021-03-16 深圳市大疆创新科技有限公司 Method and apparatus for video encoding
CN114078134A (en) * 2020-08-21 2022-02-22 Oppo广东移动通信有限公司 Image processing method, device, equipment, computer storage medium and system
KR20220126641A (en) * 2021-03-09 2022-09-16 현대자동차주식회사 Video Coding Method and Apparatus Using De-blocking Filtering Based on Segmentation Information

Also Published As

Publication number Publication date
CN118042163A (en) 2024-05-14

Similar Documents

Publication Publication Date Title
TWI834773B (en) Method, device and computer-readable storage medium of encoding and decoding one or more portions of an image using adaptive loop filtering
RU2696552C1 (en) Method and device for video coding
KR100234316B1 (en) Signal adaptive filter for reducing ringing noise and signal adaptive filering method thereof
JP2022540133A (en) Sample decision for adaptive loop filtering
KR102359415B1 (en) Interpolation filter for inter prediction apparatus and method for video coding
US20220345699A1 (en) In-loop filtering method and device
US20220116664A1 (en) Loop filtering method and device
KR100675498B1 (en) Device and method for filtering
CN114025164A (en) Image encoding method, image decoding method, encoder, and decoder
WO2024104504A1 (en) Image processing method and apparatus, and electronic device and storage medium
EP3525461A1 (en) Adaptive loop filtering
CN110249630B (en) Deblocking filter apparatus, method and storage medium
WO2021061748A1 (en) Video compression with in-loop sub-image level controllable noise generation
WO2020171760A1 (en) Deblocking on 4x4 grid using long filters
WO2020258052A1 (en) Image component prediction method and device, and computer storage medium
CN114097236A (en) Video coding and decoding method, device and storage medium
JPH07307942A (en) Image noise removing device
CN115002461B (en) Video coding quantization method and device, electronic equipment and storage medium
Li et al. Complexity Reduction of an Adaptive Loop Filter Based on Local Homogeneity
WO2024007116A1 (en) Decoding method, encoding method, decoder, and encoder
WO2024016982A1 (en) Adaptive loop filter with adaptive filter strength
WO2024012576A1 (en) Adaptive loop filter with virtual boundaries and multiple sample sources
WO2023197181A1 (en) Decoding method, encoding method, decoders and encoders
WO2023197179A1 (en) Decoding method, encoding method, decoder and encoder
JP7460802B2 (en) Image enhancement method and device