WO2016123782A1 - Method for template processing, and related device - Google Patents
Method for template processing, and related device Download PDFInfo
- Publication number
- WO2016123782A1 WO2016123782A1 PCT/CN2015/072344 CN2015072344W WO2016123782A1 WO 2016123782 A1 WO2016123782 A1 WO 2016123782A1 CN 2015072344 W CN2015072344 W CN 2015072344W WO 2016123782 A1 WO2016123782 A1 WO 2016123782A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- template
- binarized block
- block template
- binarized
- pixel
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/189—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
- H04N19/196—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding being specially adapted for the computation of encoding parameters, e.g. by averaging previously computed encoding parameters
Definitions
- the present invention relates to the field of video coding and decoding, and in particular to a template processing method and related equipment.
- hybrid coding structures are commonly used for encoding and decoding video sequences.
- Current prediction techniques typically include both intra prediction and inter prediction techniques.
- the intra prediction technique uses the spatial pixel information of the current image block to remove redundant information of the current image block to obtain a residual.
- the inter prediction technique removes redundant information of the current image block using the encoded or decoded image pixel information adjacent to the current image block to obtain a residual.
- an image adjacent to a current image block for inter prediction is referred to as a reference image.
- the 3D video codec involves the encoding and decoding of the depth map, wherein the depth map can reflect the distance of the object in the scene to the camera, and the depth map has completely different characteristics from the natural image (for example, the texture image/color image).
- the depth map consists of most of the flat areas and a small number of sharp edges.
- the purpose of the depth map is not directly for viewing, but as an auxiliary tool for viewpoint synthesis.
- Traditional coding tools have high compression efficiency in the flat portion of the depth image and a large margin in the sharp edge region. The coding error directly leads to large distortion in the synthesized virtual view.
- Depth Map Modeling Mode DMM is introduced into the 3D video codec framework as an optional intra prediction mode.
- the block division technique can also be used for the 3D video codec process.
- wedgelet division is a common method.
- the principle is that an image block can be divided into two regions having an arbitrary shape by a block division technique, and each region uses a prediction value for encoding and decoding operations.
- Encoding and decoding a depth map usually requires the use of a wedge template set.
- Each size image block requires a corresponding wedge template set, and the wedge template set of each size image block may include multiple binarized block templates.
- a wedge template set of image blocks of each size usually includes an extremely large number of binarized block templates, for example, a wedge template set of a size block of 4 ⁇ 4 usually includes 86 binarized block templates, and for example, a wedge template set of an image block of size 8x8 typically includes 766 binarized block templates, and a set of wedge templates of a size block of 16x16 typically includes 1350 binarized block templates.
- a large number of binarized block templates in a wedge template set of image blocks of one size will increase the complexity of the video codec device. For example, if the number of binarized block templates in the wedge template set is large, it will occupy more storage space and thus increase the burden on the codec device.
- the embodiment of the invention provides a template processing method and related equipment, so as to reduce the number of binary templated blocks in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
- a first aspect of the embodiments of the present invention provides a template processing method, including:
- the wedge template set is a current set of wedge templates of image blocks of size N*M;
- the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs
- the template j is any binarized blocking template in the set of wedge templates, wherein the N and the M are positive integers.
- the number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where
- the binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Differentiating; the binarized block template value of the class B pixel in the binarized block template i and the binarized block of the same pixel in the binarized block template j
- the template values are the same;
- the number of class A pixels in the pixel of the binarized block template i is greater than or equal to a first threshold, and the number of class B pixels in the bins in the binarized block template i is greater than Or equal to a second threshold, wherein the second threshold is a positive integer, the binarized block template value of the class A pixel in the binarized block template i and the binarized block template j
- the binarized block template value of the pixel having the same coordinate is different; the binarized block template value of the class B pixel in the binarized block template i and the binarized block
- the binarized block template values of the same pixel points in the template j are the same;
- the number of the type A pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the number of the class B pixels in the pixel in the binarized block template i accounts for The ratio of the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the second threshold is a positive number; and the type A pixel of the binarized block template i
- the binarized block template value is different from the binarized block template value of the pixel having the same coordinate in the binarized block template j; the binary value
- the binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
- the ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization There is a class B pixel in the pixel in the block template i, wherein the fourth threshold is a positive number, wherein the binarized block template of the class A pixel in the binarized block template i
- the value is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarization of the class B pixel in the binarized block template i
- the block template value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
- the ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The number of class B pixels in the pixel in the block template i is greater than or equal to a second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and the binarized block
- the binarized block template value of the class A pixel in the template i is different from the binarized block template value of the pixel having the same coordinate in the binarized block template j;
- the binarization The binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
- the ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The ratio of the number of class B pixel points in the pixel in the block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number Wherein the second threshold is a positive number, the binarized block template value of the class A pixel in the binarized block template i and the coordinate in the binarized block template j The binarized block template values of the same pixel are different; the binarized block template value of the class B pixel in the binarized block template i and the binary in the binarized block template j The binarized block template values of the same coordinates are the same;
- the number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i,
- the binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;
- the number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j
- the binarized block template values of the pixel regions having the same coordinates are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarized block
- the binarized block template value of the same pixel region in the template j is the same;
- the number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i
- the binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i
- the binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
- the set of wedge templates is a wedge template table.
- the starting point of the sampling point pair x and the starting point of the sampling point pair y are at least spaced apart 1 sample point.
- the wedge template set is a current set of wedge templates of image blocks of size N*M;
- the binarized block template i is added to the wedge template set.
- the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, wherein the binarized block template j is the wedge shape Any of the binarized block templates in the set of templates, wherein the N and the M are positive integers.
- the difference between the binarized block template i and the binary block template j in the wedge template set is consistent with a preset Filtering conditions include:
- the number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where
- the binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Different;
- the binarized block template value of the class B pixel in the binarized block template i is the same as the coordinate in the binarized block template j
- the binarized block template values of the prime points are the same;
- the ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization Blocking template i
- the number of class B pixels in the pixel is greater than or equal to a second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and A in the binarized block template i
- the binarized block template value of the pixel-like point is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarized block template i
- the binarized block template value of the class B pixel is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
- the ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The ratio of the number of class B pixel points in the pixel in the block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number Wherein the second threshold is a positive number, the binarized block template value of the class A pixel in the binarized block template i and the coordinate in the binarized block template j The binarized block template values of the same pixel are different; the binarized block template value of the class B pixel in the binarized block template i and the binary in the binarized block template j The binarized block template values of the same coordinates are the same;
- the number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i,
- the binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;
- the number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j
- the binarized block template values of the pixel regions having the same coordinates are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarized block
- the binarized block template values are the same;
- the number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i
- the binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i
- the binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
- the ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization There is a D-type pixel region in the pixel region in the block template i, wherein the eighth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are different; the binarized block templates of the D-type pixel regions in the binarized block template i The value is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
- the ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The number of the D-type pixel regions in the pixel region in the block template i is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, the binarized block template i
- the number of C-type pixel regions in the pixel region of the binarized block template i occupies the binarization
- the ratio of the total number of pixel regions of the block template i is greater than or equal to an eighth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i occupies the binarized block template i
- the ratio of the total number of pixel regions is greater than or equal to a seventh threshold, the eighth threshold is a positive number, the sixth threshold is a positive number, and the binary value of the C-type pixel region in the binarized block template i
- the binning template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the D-type pixel region in the binarized block template i
- the binarized block template value is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j.
- the set of wedge templates is a wedge template table.
- the sampling point is included in the x
- the starting point and the sampling point are not adjacent to the starting point included in y
- the sampling point pair x and the sampling point pair y are any two sampling point pairs of the K kinds of sampling points.
- the starting point included in the sampling point pair x and the starting point included in the sampling point pair y are separated by at least one sampling point.
- the template processing apparatus is used in a video encoding apparatus or a video decoding apparatus.
- a fourth aspect of the embodiments of the present invention provides a template processing apparatus, including:
- An obtaining unit configured to acquire a binarized blocking template corresponding to each of the pair of sampling points of the K sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K species Different sampling points in the pair of sampling points have different start points and/or end points, and the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, the sampling point pair x and the Sample point pair y is the K Any two pairs of sampling points in the sampling point;
- a comparison unit configured to compare the binarized block template corresponding to each sample point pair of the acquired K sample point pairs with the binarized block template in the wedge template set, wherein the wedge shape
- the template set is a current set of wedge templates of the image block of size N*M;
- the set of wedge templates is a wedge template table.
- the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are any two sampling point pairs of the K kinds of sampling points.
- the starting point of the sampling point pair x and the starting point of the sampling point pair y are at least spaced apart 1 sample point.
- the template processing device is used in a video encoding device or in a video decoding device.
- a fifth aspect of the embodiments of the present invention provides a template processing apparatus, including:
- the processor is configured to determine a current blocking template of a binarized blocking template of an image block of size N*M by calling a code or an instruction in the memory; acquiring the current blocking template a binarized blocking template corresponding to each of the pair of sampling point pairs traversed, wherein the K is a positive integer, and the starting point of the different sampling point pairs of the K sampling point pairs Different and / or end points Differentiating; comparing the obtained binarized block template of each of the K sample point pairs to the binarized block template of the wedge template set, wherein the wedge template set is The current wedge template set of the image block of size N*M; comparing the difference between the binarized block template i and the binarized block template j of the wedge template set according to a preset screening condition In the case of the method, the binarized block template i is added to the wedge template set, wherein the binarized block template i is any one of the K sample point pairs. Corresponding binarized block template, wherein the binarized block template j
- the number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where
- the binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Differentiating; the binarized block template value of the class B pixel in the binarized block template i and the binarized block of the same pixel in the binarized block template j
- the template values are the same;
- the number of the type A pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the number of the class B pixels in the pixel in the binarized block template i accounts for Binarization
- the ratio of the total number of pixel points of the block template i is greater than or equal to a third threshold, wherein the second threshold is a positive number;
- the binarized block of the class A pixel in the binarized block template i The template value is different from the binarized block template value of the same pixel in the binarized block template j; binarization of the class B pixel in the binarized block template i
- the block template value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
- the number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i,
- the binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;
- the number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i
- the binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i
- the binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
- the ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization Block There is a D-type pixel region in the pixel region in the template i, wherein the eighth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are different; the binarized block template values of the D-type pixel regions in the binarized block template i are The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are the same;
- the ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The number of the D-type pixel regions in the pixel region in the block template i is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, the binarized block template i
- the sixth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is the same as the pixel region in the binary block template j
- the binarized block template values are different; the binarized block template values of the class D pixel regions in the binarized block template i are the same as the coordinates in the binarized block template j
- the binarized block template values of the pixel area are the same.
- the wedge template set may be a wedge template table.
- the sampling point is included in the x
- the starting point and the sampling point are not adjacent to the starting point included in y
- the sampling point pair x and the sampling point pair y are Any two of the K sample points are sampled.
- the starting point of the sampling point pair x and the starting point of the sampling point pair y are at least spaced apart 1 sample point.
- a sixth aspect of the embodiments of the present invention provides a template processing apparatus, including:
- the processor is configured to determine a current blocking template of a binarized blocking template of an image block of size N*M by calling a code or an instruction in the memory; acquiring the current blocking template a binarized blocking template corresponding to each of the pair of sampling point pairs traversed, wherein the K is a positive integer, and the starting point of the different sampling point pairs of the K sampling point pairs The difference between the sampling point pair x and the starting point of the sampling point pair y are not adjacent, and the sampling point pair x and the sampling point pair y are in the K sampling points.
- the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, the sampling point pair x and the sample point pair y are any two sample point pairs of the K sample points.
- Comparing the binarized block templates for comparison if comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition, the A binarized block template i is added to the wedge template set of the image block of size N*M, wherein the screening condition is selected to filter the candidate binarized block template, which will meet the screening conditions.
- the alternative binarized block template is added to the wedge template set of image blocks of size N*M, whereas in the prior art all alternative binarizations that differ from the binarized block templates in the wedge template set are present.
- the block templates are added to the wedge template set, which can be seen in the above scheme.
- FIG. 2 is a schematic flowchart of a template processing method according to an embodiment of the present disclosure
- FIG. 2 is a schematic diagram of a template comparison according to an embodiment of the present invention.
- FIG. 4 is a schematic flowchart diagram of another template processing method according to an embodiment of the present disclosure.
- FIG. 5 is a schematic flowchart diagram of another template processing method according to an embodiment of the present disclosure.
- 6-h is a schematic diagram of a start interval sampling according to an embodiment of the present invention.
- FIG. 7 is a schematic flowchart diagram of another template processing method according to an embodiment of the present disclosure.
- FIG. 8 is a schematic diagram of a template processing apparatus according to an embodiment of the present disclosure.
- FIG. 9 is a schematic diagram of another template processing apparatus according to an embodiment of the present disclosure.
- FIG. 11 is a schematic diagram of another template processing apparatus according to an embodiment of the present invention.
- the embodiment of the invention provides a template processing method and related equipment, so as to reduce the number of binary templated blocks in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
- a template processing method may include: determining a size a current block template of the binarized block template of the N*M image block; and a binarized block corresponding to each of the K sample point pairs traversed by the current block template a template, wherein the K is a positive integer, the different sampling point pairs of the K sampling point pairs are different in starting point and/or the ending point; each of the obtained K sampling point pairs is sampled Comparing the corresponding binarized block template with the binarized block template of the wedge template set, wherein the set of wedge templates is the current set of wedge templates of the image block of size N*M; Comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition, adding the binarized block template i to the a set of wedge templates, wherein the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, and the binarized block template
- FIG. 2-a is a schematic flowchart diagram of a template processing method according to an embodiment of the present invention.
- a template processing method provided by an embodiment of the present invention may include:
- the N may be equal to or not equal to M, for example, the N may be greater than or less than the M.
- the N may be equal to a positive integer power of 2.
- the N may, for example, also be equal to a positive integer power of two.
- each of the binarized block templates in the wedge template set of the image block of size N*M corresponds to a size of N*M.
- the corresponding two pairs of each of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M are obtained.
- the binarized segmentation template corresponding to each of the K sample point pairs and the binary segment of the image block wedge template set of size N*M are obtained.
- Comparing the block templates comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition, the binarization is performed A block template i is added to the wedge template set of the image block of size N*M, wherein the screening condition is selected to filter the candidate binarized block template, and the second candidate that meets the screening condition will be selected.
- the valued block template is added to the wedge template set of the image block of size N*M, whereas in the prior art, all the alternative binarized block templates which differ from the binarized block template in the wedge template set are Add to the wedge template set (this is also the prior art leading to the wedge template set).
- the main reason for the huge number of binarized block templates is that the above scheme is advantageous for reducing the number of binarized block templates added to the wedge template set of image blocks of size N*M, thereby facilitating the reduction of image blocks.
- the number of binarized block templates in the wedge template set is beneficial to reduce the complexity of the video codec device.
- the preset screening conditions can be flexibly set according to needs, and the preset screening conditions may be various.
- the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: pixels of the binarized block template i The number of the type A pixel points in the point is greater than or equal to the first threshold, and the type B pixel point exists in the pixel in the binarized blocking template i, wherein the binarized blocking template i
- the binarized block template value of the class A pixel is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarized block template i
- the binarized block template value of the class B pixel in the same is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j.
- the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: the binarized block template i The number of class A pixel points in the pixel is greater than or equal to a first threshold, and the number of class B pixels in the pixel in the binarized segment template i is greater than or equal to a second threshold, the second The threshold is a positive integer, the The binarized block template value of the class A pixel in the binarized block template i is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; The binarized block template value of the class B pixel in the binarized block template i and the binarized block template value of the pixel with the same coordinate in the binarized block template j the same;
- the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: the binarized block template i
- the ratio of the number of class A pixel points in the pixel to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold
- the pixel in the binarized block template i The ratio of the number of B-type pixel points to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number, wherein the second threshold is positive a binarized block template value of the class A pixel in the binarized block template i and a binarized block of the same pixel in the binarized block template j
- the template values are different; wherein the binarized block template value of the class B pixel in the binarized block template i is the same as the pixel with the same coordinate in the bin
- the second threshold may be equal to 1, 2, 5, 10, 20 or other values, for example.
- the fifth threshold may be equal to, for example, 4, 5, 8, 10, 20 or other values.
- the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two of the K sample points are sampled.
- Another template processing method includes: determining a current blocking template of a binarized blocking template of an image block of size N*M; and acquiring each of the K sampling point pairs traversed by the current blocking template.
- Point to the corresponding binarized block template wherein the K is a positive integer, and the different sampling point pairs of the K sample point pairs are different in starting point and/or ending point, and the sampling point is x
- the included starting point and the sampling point are not adjacent to the starting point included in y, and the sampling point pair x and the sampling point pair y are any two sampling point pairs of the K sampling points;
- the pair of binarized block templates and wedge templates in each of the K pairs of sample pairs The binarized template is compared, wherein the set of wedge templates is a current set of wedge templates of the image block of size N*M; comparing the binarized block template i with the wedge template set In the case where there is a difference between the binarized block templates j, the binarized block template i
- the N may be equal to or not equal to M, for example, the N may be greater than or less than the M.
- an image block of size N*M can be, for example, an image block of size 2*2, an image block of size 4*4, an image block of size 8*8, and an image block of size 16*16.
- the image block mentioned in each embodiment of the present invention may refer to an image block of a depth map or an image block of other types of images.
- the image block of the above size N*M may be an image block of size N*M of the depth map.
- the K can be equal to 2, 3, 4, 10, 15, 30, 50, 65 or other values.
- the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, and in other words, for the K sample points
- the binarized block template corresponding to each sample point pair of the pair can be compared with each binarized block template in the current wedge template set of the image block of size N*M. If the difference between any of the binarized block templates in the current wedge template set of the image block of size N*M conforms to the preset filter condition, it can be added to the size The current wedge template set of N*M image blocks. It can be understood that with the gradual addition of the binarized block template, the image block of size N*M The number of binarized block templates in the current wedge template set will gradually increase.
- the difference between the binarized block template i and the binarized block template j in the set of wedge templates may include, for example, the presence of a class A pixel in the pixel of the binarized block template i.
- the binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j different.
- the difference between the binarized block template i and the binarized block template j in the set of wedge templates may include: a type C pixel region exists in a pixel region of the binarized block template i, The binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template value of the pixel region having the same coordinate in the binarized block template j different.
- the set of wedge templates of the image block of size N*M can be used for prediction of image blocks of size N*M, and the like.
- an image block of size N*M can also be predicted using a set of wedge templates of image blocks of size N*M.
- the corresponding two pairs of each of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M are obtained.
- the binarized segmentation template corresponding to each of the K sample point pairs and the binary segment of the image block wedge template set of size N*M are obtained. Comparing the block templates; and comparing the difference between the binarized block template i and the binarized block template j in the wedge template set, adding the binarized block template i to The wedge template of the image block of size N*M is concentrated.
- the sampling point pair x and the sampling point pair y are any two sampling point pairs among the K sampling points. That is to say, the above-mentioned K sampling point pairs are obtained by interval sampling, which is equivalent to not obtaining the binarization corresponding to each sampling point pair of all the sampling point pairs traversed by the current blocking template.
- the block template therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which is advantageous for reducing the addition to size N*M
- the number of binarized block templates of the wedge template set of the image block thereby facilitating the reduction of the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
- the set of wedge templates may be, for example, a wedge template table.
- the template processing method may be used in a video encoding process or a video decoding process.
- the wedge template set of the image block of size N*M can be used to predict an image block of size N*M, and the like. It is possible to predict an image block of size N*M by using a wedge template set of image blocks of size N*M.
- the execution body of the template processing method may be a video encoding device or a video decoding device.
- the video encoding device or video decoding device can be any device that needs to output or store video, such as a laptop, tablet, personal computer, mobile phone, digital television, or video server.
- the video encoding apparatus determines a current blocking template of the binarized blocking template of the image block of size N*M.
- N and the M are positive integers.
- the N can be equal to 2, 4, 8, 16, 30, 64 or other values.
- the set of wedge templates may be, for example, a wedge template table.
- the block template is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which also helps to further reduce the addition to size N *
- the number of binarized block templates of the wedge template set of the image block of M which is advantageous for reducing the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
- the video decoding apparatus determines a current blocking template of the binarized blocking template of the image block of size N*M.
- the video decoding device acquires each sample point pair of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M. After the corresponding binarized block template, the binarized block template corresponding to each sample point pair of the obtained K sample point pairs and the image block wedge template of size N*M are collected.
- the N can be equal to 2, 4, 8, 16, 30, 64 or other values.
- step 710 is performed.
- step 705 is performed.
- the sampling point pair x and the sampling point pair y are any two sampling point pairs among the K sampling points. That is to say, the above-mentioned K sampling point pairs are obtained by interval sampling, which is equivalent to not acquiring the corresponding two pairs of each sampling point pair of all the sampling point pairs traversed by the current blocking template.
- the number of class A pixels of the binarized block template corresponding to the fth sample point is less than 7 (ie, The difference between the two binarized block templates is small, then it can be determined that the binarized block template corresponding to the fth sample point is not added to the wedge template of the above-mentioned 16 ⁇ 16 depth image block. concentrated.
- the wedge template set of the depth image block of size 16 ⁇ 16 currently has 197 binarized block templates corresponding to size 16 ⁇ 16, and the binary value corresponding to the fth sample point is Blocking template, with the above wedge template concentrated
- the 197 binarized block templates that existed before are cyclically compared. And determining, according to the difference result obtained by the comparison, whether the binarized block template corresponding to the fth sample point is added to the wedge template set.
- the binarized block template corresponding to the fth sample point is The above-mentioned wedge template sets 80 existing binarized block templates that are already existing in the loop for cyclic comparison. And determining, according to the difference result obtained by the comparison, whether the binarized block template corresponding to the fth sample point is added to the wedge template set. For example, if there is any one binarized block template in the 80 binary templated templates in the wedge template set, the type A pixel points exist in the pixels of the binarized block template corresponding to the fth sample point ( A difference exists between the two binarized block templates.
- the obtaining unit 820 is configured to obtain a binarized blocking template corresponding to each of the pair of sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K Different sampling points of different pairs of sampling points have different starting points and/or different ending points;
- the comparing unit 830 is configured to compare the binarized blocking template corresponding to each of the acquired sampling point pairs to the binary templated template in the wedge template set, wherein the The set of wedge templates is a current set of wedge templates of the image block of size N*M;
- the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to preset screening conditions, including:
- the number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where Binaryized block template values of the class A pixel points in the binarized block template i and the binarized block template j The binarized block template values of the same pixel points are different; the binarized block template values of the class B pixels in the binarized block template i and the binarized block template j The binarized block template values of the same pixel points in the same are the same;
- the ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The number of class B pixels in the pixel in the block template i is greater than or equal to a second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and the binarized block
- the binarized block template value of the class A pixel in the template i is different from the binarized block template value of the pixel having the same coordinate in the binarized block template j;
- the binarization The binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
- the number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i,
- the binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;
- the number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j In the coordinate
- the binarized block template values of the same pixel region are different; the binarized block template value of the D-type pixel region in the binarized block template i and the binarized block template j
- the binarized block template values of the pixel regions having the same coordinates are the same;
- the number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i
- the binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i
- the binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
- the ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization There is a D-type pixel region in the pixel region in the block template i, wherein the eighth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are different; the binarized block templates of the D-type pixel regions in the binarized block template i The value is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
- the ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The number of the D-type pixel regions in the pixel region in the block template i is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, the binarized block template i
- the ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization
- the ratio of the number of the D-type pixel regions in the pixel region in the block template i to the total amount of the pixel regions of the binarized block template i is greater than or equal to a seventh threshold, and the eighth threshold is a positive number.
- the sixth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is the same as the pixel region in the binary block template j
- the binarized block template values are different; the binarized block template values of the class D pixel regions in the binarized block template i are the same as the coordinates in the binarized block template j
- the binarized block template values of the pixel area are the same.
- the set of wedge templates may be, for example, a wedge template table.
- the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two of the K sample points are sampled.
- the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least 1 sampling point.
- the template processing apparatus is used in a video encoding apparatus or a video decoding apparatus.
- the template processing apparatus 800 acquires each sampling point of the K sampling point pairs traversed by the current blocking template of the binarized blocking template of the image block of size N*M. After the corresponding binarized block template is obtained, the binarized block template corresponding to each sample point pair of the acquired K sample point pairs and the image block wedge template of size N*M are concentrated.
- Comparing the binarized block templates comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition,
- the binarized block template i is added to the wedge template set of the image block of size N*M, wherein the screening condition is introduced
- the alternative binarized block template is filtered, and the candidate binarized block template conforming to the filter condition is added to the wedge template set of the image block of size N*M, whereas in the conventional technology, the wedge template is concentrated. All alternative binarized block templates with different binarized block templates are added to the wedge template set (this is also the main reason why the number of binarized block templates in the wedge template set is huge in the prior art).
- the above solution is advantageous for reducing the number of binarized block templates added to the wedge template set of the image block of size N*M, which is advantageous for reducing the number of binarized block templates in the wedge template set of the image block, thereby facilitating the number of binarized block templates in the wedge template set of the image block.
- N*M the number of binarized block templates added to the wedge template set of the image block of size
- N*M the number of binarized block templates in the wedge template set of the image block
- a template processing apparatus 900 may include:
- a determining unit 910 configured to determine a current blocking template of the binarized blocking template of the image block of size N*M;
- the obtaining unit 920 is configured to obtain a binarized blocking template corresponding to each of the pair of sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K Different sampling points of different sampling point pairs are different in starting point and/or ending point, and the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point is x and The sampling point pair y is any two sampling point pairs of the K sampling points;
- the comparing unit 930 is configured to compare the binarized blocking template corresponding to each of the acquired sampling point pairs with the binary templated template in the wedge template set, wherein the The set of wedge templates is a current set of wedge templates of the image block of size N*M;
- the adding unit 940 is configured to add the binarized block template i to the case where there is a difference between the binarized block template i and the binarized block template j in the wedge template set.
- the binary template is set, and the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, wherein the binarized block is
- the template j is any type of binarized block template in the set of wedge templates, and the N and the M are positive integers.
- the set of wedge templates may be a wedge template table.
- the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two of the K sample points are sampled.
- the starting point included in the sampling point pair x and the starting point included in the sampling point pair y are separated by at least one sampling point.
- the template processing apparatus 900 is used in a video encoding apparatus or in a video decoding apparatus.
- the template processing apparatus 900 acquires each sampling point of the K sampling point pairs traversed by the current blocking template of the binarized blocking template of the image block of size N*M. After the corresponding binarized block template is obtained, the binarized block template corresponding to each sample point pair of the acquired K sample point pairs and the image block wedge template of size N*M are concentrated. Comparing the binarized block templates; and comparing the difference between the binarized block template i and the binarized block template j in the wedge template set, the binarization is divided A block template i is added to the wedge template set of the image block of size N*M.
- the sampling point pair x and the sampling point pair y are any two sampling point pairs among the K sampling points. That is to say, the above-mentioned K sampling point pairs are obtained by interval sampling, which is equivalent to not obtaining the binarization corresponding to each sampling point pair of all the sampling point pairs traversed by the current blocking template.
- the block template therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which is advantageous for reducing the addition to size N*M
- the number of binarized block templates of the wedge template set of the image block thereby facilitating the reduction of the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
- a template processing apparatus 1000 may include:
- the processor 1002 and the memory 1003 are coupled by a bus 1001.
- the processor 1002 is configured to determine a current blocking template of a binarized blocking template of an image block of size N*M by calling a code or an instruction in the memory 1003; acquiring the current blocking template a binarized blocking template corresponding to each of the pair of sampling point pairs traversed, wherein the K is a positive integer, and the different sampling point pairs included in the K sampling point pairs are included The start point is different and/or the end point is different; the binarized block template corresponding to each sample point pair of the obtained K sample point pairs is compared with the binary block template in the wedge template set, wherein The set of wedge templates is a current set of wedge templates of the image block of size N*M; comparing the difference between the binarized block template i and the binarized block template j of the wedge template set Adding the binarized block template i to the wedge template set, wherein the binarized block template i is any of the K sample point pairs.
- the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to preset screening conditions, including:
- the number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where
- the binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Differentiating; the binarized block template value of the class B pixel in the binarized block template i and the binarized block of the same pixel in the binarized block template j
- the template values are the same;
- the number of class A pixels in the pixel of the binarized block template i is greater than or equal to a first threshold, and the number of class B pixels in the bins in the binarized block template i is greater than Or equal to a second threshold, wherein the second threshold is a positive integer, the binarized block template value of the class A pixel in the binarized block template i and the binarized block template j
- the binarized block template value of the pixel having the same coordinate is different; the binarized block template value of the class B pixel in the binarized block template i and the binarized block
- the binarized block template values of the same pixel points in the template j are the same;
- the number of the type A pixel points in the pixel of the binarized block template i is greater than or equal to the first a threshold value, and a ratio of the number of the B-type pixel points in the pixel in the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, where The second threshold is a positive number; the binarized block template value of the class A pixel in the binarized block template i is the same as the pixel in the binarized block template j The binarized block template values of the points are different; the binarized block template values of the class B pixels in the binarized block template i are the same as the coordinates in the binarized block template j The binarized block template values of the pixels are the same;
- the ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization There is a class B pixel in the pixel in the block template i, wherein the fourth threshold is a positive number, wherein the binarized block template of the class A pixel in the binarized block template i
- the value is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarization of the class B pixel in the binarized block template i
- the block template value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
- the ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The number of class B pixels in the pixel in the block template i is greater than or equal to a second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and the binarized block
- the binarized block template value of the class A pixel in the template i is different from the binarized block template value of the pixel having the same coordinate in the binarized block template j;
- the binarization The binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
- the ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization
- the ratio of the number of class B pixel points in the pixel in the block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number
- the second threshold value is a positive number
- the binarized block template value of the class A pixel point in the binarized block template i is compared with the binarization
- the binarized block template values of the same pixel points in the block template j are different; the binarized block template values of the class B pixels in the binarized block template i are the same as the two The value of the binarized block template of the pixel with the same coordinate in the valued block template j is the same;
- the number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i,
- the binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;
- the number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j
- the binarized block template values of the pixel regions having the same coordinates are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarized block
- the binarized block template value of the same pixel region in the template j is the same;
- the number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i
- the binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i
- the binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
- the number of C-type pixel regions in the pixel region of the binarized block template i occupies the binarization
- the ratio of the total number of the pixel regions of the block template i is greater than or equal to the eighth threshold, and the pixel region of the binarized block template i has a D-type pixel region, wherein the eighth threshold is a positive number.
- the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template value of the pixel region having the same coordinate in the binarized block template j Differentiating; the binarized block template value of the D-type pixel region in the binarized block template i and the binarized block of the pixel region having the same coordinate in the binarized block template j
- the template values are the same;
- the ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The number of the D-type pixel regions in the pixel region in the block template i is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, the binarized block template i
- the ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization
- the ratio of the number of the D-type pixel regions in the pixel region in the block template i to the total amount of the pixel regions of the binarized block template i is greater than or equal to a seventh threshold, and the eighth threshold is a positive number.
- the sixth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is the same as the pixel region in the binary block template j
- the binarized block template values are different; the binarized block template values of the class D pixel regions in the binarized block template i are the same as the coordinates in the binarized block template j
- the binarized block template values of the pixel area are the same.
- the set of wedge templates may be a wedge template table.
- the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are The K species Any two pairs of sample points in the sample point.
- the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least 1 sampling point.
- the template processing apparatus 1000 is used in a video encoding apparatus or a video decoding apparatus.
- the template processing apparatus 1000 acquires each of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M. After the corresponding binarized block template is obtained, the binarized block template corresponding to each sample point pair of the acquired K sample point pairs and the image block wedge template of size N*M are concentrated.
- Comparing the binarized block templates comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition,
- the binarized block template i is added to the wedge template set of the image block of size N*M, wherein the screening condition is selected by screening the candidate binarized block template
- the alternative binarized blocking template is added to the wedge template set of the image block of size N*M, whereas in the conventional technique, all the alternative binary values which are different from the binarized blocking template in the wedge template set are used.
- the split block templates are added to the wedge template set (this is also the prior art The main reason is that the number of binary templated templates in the wedge template is large.
- the above scheme is beneficial to reduce the number of binary templated templates added to the wedge template set of the image block of size N*M, which is beneficial to The number of binarized block templates in the wedge template set of the image block is reduced, which in turn helps to reduce the complexity of the video decoding device.
- a template processing apparatus 1100 may include:
- the processor 1102 and the memory 1103 are coupled by a bus 1101.
- the processor 1102 is configured to determine a current blocking template of a binarized blocking template of an image block of size N*M by calling a code or an instruction in the memory 1103; acquiring the current blocking template a binarized block template corresponding to each sample point pair of the K sample point pairs traversed, wherein K is a positive integer, the different sampling point pairs of the K sampling point pairs are different in starting point and/or the ending point, and the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y And the sampling point pair x and the sampling point pair y are any two sampling point pairs of the K sampling points; corresponding to each of the obtained K sampling point pairs
- the binarized block template is compared with the binarized block template in the set of wedge templates, wherein the set of wedge templates is the current set of wedge templates of the image block of size N*M; In the case where there is a difference between the block template i and the binarized block template j in the set of wedge templates, the binarized
- the set of wedge templates may be a wedge template table.
- the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two of the K sample points are sampled.
- the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least 1 sampling point.
- the template processing apparatus 1100 is used in a video encoding apparatus or in a video decoding apparatus.
- the template processing apparatus 1100 acquires each of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M. After the corresponding binarized block template is obtained, the binarized block template corresponding to each sample point pair of the acquired K sample point pairs and the image block wedge template of size N*M are concentrated. Comparing the binarized block templates; and comparing the difference between the binarized block template i and the binarized block template j in the wedge template set, the binarization is divided Block template i is added to the size as The wedge template of the N*M image block is concentrated.
- the sampling point pair x and the sampling point pair y are any two sampling point pairs among the K sampling points. That is to say, the above-mentioned K sampling point pairs are obtained by interval sampling, which is equivalent to not obtaining the binarization corresponding to each sampling point pair of all the sampling point pairs traversed by the current blocking template.
- the block template therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which is advantageous for reducing the addition to size N*M
- the number of binarized block templates of the wedge template set of the image block thereby facilitating the reduction of the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
- the embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium can store a program, and the program includes some or all of the steps of any one of the signal processing methods described in the foregoing method embodiments.
- the disclosed apparatus may be implemented in other ways.
- the device embodiments described above are merely illustrative.
- the division of the above units is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or integrated. Go to another system, or some features can be ignored or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
- the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, ie may be located in one place, or It can also be distributed to multiple network elements. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the above-described integrated unit if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium.
- the instructions include a plurality of instructions for causing a computer device (which may be a personal computer, server or network device, etc., and in particular a processor in a computer device) to perform all or part of the steps of the above-described methods of various embodiments of the present invention.
- the foregoing storage medium may include: a U disk, a mobile hard disk, a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), and the like. The medium of the code.
Landscapes
- Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Analysis (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
A method for template processing, and a related device, the method for template processing comprising: determining the current block template of a binarizing block template of an image block having the dimensions NxM; obtaining the binarizing block template corresponding to each sampling point pair among a number K of sampling point pairs traversed by the current block template; comparing the obtained binarizing block template corresponding to each sampling point pair among said number K of sampling point pairs to the binarizing block templates of a wedgelet template set, said wedgelet template set being the current wedgelet template set of the image block having the dimensions NxM; when the difference as revealed by the comparison between a binarizing block template i and a binarizing block template j of the wedgelet template set conforms to predetermined selection criteria, adding said binarizing block template i to said wedgelet template set. The technical solutions of the present invention favor reduction in the number of binarizing block templates in the wedgelet template set of an image block, thus reducing the complexity of video encoding and decoding equipment.
Description
本发明涉及视频编解码领域,具体涉及模板处理方法和相关设备。The present invention relates to the field of video coding and decoding, and in particular to a template processing method and related equipment.
目前,在视频编码和解码框架中,混合编码结构通常用于视频序列的编码和解码。Currently, in video coding and decoding frameworks, hybrid coding structures are commonly used for encoding and decoding video sequences.
混合编码结构的编码端通常包括预测、变换、量化和熵编码等。混合编码结构的解码端通常包括:熵解码、反量化、反变换和预测补偿等。在视频编码和解码框架中,视频序列中的图像通常划分成图像块来进行编码。一幅图像可被划分成若干图像块。The coding end of the hybrid coding structure typically includes prediction, transform, quantization, entropy coding, and the like. The decoding end of the hybrid coding structure generally includes: entropy decoding, inverse quantization, inverse transform, and prediction compensation. In video coding and decoding frameworks, images in a video sequence are typically divided into image blocks for encoding. An image can be divided into several image blocks.
目前预测技术通常包含帧内预测和帧间预测两种技术。帧内预测技术利用当前图像块的空间像素信息去除当前图像块的冗余信息以获得残差。帧间预测技术利用当前图像块邻近的已编码或已解码图像像素信息去除当前图像块的冗余信息以获得残差。在帧间预测技术里,用于帧间预测的当前图像块邻近的图像被称为参考图像。Current prediction techniques typically include both intra prediction and inter prediction techniques. The intra prediction technique uses the spatial pixel information of the current image block to remove redundant information of the current image block to obtain a residual. The inter prediction technique removes redundant information of the current image block using the encoded or decoded image pixel information adjacent to the current image block to obtain a residual. In the inter prediction technique, an image adjacent to a current image block for inter prediction is referred to as a reference image.
帧内预测或帧间预测均涉及块划分(block partitioning)技术,即可将一个图像块划分成多于一个的区域(partition),然后再以所述区域为单位进行帧内预测或帧间预测。其中,常用的块划分方式两种,一种是将一个方形图像块沿水平或垂直方向划分成两个矩形区域(rectangular partition),例如图1-a和图1-b举例所示,图1-a和图1-b所示举例中,方形图像块分别沿水平与垂直方向划分成两个矩形区域。此外,另一种块划分方式是可沿任意角度将一个方形图像块划分成两个非矩形区域(non-rectangular partition),具体可以例如图1-c举例所示。Both intra prediction and inter prediction involve a block partitioning technique, that is, an image block can be divided into more than one partition, and then intra prediction or inter prediction is performed in units of the regions. . Among them, the commonly used block division method is two, one is to divide a square image block into two rectangular regions (rectangular partition) in the horizontal or vertical direction, for example, as shown in FIG. 1-a and FIG. 1-b, FIG. 1 In the example of -a and Figure 1-b, the square image blocks are divided into two rectangular areas in the horizontal and vertical directions, respectively. In addition, another block division manner is that a square image block can be divided into two non-rectangular partitions at any angle, which can be exemplified by, for example, FIG. 1-c.
三维视频编解码涉及了深度图的编解码,其中,深度图可反映场景内物体到相机的距离,深度图具有与自然图像(例如纹理图像/彩色图像)完全不同的特性。首先,深度图由大部分的平坦区域和少部分的锐利边缘组成。其次是深度图的用途不是直接用来观看的,而是用作视点合成的辅助工具。传统编码工具在深度图像的平坦部分有很高的压缩效率,在锐利边缘区域会带来较大的
编码误差,直接导致合成的虚拟视点中有较大失真。为了在压缩平坦区域同时更好的保护边缘部分,深度图像建模模式(DMM,Depth Map Modeling mode)作为一种可选的帧内预测模式被引入到三维视频编解码框架中。The 3D video codec involves the encoding and decoding of the depth map, wherein the depth map can reflect the distance of the object in the scene to the camera, and the depth map has completely different characteristics from the natural image (for example, the texture image/color image). First, the depth map consists of most of the flat areas and a small number of sharp edges. Secondly, the purpose of the depth map is not directly for viewing, but as an auxiliary tool for viewpoint synthesis. Traditional coding tools have high compression efficiency in the flat portion of the depth image and a large margin in the sharp edge region.
The coding error directly leads to large distortion in the synthesized virtual view. In order to better protect the edge portion while compressing the flat region, Depth Map Modeling Mode (DMM) is introduced into the 3D video codec framework as an optional intra prediction mode.
三维视频编解码过程也可使用块划分技术。例如在三维视频的深度图的编解码技术中,楔形(wedgelet)划分是一种常用方法。其原理是图像块经块划分技术可划分成两个具有任意形状的区域之后,每个区域使用一个预测值进行编码和解码操作。对深度图进行编解码通常需要使用到楔形模板集,每种尺寸的图像块均需要对应的楔形模板集,每种尺寸的图像块的楔形模板集中可包括多个二值化分块模板。The block division technique can also be used for the 3D video codec process. For example, in the codec technology of depth maps of three-dimensional video, wedgelet division is a common method. The principle is that an image block can be divided into two regions having an arbitrary shape by a block division technique, and each region uses a prediction value for encoding and decoding operations. Encoding and decoding a depth map usually requires the use of a wedge template set. Each size image block requires a corresponding wedge template set, and the wedge template set of each size image block may include multiple binarized block templates.
现有技术中,每种尺寸的图像块的楔形模板集中通常包括极其大量的二值化分块模板,例如尺寸为4x4的图像块的楔形模板集中通常包括86个二值化分块模板,又例如尺寸为8x8的图像块的楔形模板集中通常包括766个二值化分块模板,尺寸为16x16的图像块的楔形模板集中通常包括1350个二值化分块模板。然而,研究和实践过程中发现,一种尺寸的图像块的楔形模板集中包括大量二值化分块模板将增加视频编解码设备的复杂度。举例来说,楔形模板集中的二值化分块模板数量较多就会占用较多的存储空间进而会增加编解码设备的负担。In the prior art, a wedge template set of image blocks of each size usually includes an extremely large number of binarized block templates, for example, a wedge template set of a size block of 4×4 usually includes 86 binarized block templates, and For example, a wedge template set of an image block of size 8x8 typically includes 766 binarized block templates, and a set of wedge templates of a size block of 16x16 typically includes 1350 binarized block templates. However, it has been found in research and practice that the inclusion of a large number of binarized block templates in a wedge template set of image blocks of one size will increase the complexity of the video codec device. For example, if the number of binarized block templates in the wedge template set is large, it will occupy more storage space and thus increase the burden on the codec device.
发明内容Summary of the invention
本发明实施例提供模板处理方法和相关设备,以期缩减图像块的楔形模板集中的二值化分块模板数量,进而降低视频编解码设备的复杂度。The embodiment of the invention provides a template processing method and related equipment, so as to reduce the number of binary templated blocks in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
本发明实施例第一方面提供一种模板处理方法,包括:A first aspect of the embodiments of the present invention provides a template processing method, including:
确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;Determining a current blocking template of the binarized blocking template of the image block of size N*M;
获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;Obtaining a binarized blocking template corresponding to each of the pair of sampling points of the K sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K sampling points are in a pair Different sampling points have different start points and/or different end points;
将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;
Comparing the obtained binarized block template of each of the pair of sample points of the obtained K pairs of sampling points with the binarized block template of the wedge template set, wherein the wedge template set is a current set of wedge templates of image blocks of size N*M;
在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。Comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition, adding the binarized block template i to The wedge template is set, wherein the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, and the binarized block The template j is any binarized blocking template in the set of wedge templates, wherein the N and the M are positive integers.
结合第一方面,在第一方面的第一种可能的实施方式中,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:With reference to the first aspect, in a first possible implementation manner of the first aspect, the difference between the binarized block template i and the binary block template j in the wedge template set is in accordance with a preset Filtering conditions include:
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where The binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Differentiating; the binarized block template value of the class B pixel in the binarized block template i and the binarized block of the same pixel in the binarized block template j The template values are the same;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of class A pixels in the pixel of the binarized block template i is greater than or equal to a first threshold, and the number of class B pixels in the bins in the binarized block template i is greater than Or equal to a second threshold, wherein the second threshold is a positive integer, the binarized block template value of the class A pixel in the binarized block template i and the binarized block template j The value of the binarized block template value of the pixel having the same coordinate is different; the binarized block template value of the class B pixel in the binarized block template i and the binarized block The binarized block template values of the same pixel points in the template j are the same;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值
化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the type A pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the number of the class B pixels in the pixel in the binarized block template i accounts for The ratio of the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the second threshold is a positive number; and the type A pixel of the binarized block template i The binarized block template value is different from the binarized block template value of the pixel having the same coordinate in the binarized block template j; the binary value
The binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization There is a class B pixel in the pixel in the block template i, wherein the fourth threshold is a positive number, wherein the binarized block template of the class A pixel in the binarized block template i The value is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarization of the class B pixel in the binarized block template i The block template value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The number of class B pixels in the pixel in the block template i is greater than or equal to a second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and the binarized block The binarized block template value of the class A pixel in the template i is different from the binarized block template value of the pixel having the same coordinate in the binarized block template j; the binarization The binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The ratio of the number of class B pixel points in the pixel in the block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number Wherein the second threshold is a positive number, the binarized block template value of the class A pixel in the binarized block template i and the coordinate in the binarized block template j The binarized block template values of the same pixel are different; the binarized block template value of the class B pixel in the binarized block template i and the binary in the binarized block template j The binarized block template values of the same coordinates are the same;
或者
Or
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i, The binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j The binarized block template values of the pixel regions having the same coordinates are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarized block The binarized block template value of the same pixel region in the template j is the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i The binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i The binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板
i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization There is a D-type pixel region in the pixel region in the block template i, wherein the eighth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are different; the binarized block template
The binarized block template value of the D-type pixel region in i is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The number of the D-type pixel regions in the pixel region in the block template i is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, the binarized block template i The binarized block template value of the C-type pixel region is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the binarized block The binarized block template value of the D-type pixel region in the template i is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The ratio of the number of the D-type pixel regions in the pixel region in the block template i to the total amount of the pixel regions of the binarized block template i is greater than or equal to a seventh threshold, and the eighth threshold is a positive number. The sixth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is the same as the pixel region in the binary block template j The binarized block template values are different; the binarized block template values of the class D pixel regions in the binarized block template i are the same as the coordinates in the binarized block template j The binarized block template values of the pixel area are the same.
结合第一方面或第一方面的第一种可能的实施方式,在第一方面的第二种可能的实施方式中,所述楔形模板集为楔形模板表。In conjunction with the first aspect or the first possible implementation of the first aspect, in a second possible implementation of the first aspect, the set of wedge templates is a wedge template table.
结合第一方面或第一方面的第一种可能的实施方式或第一方面的第二种可能的实施方式,在第一方面的第三种可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。In conjunction with the first aspect or the first possible implementation of the first aspect or the second possible implementation of the first aspect, in a third possible implementation of the first aspect, the sampling point is comprised of x The starting point and the sampling point are not adjacent to the starting point included in y, and the sampling point pair x and the sampling point pair y are any two sampling point pairs of the K kinds of sampling points.
结合第一方面的第三种可能的实施方式,在第一方面的第四种可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少
1个采样点。With reference to the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the starting point of the sampling point pair x and the starting point of the sampling point pair y are at least spaced apart
1 sample point.
结合第一方面或第一方面的第一种可能的实施方式或第一方面的第二种可能的实施方式或第一方面的第三种可能的实施方式或第一方面的第四种可能的实施方式,在第一方面的第五种可能的实施方式中,所述模板处理方法用于视频编码过程中或视频解码过程中。Combining the first aspect or the first possible implementation of the first aspect or the second possible implementation of the first aspect or the third possible implementation of the first aspect or the fourth possible implementation of the first aspect Embodiments, in a fifth possible implementation manner of the first aspect, the template processing method is used in a video encoding process or a video decoding process.
本发明实施例第二方面提供一种模板处理方法,包括:A second aspect of the embodiments of the present invention provides a template processing method, including:
确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;Determining a current blocking template of the binarized blocking template of the image block of size N*M;
获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;Obtaining a binarized blocking template corresponding to each of the pair of sampling points of the K sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K sampling points are in a pair Different sampling points are different for the included starting point and/or the ending point, and the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two pairs of sampling points of the K sampling points;
将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;Comparing the obtained binarized block template of each of the pair of sample points of the obtained K pairs of sampling points with the binarized block template of the wedge template set, wherein the wedge template set is a current set of wedge templates of image blocks of size N*M;
在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。In a case where there is a difference between the binarized block template i and the binarized block template j in the wedge template set, the binarized block template i is added to the wedge template set. The binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, wherein the binarized block template j is the wedge shape Any of the binarized block templates in the set of templates, wherein the N and the M are positive integers.
结合第二方面,在第二方面的第一种可能的实施方式中,所述楔形模板集为楔形模板表。In conjunction with the second aspect, in a first possible implementation of the second aspect, the set of wedge templates is a wedge template table.
结合第二方面或者第二方面的第一种可能的实施方式,在第二方面的第二种可能的实施方式中,In conjunction with the second aspect or the first possible implementation of the second aspect, in a second possible implementation of the second aspect,
采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。The starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are any two sampling point pairs of the K kinds of sampling points.
结合第二方面的第二种可能的实施方式,在第二方面的第三种可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少
1个采样点。With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the starting point of the sampling point pair x and the starting point of the sampling point pair y are at least spaced apart
1 sample point.
结合第二方面或第二方面的第一种可能的实施方式或第二方面的第二种可能的实施方式或第二方面的第三种可能的实施方式,在第二方面的第四种可能的实施方式中,With reference to the second aspect or the first possible implementation of the second aspect or the second possible implementation of the second aspect or the third possible implementation of the second aspect, the fourth possibility in the second aspect In the embodiment,
所述模板处理方法用于视频编码过程中或视频解码过程中。The template processing method is used in a video encoding process or a video decoding process.
本发明实施例第三方面提供一种模板处理装置,包括:A third aspect of the embodiments of the present invention provides a template processing apparatus, including:
确定单元,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;a determining unit, configured to determine a current blocking template of the binarized blocking template of the image block of size N*M;
获取单元,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;An obtaining unit, configured to acquire a binarized blocking template corresponding to each of the pair of sampling points of the K sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K species Different sampling points in the pair of sampling points have different starting points and/or different ending points;
比较单元,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;a comparison unit, configured to compare the binarized block template corresponding to each sample point pair of the acquired K sample point pairs with the binarized block template in the wedge template set, wherein the wedge shape The template set is a current set of wedge templates of the image block of size N*M;
添加单元,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。Adding a unit, configured to compare the difference between the binarized block template i and the binary block template j in the wedge template set according to a preset screening condition, and divide the binarization a block template i is added to the set of wedge templates, wherein the binarized block template i is a binarized block template corresponding to any one of the K pairs of sample points, wherein The binarized block template j is any binarized block template in the set of wedge templates, wherein the N and the M are positive integers.
结合第三方面,在第三方面的第一种可能的实施方式中,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:With reference to the third aspect, in a first possible implementation manner of the third aspect, the difference between the binarized block template i and the binary block template j in the wedge template set is consistent with a preset Filtering conditions include:
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像
素点的二值化分块模板值相同;The number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where The binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Different; the binarized block template value of the class B pixel in the binarized block template i is the same as the coordinate in the binarized block template j
The binarized block template values of the prime points are the same;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of class A pixels in the pixel of the binarized block template i is greater than or equal to a first threshold, and the number of class B pixels in the bins in the binarized block template i is greater than Or equal to a second threshold, wherein the second threshold is a positive integer, the binarized block template value of the class A pixel in the binarized block template i and the binarized block template j The value of the binarized block template value of the pixel having the same coordinate is different; the binarized block template value of the class B pixel in the binarized block template i and the binarized block The binarized block template values of the same pixel points in the template j are the same;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the type A pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the number of the class B pixels in the pixel in the binarized block template i accounts for The ratio of the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the second threshold is a positive number; and the type A pixel of the binarized block template i The binarized block template value is different from the binarized block template value of the same pixel in the binarized block template j; the class B pixel in the binarized block template i The binarized block template value of the point is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization There is a class B pixel in the pixel in the block template i, wherein the fourth threshold is a positive number, wherein the binarized block template of the class A pixel in the binarized block template i The value is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarization of the class B pixel in the binarized block template i The block template value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中
的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization Blocking template i
The number of class B pixels in the pixel is greater than or equal to a second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and A in the binarized block template i The binarized block template value of the pixel-like point is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarized block template i The binarized block template value of the class B pixel is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The ratio of the number of class B pixel points in the pixel in the block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number Wherein the second threshold is a positive number, the binarized block template value of the class A pixel in the binarized block template i and the coordinate in the binarized block template j The binarized block template values of the same pixel are different; the binarized block template value of the class B pixel in the binarized block template i and the binary in the binarized block template j The binarized block template values of the same coordinates are the same;
或者or
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i, The binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域
的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j The binarized block template values of the pixel regions having the same coordinates are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarized block The pixel area in template j with the same coordinates
The binarized block template values are the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i The binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i The binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization There is a D-type pixel region in the pixel region in the block template i, wherein the eighth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are different; the binarized block templates of the D-type pixel regions in the binarized block template i The value is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The number of the D-type pixel regions in the pixel region in the block template i is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, the binarized block template i The binarized block template value of the C-type pixel region is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the binarized block The binarized block template value of the D-type pixel region in the template i is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化
分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。The number of C-type pixel regions in the pixel region of the binarized block template i occupies the binarization
The ratio of the total number of pixel regions of the block template i is greater than or equal to an eighth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i occupies the binarized block template i The ratio of the total number of pixel regions is greater than or equal to a seventh threshold, the eighth threshold is a positive number, the sixth threshold is a positive number, and the binary value of the C-type pixel region in the binarized block template i The binning template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the D-type pixel region in the binarized block template i The binarized block template value is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j.
结合第三方面或第三方面的第一种可能的实施方式,在第三方面的第二种可能的实施方式中,所述楔形模板集为楔形模板表。In conjunction with the third aspect or the first possible implementation of the third aspect, in the second possible implementation of the third aspect, the set of wedge templates is a wedge template table.
结合第三方面或第三方面的第一种可能的实施方式或第三方面的第二种可能的实施方式,在第三方面的第三种可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。With reference to the third aspect or the first possible implementation manner of the third aspect or the second possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect, the sampling point is included in the x The starting point and the sampling point are not adjacent to the starting point included in y, and the sampling point pair x and the sampling point pair y are any two sampling point pairs of the K kinds of sampling points.
结合第三方面的第三种可能的实施方式,在第三方面的第四种可能的实施方式中,In conjunction with the third possible implementation of the third aspect, in a fourth possible implementation of the third aspect,
所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。The starting point included in the sampling point pair x and the starting point included in the sampling point pair y are separated by at least one sampling point.
结合第三方面或第三方面的第一种可能的实施方式或第三方面的第二种可能的实施方式或第三方面的第三种可能的实施方式或第三方面的第四种可能的实施方式,在第三方面的第五种可能的实施方式中,所述模板处理装置用于视频编码装置中或视频解码装置中。Combining the third aspect or the first possible implementation of the third aspect or the second possible implementation of the third aspect or the third possible implementation of the third aspect or the fourth possible aspect of the third aspect Embodiments, in a fifth possible implementation manner of the third aspect, the template processing apparatus is used in a video encoding apparatus or a video decoding apparatus.
本发明实施例第四方面提供一种模板处理装置,包括:A fourth aspect of the embodiments of the present invention provides a template processing apparatus, including:
确定单元,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。A determining unit for determining a current blocking template of the binarized blocking template of the image block of size N*M.
获取单元,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K
种采样点中的任意两种采样点对;An obtaining unit, configured to acquire a binarized blocking template corresponding to each of the pair of sampling points of the K sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K species Different sampling points in the pair of sampling points have different start points and/or end points, and the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, the sampling point pair x and the Sample point pair y is the K
Any two pairs of sampling points in the sampling point;
比较单元,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;a comparison unit, configured to compare the binarized block template corresponding to each sample point pair of the acquired K sample point pairs with the binarized block template in the wedge template set, wherein the wedge shape The template set is a current set of wedge templates of the image block of size N*M;
添加单元,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。Adding a unit, if the difference between the binarized block template i and the binarized block template j in the wedge template set is compared, the binarized block template i is added to the a set of wedge templates, wherein the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, wherein the binarized block template j is any binarized blocking template in the set of wedge templates, and the N and the M are positive integers.
结合第四方面,在第四方面的第一种可能的实施方式中,所述楔形模板集为楔形模板表。In conjunction with the fourth aspect, in a first possible implementation of the fourth aspect, the set of wedge templates is a wedge template table.
结合第四方面或者第四方面的第一种可能的实施方式,在第四方面的第二种可能的实施方式中,With reference to the fourth aspect or the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect,
采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。The starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are any two sampling point pairs of the K kinds of sampling points.
结合第四方面的第二种可能的实施方式,在第四方面的第三种可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。With reference to the second possible implementation manner of the fourth aspect, in a third possible implementation manner of the fourth aspect, the starting point of the sampling point pair x and the starting point of the sampling point pair y are at least spaced apart 1 sample point.
结合第四方面或第四方面的第一种可能的实施方式或第四方面的第二种可能的实施方式或第四方面的第三种可能的实施方式,在第四方面的第四种可能的实施方式中,In combination with the fourth aspect or the first possible implementation of the fourth aspect or the second possible implementation of the fourth aspect or the third possible implementation of the fourth aspect, the fourth possibility in the fourth aspect In the embodiment,
所述模板处理装置用于视频编码装置中或视频解码装置中。The template processing device is used in a video encoding device or in a video decoding device.
本发明实施例第五方面提供一种模板处理装置,包括:A fifth aspect of the embodiments of the present invention provides a template processing apparatus, including:
处理器和存储器;Processor and memory;
其中,所述处理器通过调用所述存储器中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点
不同;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。The processor is configured to determine a current blocking template of a binarized blocking template of an image block of size N*M by calling a code or an instruction in the memory; acquiring the current blocking template a binarized blocking template corresponding to each of the pair of sampling point pairs traversed, wherein the K is a positive integer, and the starting point of the different sampling point pairs of the K sampling point pairs Different and / or end points
Differentiating; comparing the obtained binarized block template of each of the K sample point pairs to the binarized block template of the wedge template set, wherein the wedge template set is The current wedge template set of the image block of size N*M; comparing the difference between the binarized block template i and the binarized block template j of the wedge template set according to a preset screening condition In the case of the method, the binarized block template i is added to the wedge template set, wherein the binarized block template i is any one of the K sample point pairs. Corresponding binarized block template, wherein the binarized block template j is any binarized block template in the set of wedge templates, wherein the N and the M are positive integers.
结合第五方面,在第五方面的第一种可能的实施方式中,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:With reference to the fifth aspect, in a first possible implementation manner of the fifth aspect, the difference between the binarized block template i and the binarized block template j in the wedge template set is in accordance with a preset Filtering conditions include:
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where The binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Differentiating; the binarized block template value of the class B pixel in the binarized block template i and the binarized block of the same pixel in the binarized block template j The template values are the same;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of class A pixels in the pixel of the binarized block template i is greater than or equal to a first threshold, and the number of class B pixels in the bins in the binarized block template i is greater than Or equal to a second threshold, wherein the second threshold is a positive integer, the binarized block template value of the class A pixel in the binarized block template i and the binarized block template j The value of the binarized block template value of the pixel having the same coordinate is different; the binarized block template value of the class B pixel in the binarized block template i and the binarized block The binarized block template values of the same pixel points in the template j are the same;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化
分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the type A pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the number of the class B pixels in the pixel in the binarized block template i accounts for Binarization
The ratio of the total number of pixel points of the block template i is greater than or equal to a third threshold, wherein the second threshold is a positive number; the binarized block of the class A pixel in the binarized block template i The template value is different from the binarized block template value of the same pixel in the binarized block template j; binarization of the class B pixel in the binarized block template i The block template value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization There is a class B pixel in the pixel in the block template i, wherein the fourth threshold is a positive number, wherein the binarized block template of the class A pixel in the binarized block template i The value is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarization of the class B pixel in the binarized block template i The block template value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The number of class B pixels in the pixel in the block template i is greater than or equal to a second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and the binarized block The binarized block template value of the class A pixel in the template i is different from the binarized block template value of the pixel having the same coordinate in the binarized block template j; the binarization The binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化
分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The ratio of the number of class B pixel points in the pixel in the block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number Wherein the second threshold is a positive number, the binarized block template value of the class A pixel in the binarized block template i and the coordinate in the binarized block template j The binarized block template values of the same pixel are different; the binarization
The binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者or
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i, The binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j The binarized block template values of the pixel regions having the same coordinates are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarized block The binarized block template value of the same pixel region in the template j is the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i The binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i The binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块
模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization Block
There is a D-type pixel region in the pixel region in the template i, wherein the eighth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are different; the binarized block template values of the D-type pixel regions in the binarized block template i are The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The number of the D-type pixel regions in the pixel region in the block template i is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, the binarized block template i The binarized block template value of the C-type pixel region is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the binarized block The binarized block template value of the D-type pixel region in the template i is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The ratio of the number of the D-type pixel regions in the pixel region in the block template i to the total amount of the pixel regions of the binarized block template i is greater than or equal to a seventh threshold, and the eighth threshold is a positive number. The sixth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is the same as the pixel region in the binary block template j The binarized block template values are different; the binarized block template values of the class D pixel regions in the binarized block template i are the same as the coordinates in the binarized block template j The binarized block template values of the pixel area are the same.
结合第五方面或第五方面的第一种可能的实施方式,在第五方面的第二种可能的实施方式中,所述楔形模板集可为楔形模板表。In conjunction with the fifth aspect or the first possible implementation manner of the fifth aspect, in the second possible implementation manner of the fifth aspect, the wedge template set may be a wedge template table.
结合第五方面或第五方面的第一种可能的实施方式或第五方面的第二种可能的实施方式,在第五方面的第三种可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为
所述K种采样点中的任意两种采样点对。With reference to the fifth aspect or the first possible implementation manner of the fifth aspect or the second possible implementation manner of the fifth aspect, in a third possible implementation manner of the fifth aspect, the sampling point is included in the x The starting point and the sampling point are not adjacent to the starting point included in y, and the sampling point pair x and the sampling point pair y are
Any two of the K sample points are sampled.
结合第五方面的第三种可能的实施方式,在第五方面的第四种可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。With reference to the third possible implementation manner of the fifth aspect, in a fourth possible implementation manner of the fifth aspect, the starting point of the sampling point pair x and the starting point of the sampling point pair y are at least spaced apart 1 sample point.
结合第五方面或第五方面的第一种可能的实施方式或第五方面的第二种可能的实施方式或第五方面的第三种可能的实施方式或第五方面的第四种可能的实施方式,在第五方面的第五种可能的实施方式中,所述模板处理装置用于视频编码装置中或视频解码装置中。Combining the fifth aspect or the first possible implementation of the fifth aspect or the second possible implementation of the fifth aspect or the third possible implementation of the fifth aspect or the fourth possible aspect of the fifth aspect Embodiments, in a fifth possible implementation manner of the fifth aspect, the template processing apparatus is used in a video encoding apparatus or a video decoding apparatus.
本发明实施例第六方面提供一种模板处理装置,包括:A sixth aspect of the embodiments of the present invention provides a template processing apparatus, including:
处理器和存储器;Processor and memory;
其中,所述处理器通过调用所述存储器中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。The processor is configured to determine a current blocking template of a binarized blocking template of an image block of size N*M by calling a code or an instruction in the memory; acquiring the current blocking template a binarized blocking template corresponding to each of the pair of sampling point pairs traversed, wherein the K is a positive integer, and the starting point of the different sampling point pairs of the K sampling point pairs The difference between the sampling point pair x and the starting point of the sampling point pair y are not adjacent, and the sampling point pair x and the sampling point pair y are in the K sampling points. Comparing any two pairs of sampling points; comparing the obtained binarized blocking template of each pair of sampling points of the pair of sampling points with the binary template of the wedge template set, wherein The set of wedge templates is the current set of wedge templates of the image block of size N*M; there is a difference between comparing the binarized block template i with the binarized block template j of the wedge template set. In the case, the binarized block template i is added to the wedge template set The binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, wherein the binarized block template j is the Any of the binarized block templates in the set of wedge templates, wherein N and M are positive integers.
结合第六方面,在第六方面的第一种可能的实施方式中,所述楔形模板集为楔形模板表。In conjunction with the sixth aspect, in a first possible implementation of the sixth aspect, the set of wedge templates is a wedge template table.
结合第六方面或者第六方面的第一种可能的实施方式,在第六方面的第二种可能的实施方式中,With reference to the sixth aspect or the first possible implementation manner of the sixth aspect, in a second possible implementation manner of the sixth aspect,
采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对
x和所述采样点对y为所述K种采样点中的任意两种采样点对。The starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, the sampling point pair
x and the sample point pair y are any two sample point pairs of the K sample points.
结合第六方面的第二种可能的实施方式,在第六方面的第三种可能的实施方式中,In conjunction with the second possible implementation of the sixth aspect, in a third possible implementation manner of the sixth aspect,
所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。The starting point included in the sampling point pair x and the starting point included in the sampling point pair y are separated by at least one sampling point.
结合第六方面或第六方面的第一种可能的实施方式或第六方面的第二种可能的实施方式或第六方面的第三种可能的实施方式,在第六方面的第四种可能的实施方式中,所述模板处理装置用于视频编码装置中或视频解码装置中。With reference to the sixth aspect or the first possible implementation of the sixth aspect or the second possible implementation of the sixth aspect or the third possible implementation of the sixth aspect, the fourth possibility in the sixth aspect In an embodiment, the template processing device is used in a video encoding device or in a video decoding device.
可以看出,本发明一些实施例的技术方案中,获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集,可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。It can be seen that, in the technical solution of some embodiments of the present invention, each sample point pair of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M is obtained. After the corresponding binarized block template, the binarized block template corresponding to each sample point pair of the obtained K sample point pairs and the image block wedge template of size N*M are collected. Comparing the binarized block templates for comparison; if comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition, the A binarized block template i is added to the wedge template set of the image block of size N*M, wherein the screening condition is selected to filter the candidate binarized block template, which will meet the screening conditions. The alternative binarized block template is added to the wedge template set of image blocks of size N*M, whereas in the prior art all alternative binarizations that differ from the binarized block templates in the wedge template set are present. The block templates are added to the wedge template set, which can be seen in the above scheme. Conducive to reducing the number of binarized block templates added to the wedge template set of the image block of size N*M, thereby reducing the number of binarized block templates in the wedge template set of the image block, thereby facilitating the video reduction The complexity of the codec device.
为了更清楚地说明本发明实施例技术方案,下面将对实施例和现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments and the prior art description will be briefly described below. Obviously, the drawings in the following description are only some implementations of the present invention. For example, other drawings may be obtained from those of ordinary skill in the art based on these drawings without any inventive labor.
图1-a~图1-c为本发明实施例提供的几种图像块的划分示意图;FIG. 1 is a schematic diagram showing the division of several image blocks according to an embodiment of the present invention;
图2-a为本发明实施例提供的一种模板处理方法的流程示意图;
FIG. 2 is a schematic flowchart of a template processing method according to an embodiment of the present disclosure;
图2-b为本发明实施例提供的一种模板比较示意图;FIG. 2 is a schematic diagram of a template comparison according to an embodiment of the present invention;
图3为本发明实施例提供的另一种模板处理方法的流程示意图;FIG. 3 is a schematic flowchart diagram of another template processing method according to an embodiment of the present disclosure;
图4为本发明实施例提供的另一种模板处理方法的流程示意图;FIG. 4 is a schematic flowchart diagram of another template processing method according to an embodiment of the present disclosure;
图5为本发明实施例提供的另一种模板处理方法的流程示意图;FIG. 5 is a schematic flowchart diagram of another template processing method according to an embodiment of the present disclosure;
图6-a为本发明实施例提供的另一种模板处理方法的流程示意图;6-a is a schematic flowchart of another template processing method according to an embodiment of the present invention;
图6-b~图6-g为本发明实施例提供的几种模板采样起点和终点的分布边界的示意图;FIG. 6-b to FIG. 6-g are schematic diagrams showing distribution boundaries of sampling start points and end points of several templates according to an embodiment of the present invention;
图6-h为本发明实施例提供的一种起点间隔采样的示意图;6-h is a schematic diagram of a start interval sampling according to an embodiment of the present invention;
图7为本发明实施例提供的另一种模板处理方法的流程示意图;FIG. 7 is a schematic flowchart diagram of another template processing method according to an embodiment of the present disclosure;
图8为本发明实施例提供的一种模板处理装置的示意图;FIG. 8 is a schematic diagram of a template processing apparatus according to an embodiment of the present disclosure;
图9为本发明实施例提供的另一种模板处理装置的示意图;FIG. 9 is a schematic diagram of another template processing apparatus according to an embodiment of the present disclosure;
图10为本发明实施例提供的另一种模板处理装置的示意图;FIG. 10 is a schematic diagram of another template processing apparatus according to an embodiment of the present disclosure;
图11为本发明实施例提供的另一种模板处理装置的示意图。FIG. 11 is a schematic diagram of another template processing apparatus according to an embodiment of the present invention.
本发明实施例提供模板处理方法和相关设备,以期缩减图像块的楔形模板集中的二值化分块模板数量,进而降低视频编解码设备的复杂度。The embodiment of the invention provides a template processing method and related equipment, so as to reduce the number of binary templated blocks in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
为使得本发明的发明目的、特征、优点能够更加的明显和易懂,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,下面所描述的实施例仅仅是本发明的一部分实施例,而非全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the object, the features and the advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包括。例如包括了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third" and "fourth" and the like in the specification and claims of the present invention and the above drawings are used to distinguish different objects, and are not intended to describe a specific order. Moreover, the terms "comprises" and "comprising" and "comprising" are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that comprises a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units not listed, or, optionally, Other steps or units inherent to these processes, methods, products or equipment.
本发明模板处理方法的一个实施例。一种模板处理方法可包括:确定尺寸
为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。One embodiment of the template processing method of the present invention. A template processing method may include: determining a size
a current block template of the binarized block template of the N*M image block; and a binarized block corresponding to each of the K sample point pairs traversed by the current block template a template, wherein the K is a positive integer, the different sampling point pairs of the K sampling point pairs are different in starting point and/or the ending point; each of the obtained K sampling point pairs is sampled Comparing the corresponding binarized block template with the binarized block template of the wedge template set, wherein the set of wedge templates is the current set of wedge templates of the image block of size N*M; Comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition, adding the binarized block template i to the a set of wedge templates, wherein the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, and the binarized block template j is any binarized blocking template in the set of wedge templates, wherein the N and Said M is a positive integer.
首先参见图2-a,图2-a为本发明的一个实施例提供的一种模板处理方法的流程示意图。其中,如图2-a所示,本发明的一个实施例提供的一种模板处理方法可以包括:Referring first to FIG. 2-a, FIG. 2-a is a schematic flowchart diagram of a template processing method according to an embodiment of the present invention. As shown in FIG. 2-a, a template processing method provided by an embodiment of the present invention may include:
201、确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。201. Determine a current blocking template of the binarized blocking template of the image block of size N*M.
其中,所述N和所述M为正整数。Wherein N and the M are positive integers.
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。Wherein, the N may be equal to or not equal to M, for example, the N may be greater than or less than the M.
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。Optionally, in some possible implementation manners of the present invention, the N may be equal to a positive integer power of 2. The N may, for example, also be equal to a positive integer power of two.
例如所述N可等于2、4、8、16、30、64或其他值。For example, the N can be equal to 2, 4, 8, 16, 30, 64 or other values.
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。For example, an image block of size N*M can be, for example, an image block of size 2*2, an image block of size 4*4, an image block of size 8*8, and an image block of size 16*16. An image block of size 32*32 or an image block of size 64*64, an image block of size 8*16, an image block of size 32*16 or an image block of other sizes.
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。Wherein, the image block mentioned in each embodiment of the present invention may refer to an image block of a depth map or an image block of other types of images. For example, the image block of the above size N*M may be an image block of size N*M of the depth map.
其中,不同尺寸的图像块和不同二值化分块模板的当前分块模板之间具有
映射关系,因此基于图像块的尺寸,可确定与之对应的二值化分块模板的当前分块模板。Wherein, between the image blocks of different sizes and the current block templates of different binarized block templates
The relationship is mapped, so based on the size of the image block, the current block template of the binarized block template corresponding thereto can be determined.
202、获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板。其中,所述K为正整数。所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同。202. Acquire a binarized block template corresponding to each sample point pair of the K sample point pairs traversed by the current block template. Wherein K is a positive integer. The different sampling point pairs of the K sampling point pairs are different in starting point and/or ending point.
其中,所述K种采样点对例如可为所述当前分块模板所能遍历的部分或全部采样点对。The K sample point pairs may be, for example, some or all of the sample point pairs that the current block template can traverse.
例如所述K可等于1、2、3、4、10、15、30、50、65或其他值。For example, the K can be equal to 1, 2, 3, 4, 10, 15, 30, 50, 65 or other values.
203、将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较。其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集。203. Compare the binarized block template corresponding to each sample point pair of the obtained K sample point pairs with the binary block template of the wedge template set. The set of wedge templates is a current set of wedge templates of the image block of size N*M.
204、在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中。其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板。所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板。204. When comparing the difference between the binarized block template i and the binary block template j in the wedge template set according to a preset screening condition, the binarized block template i is Add to the wedge template set. The binarized block template i is a binarized block template corresponding to any one of the K sample point pairs. The binarized block template j is any binarized block template in the set of wedge templates.
其中,由于所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,因此换句话说,对于所述K种采样点对中的每一种采样点对所对应的二值化分块模板,均可将其与所述尺寸为N*M的图像块的当前楔形模板集中的各个二值化分块模板进行比较,在其与所述尺寸为N*M的图像块的当前楔形模板集中的任意一个二值化分块模板之间的差异均符合预设的筛选条件的情况下,便可将其添加到尺寸为N*M的图像块的当前楔形模板集中。可以理解,随着二值化分块模板的逐步添加,尺寸为N*M的图像块的当前楔形模板集中的二值化分块模板的数量将逐步增加。Wherein, the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, and in other words, for the K sample points The binarized block template corresponding to each sample point pair of the pair can be compared with each binarized block template in the current wedge template set of the image block of size N*M. If the difference between any of the binarized block templates in the current wedge template set of the image block of size N*M conforms to the preset filter condition, it can be added to the size The current wedge template set of N*M image blocks. It can be understood that with the gradual addition of the binarized block template, the number of binarized block templates in the current wedge template set of the image block of size N*M will gradually increase.
可以理解,在本发明的各实施例中,尺寸为N*M的图像块的楔形模板集中的各二值化分块模板对应的尺寸为N*M。It can be understood that, in various embodiments of the present invention, each of the binarized block templates in the wedge template set of the image block of size N*M corresponds to a size of N*M.
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸
为N*M的图像块进行预测。Wherein, the set of wedge templates of the image block of size N*M can be used for prediction of image blocks of size N*M, and the like. For example, it is also possible to use a wedge template set pair size of an image block of size N*M
Predicting for N*M image blocks.
可以看出,本实施例方案中,获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集(这也是现有技术导致楔形模板集中二值化分块模板数量巨大的主要原因),可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。It can be seen that, in the solution of this embodiment, the corresponding two pairs of each of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M are obtained. After the block template is obtained, the binarized segmentation template corresponding to each of the K sample point pairs and the binary segment of the image block wedge template set of size N*M are obtained. Comparing the block templates; comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition, the binarization is performed A block template i is added to the wedge template set of the image block of size N*M, wherein the screening condition is selected to filter the candidate binarized block template, and the second candidate that meets the screening condition will be selected. The valued block template is added to the wedge template set of the image block of size N*M, whereas in the prior art, all the alternative binarized block templates which differ from the binarized block template in the wedge template set are Add to the wedge template set (this is also the prior art leading to the wedge template set The main reason for the huge number of binarized block templates is that the above scheme is advantageous for reducing the number of binarized block templates added to the wedge template set of image blocks of size N*M, thereby facilitating the reduction of image blocks. The number of binarized block templates in the wedge template set is beneficial to reduce the complexity of the video codec device.
其中,预设的筛选条件可以根据需要来灵活设定,预设的筛选条件可能是多种多样的。Among them, the preset screening conditions can be flexibly set according to needs, and the preset screening conditions may be various.
例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同。For example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: pixels of the binarized block template i The number of the type A pixel points in the point is greater than or equal to the first threshold, and the type B pixel point exists in the pixel in the binarized blocking template i, wherein the binarized blocking template i The binarized block template value of the class A pixel is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarized block template i The binarized block template value of the class B pixel in the same is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j.
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,所述第二阈值为正整数,所述
二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: the binarized block template i The number of class A pixel points in the pixel is greater than or equal to a first threshold, and the number of class B pixels in the pixel in the binarized segment template i is greater than or equal to a second threshold, the second The threshold is a positive integer, the
The binarized block template value of the class A pixel in the binarized block template i is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; The binarized block template value of the class B pixel in the binarized block template i and the binarized block template value of the pixel with the same coordinate in the binarized block template j the same;
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同。For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: the binarized block template i The number of the class A pixel points in the pixel is greater than or equal to the first threshold, and the number of the class B pixels in the pixel in the binarized segment template i occupies the binarized block template i The ratio of the total number of pixel points is greater than or equal to a third threshold, wherein the second threshold is a positive number; the binarized block template value of the class A pixel in the binarized block template i is The binarized block template values of the same pixel points in the binarized block template j are different; the binarized block template values of the class B pixels in the binarized block template i are The binarized block template values of the same pixel points in the binarized block template j are the same.
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: the binarized block template i The ratio of the number of class A pixel points in the pixel to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the pixel in the binarized block template i exists a class B pixel, wherein the fourth threshold is a positive number, wherein the binarized block template value of the class A pixel in the binarized block template i and the binarized block template The binarized block template values of the same pixel points in j are different; the binarized block template values of the class B pixels in the binarized block template i and the binarization points The binarized block template values of the same pixel points in the block template j are the same;
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类
像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同。For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: the binarized block template i The ratio of the number of class A pixel points in the pixel to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the pixel in the binarized block template i The number of the B-type pixel points is greater than or equal to the second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and the second type of pixel points in the binarized block template i The valued block template value is different from the binarized block template value of the same pixel point in the binarized block template j; the class B in the binarized block template i
The binarized block template value of the pixel is the same as the binarized block template value of the pixel having the same coordinate in the binarized block template j.
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;其中,所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同。For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: the binarized block template i The ratio of the number of class A pixel points in the pixel to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the pixel in the binarized block template i The ratio of the number of B-type pixel points to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number, wherein the second threshold is positive a binarized block template value of the class A pixel in the binarized block template i and a binarized block of the same pixel in the binarized block template j The template values are different; wherein the binarized block template value of the class B pixel in the binarized block template i is the same as the pixel with the same coordinate in the binarized block template j The valued block template values are the same.
其中,第一阈值例如可等于10、15、23、30、50或其他值。Wherein, the first threshold may be equal to, for example, 10, 15, 23, 30, 50 or other values.
其中,第二阈值例如可等于1、2、5、10、20或其他值。Wherein, the second threshold may be equal to 1, 2, 5, 10, 20 or other values, for example.
其中,第三阈值例如可等于1%、2%、3%、5%、10%或其他值。Wherein, the third threshold may be equal to, for example, 1%, 2%, 3%, 5%, 10% or other values.
其中,第四阈值例如可等于90%、80%、71%、65%、95%或其他值。Wherein, the fourth threshold may be equal to, for example, 90%, 80%, 71%, 65%, 95% or other values.
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;其中,所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: the binarized block template i The number of the C-type pixel regions in the pixel region is greater than or equal to the fifth threshold, and the D-type pixel region exists in the pixel region in the binarized segment template i, and the C in the binarized block template i The binarized block template value of the pixel-like region is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; wherein the binarized block template The binarized block template value of the D-type pixel region in i is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j.
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值
为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: the binarized block template i The number of the C-type pixel regions in the pixel region is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized segment template i is greater than or equal to a sixth threshold, wherein Sixth threshold
a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarization of the pixel region having the same coordinate in the binarized block template j The block template values are different; the binarized block template value of the D-type pixel region in the binarized block template i is the same as the pixel region of the binarized block template j having the same coordinate The valued block template values are the same;
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: the binarized block template i The number of the C-type pixel regions in the pixel region is greater than or equal to the fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized segment template i occupies the binarized block template i The ratio of the total number of pixel regions is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; the binarized block template value of the C-type pixel region in the binarized block template i is The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are different; the binarized block template values of the D-type pixel regions in the binarized block template i are The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are the same;
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,例如可以包括:所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include, for example, the binarized block template i The ratio of the number of C-type pixel regions in the pixel region to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the pixel region in the binarized block template i There is a D-type pixel region, wherein the eighth threshold is a positive number, a binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j The binarized block template values of the pixel regions having the same coordinates are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarized block The binarized block template values of the same pixel area in the template j are the same.
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模
板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to a preset screening condition, and may include: the binarized block template i a ratio of the number of C-type pixel regions in the pixel region to the total amount of the pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and in the pixel region in the binarized block template i The number of the D-type pixel regions is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, and the binarization of the C-type pixel regions in the binarized block template i Blocking template value and the binarized block mode
The binarized block template values of the pixel regions having the same coordinates in the board j are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarization The binarized block template values of the pixel regions having the same coordinates in the block template j are the same.
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件可包括:所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to preset screening conditions, and may include: pixels of the binarized block template i The ratio of the number of C-type pixel regions in the region to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and D in the pixel region in the binarized block template i The ratio of the number of pixel-like regions to the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, the eighth threshold is a positive number, and the sixth threshold is a positive number, the second The binarized block template value of the C-type pixel region in the valued block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; The binarized block template value of the D-type pixel region in the binarized block template i is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j .
其中,一个像素区域中可包括至少两个像素点。Wherein, at least two pixel points may be included in one pixel area.
其中,第五阈值例如可等于4、5、8、10、20或其他值。Wherein, the fifth threshold may be equal to, for example, 4, 5, 8, 10, 20 or other values.
其中,第六阈值例如可等于1、2、5、8、11或其他值。Wherein, the sixth threshold may be equal to 1, 2, 5, 8, 11, or other values, for example.
其中,第七阈值例如可等于1%、2%、3%、5%、10%或其他值。Wherein, the seventh threshold may be equal to, for example, 1%, 2%, 3%, 5%, 10% or other values.
其中,第八阈值例如可等于91%、80%、71%、65%、95%或其他值。Wherein, the eighth threshold may be equal to, for example, 91%, 80%, 71%, 65%, 95% or other values.
参见图2-b,图2-b为两个二值化分块模板的比较示意图,图中的两个二值化分块模板的均为黑色的位置的像素点的二值化分块模板值相同,图中的两个二值化分块模板的均为白色的位置的像素点的二值化分块模板值相同。左边的二值化分块模板的像素点为白色而右边的二值化分块模板的像素点为灰色的那些位置的像素点的二值化分块模板值不同。Referring to Figure 2-b, Figure 2-b is a schematic diagram of comparison of two binarized block templates. The two binarized block templates in the figure are binarized block templates of pixels at black positions. The values are the same, and the binarized block template values of the pixels of the two binarized block templates in the figure are all white. The binarized block template values of the pixels of the binarized block template on the left are white and the pixels of the binarized block template on the right are gray.
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。Optionally, in some possible implementation manners of the present invention, the set of wedge templates may be, for example, a wedge template table.
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two of the K sample points are sampled.
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。It can be understood that if the above-mentioned K sample point pairs are obtained by interval sampling, it is equivalent to not obtaining the binarization corresponding to each sample point pair of all the sample point pairs traversed by the current block template. The block template, therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which also helps to further reduce the addition to size N * The number of binarized block templates of the wedge template set of the image block of M, which is advantageous for reducing the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点,Optionally, in some possible implementation manners of the present invention, the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least one sampling point, that is, the sampling point pair x The included starting point and the sampling point are separated by one or more sampling points between the starting points included in y,
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x2 is not adjacent to the starting point included in the sampling point pair y2, and the sampling point pair x2 and the sampling point pair y2 are Two of the K sampling points are paired.
可选的,在本发明的一些可能的实施方式中,所述模板处理方法可以用于视频编码过程中或视频解码过程中。举例来说,在视频编码过程中或视频解码过程中,例如所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。即可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。也即是所,所述模板处理方法的执行主体可以是视频编码装置或视频解码装置。该视频编码装置或视频解码装置可以是任何需要输出或存储视频的装置,如笔记本电脑、平板电脑、个人电脑、手机、数字电视或视频服务器等设备。Optionally, in some possible implementation manners of the present invention, the template processing method may be used in a video encoding process or a video decoding process. For example, in the video encoding process or during the video decoding process, for example, the wedge template set of the image block of size N*M can be used to predict an image block of size N*M, and the like. It is possible to predict an image block of size N*M by using a wedge template set of image blocks of size N*M. That is, the execution body of the template processing method may be a video encoding device or a video decoding device. The video encoding device or video decoding device can be any device that needs to output or store video, such as a laptop, tablet, personal computer, mobile phone, digital television, or video server.
本发明模板处理方法的另一实施例。另一种模板处理方法包括:确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的
二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。Another embodiment of the template processing method of the present invention. Another template processing method includes: determining a current blocking template of a binarized blocking template of an image block of size N*M; and acquiring each of the K sampling point pairs traversed by the current blocking template. Point to the corresponding binarized block template, wherein the K is a positive integer, and the different sampling point pairs of the K sample point pairs are different in starting point and/or ending point, and the sampling point is x The included starting point and the sampling point are not adjacent to the starting point included in y, and the sampling point pair x and the sampling point pair y are any two sampling point pairs of the K sampling points; The pair of binarized block templates and wedge templates in each of the K pairs of sample pairs
The binarized template is compared, wherein the set of wedge templates is a current set of wedge templates of the image block of size N*M; comparing the binarized block template i with the wedge template set In the case where there is a difference between the binarized block templates j, the binarized block template i is added to the wedge template set, and the binarized block template i is the K sample point pairs. The binarized block template corresponding to any one of the sample point pairs, wherein the binarized block template j is any binarized block template in the set of wedge templates, the N and The M is a positive integer.
请参见图3,图3为本发明的另一个实施例提供的另一种模板处理方法的流程示意图。其中,如图3所示,本发明的另一个实施例提供的另一种模板处理方法可以包括:Referring to FIG. 3, FIG. 3 is a schematic flowchart diagram of another template processing method according to another embodiment of the present invention. As shown in FIG. 3, another template processing method provided by another embodiment of the present invention may include:
301、确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。301. Determine a current block template of the binarized block template of the image block of size N*M.
其中,所述N和所述M为正整数。Wherein N and the M are positive integers.
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。Wherein, the N may be equal to or not equal to M, for example, the N may be greater than or less than the M.
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。Optionally, in some possible implementation manners of the present invention, the N may be equal to a positive integer power of 2. The N may, for example, also be equal to a positive integer power of two.
例如所述N可等于2、4、8、16、30、64或其他值。For example, the N can be equal to 2, 4, 8, 16, 30, 64 or other values.
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。For example, an image block of size N*M can be, for example, an image block of size 2*2, an image block of size 4*4, an image block of size 8*8, and an image block of size 16*16. An image block of size 32*32 or an image block of size 64*64, an image block of size 8*16, an image block of size 32*16 or an image block of other sizes.
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。Wherein, the image block mentioned in each embodiment of the present invention may refer to an image block of a depth map or an image block of other types of images. For example, the image block of the above size N*M may be an image block of size N*M of the depth map.
302、获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板。其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。302. Acquire a binarized block template corresponding to each sample point pair of the K sample point pairs traversed by the current block template. Wherein, the K is a positive integer, the different sampling point pairs of the K sampling point pairs are different in starting point and/or the ending point, and the starting point included in the sampling point pair x and the starting point included in the sampling point pair y Not adjacent, the sample point pair x and the sample point pair y are any two sample point pairs of the K sample points.
例如所述K可等于2、3、4、10、15、30、50、65或其他值。
For example, the K can be equal to 2, 3, 4, 10, 15, 30, 50, 65 or other values.
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。It can be understood that if the above-mentioned K sample point pairs are obtained by interval sampling, it is equivalent to not obtaining the binarization corresponding to each sample point pair of all the sample point pairs traversed by the current block template. The block template, therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which also helps to further reduce the addition to size N * The number of binarized block templates of the wedge template set of the image block of M, which is advantageous for reducing the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点,Optionally, in some possible implementation manners of the present invention, the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least one sampling point, that is, the sampling point pair x The included starting point and the sampling point are separated by one or more sampling points between the starting points included in y,
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x2 is not adjacent to the starting point included in the sampling point pair y2, and the sampling point pair x2 and the sampling point pair y2 are Two of the K sampling points are paired.
303、将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集。303. Compare the binarized block template corresponding to each sample point pair of the obtained K sample point pairs with the binarized block template of the wedge template set, wherein the wedge template set is The current set of wedge templates of the image block of size N*M.
304、在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板。其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板。304. In a case where there is a difference between the binarized block template i and the binarized block template j in the wedge template set, the binarized block template i is added to the wedge template set. The binarized block template i is a binarized block template corresponding to any one of the K sample point pairs. The binarized block template j is any binarized block template in the set of wedge templates.
其中,由于所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,因此换句话说,对于所述K种采样点对中的每一种采样点对所对应的二值化分块模板,均可将其与所述尺寸为N*M的图像块的当前楔形模板集中的各个二值化分块模板进行比较,在其与所述尺寸为N*M的图像块的当前楔形模板集中的任意一个二值化分块模板之间的差异均符合预设的筛选条件的情况下,便可将其添加到尺寸为N*M的图像块的当前楔形模板集中。可以理解,随着二值化分块模板的逐步添加,尺寸为N*M的图像块的
当前楔形模板集中的二值化分块模板的数量将逐步增加。Wherein, the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, and in other words, for the K sample points The binarized block template corresponding to each sample point pair of the pair can be compared with each binarized block template in the current wedge template set of the image block of size N*M. If the difference between any of the binarized block templates in the current wedge template set of the image block of size N*M conforms to the preset filter condition, it can be added to the size The current wedge template set of N*M image blocks. It can be understood that with the gradual addition of the binarized block template, the image block of size N*M
The number of binarized block templates in the current wedge template set will gradually increase.
其中,二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异例如可包括:所述二值化分块模板i的像素点中存在A类像素点,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同。The difference between the binarized block template i and the binarized block template j in the set of wedge templates may include, for example, the presence of a class A pixel in the pixel of the binarized block template i. The binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j different.
又例如,二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异可包括:所述二值化分块模板i的像素区域中存在C类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同。For another example, the difference between the binarized block template i and the binarized block template j in the set of wedge templates may include: a type C pixel region exists in a pixel region of the binarized block template i, The binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template value of the pixel region having the same coordinate in the binarized block template j different.
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。Wherein, the set of wedge templates of the image block of size N*M can be used for prediction of image blocks of size N*M, and the like. For example, an image block of size N*M can also be predicted using a set of wedge templates of image blocks of size N*M.
可以看出,本实施例方案中,获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;并在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中。由于采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对,也就是说上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。It can be seen that, in the solution of this embodiment, the corresponding two pairs of each of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M are obtained. After the block template is obtained, the binarized segmentation template corresponding to each of the K sample point pairs and the binary segment of the image block wedge template set of size N*M are obtained. Comparing the block templates; and comparing the difference between the binarized block template i and the binarized block template j in the wedge template set, adding the binarized block template i to The wedge template of the image block of size N*M is concentrated. Since the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, the sampling point pair x and the sampling point pair y are any two sampling point pairs among the K sampling points. That is to say, the above-mentioned K sampling point pairs are obtained by interval sampling, which is equivalent to not obtaining the binarization corresponding to each sampling point pair of all the sampling point pairs traversed by the current blocking template. The block template, therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which is advantageous for reducing the addition to size N*M The number of binarized block templates of the wedge template set of the image block, thereby facilitating the reduction of the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。
Optionally, in some possible implementation manners of the present invention, the set of wedge templates may be, for example, a wedge template table.
可选的,在本发明的一些可能的实施方式中,所述模板处理方法可以用于视频编码过程中或视频解码过程中。举例来说,在视频编码过程中或视频解码过程中,例如所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。即可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。也即是说,所述模板处理方法的执行主体可以是视频编码装置或视频解码装置。该视频编码装置或视频解码装置可以是任何需要输出或存储视频的装置,如笔记本电脑、平板电脑、个人电脑、手机、数字电视或视频服务器等设备。Optionally, in some possible implementation manners of the present invention, the template processing method may be used in a video encoding process or a video decoding process. For example, in the video encoding process or during the video decoding process, for example, the wedge template set of the image block of size N*M can be used to predict an image block of size N*M, and the like. It is possible to predict an image block of size N*M by using a wedge template set of image blocks of size N*M. That is to say, the execution body of the template processing method may be a video encoding device or a video decoding device. The video encoding device or video decoding device can be any device that needs to output or store video, such as a laptop, tablet, personal computer, mobile phone, digital television, or video server.
为便于更好的理解和实施本发明实施例的上述方案,下面结合一些具体的应用场景进行举例说明。To facilitate a better understanding and implementation of the foregoing solution of the embodiments of the present invention, the following is exemplified in conjunction with some specific application scenarios.
请参见图4,图4为本发明的另一个实施例提供的另一种模板处理方法的流程示意图。本实施例从视频编码装置的角度进行举例描述。如图4所示,本发明的另一个实施例提供的另一种模板处理方法可以包括:Referring to FIG. 4, FIG. 4 is a schematic flowchart diagram of another template processing method according to another embodiment of the present invention. This embodiment is described by way of example from the perspective of a video encoding apparatus. As shown in FIG. 4, another template processing method provided by another embodiment of the present invention may include:
401、视频编码装置确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。401. The video encoding apparatus determines a current blocking template of the binarized blocking template of the image block of size N*M.
其中,所述N和所述M为正整数。Wherein N and the M are positive integers.
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。Wherein, the N may be equal to or not equal to M, for example, the N may be greater than or less than the M.
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。Optionally, in some possible implementation manners of the present invention, the N may be equal to a positive integer power of 2. The N may, for example, also be equal to a positive integer power of two.
例如所述N可等于2、4、8、16、30、64或其他值。For example, the N can be equal to 2, 4, 8, 16, 30, 64 or other values.
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。For example, an image block of size N*M can be, for example, an image block of size 2*2, an image block of size 4*4, an image block of size 8*8, and an image block of size 16*16. An image block of size 32*32 or an image block of size 64*64, an image block of size 8*16, an image block of size 32*16 or an image block of other sizes.
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。Wherein, the image block mentioned in each embodiment of the present invention may refer to an image block of a depth map or an image block of other types of images. For example, the image block of the above size N*M may be an image block of size N*M of the depth map.
其中,不同尺寸的图像块和不同二值化分块模板的当前分块模板之间具有
映射关系,因此基于图像块的尺寸,可确定与之对应的二值化分块模板的当前分块模板。Wherein, between the image blocks of different sizes and the current block templates of different binarized block templates
The relationship is mapped, so based on the size of the image block, the current block template of the binarized block template corresponding thereto can be determined.
402、视频编码装置获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板。其中,所述K为正整数。所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同。402. The video encoding apparatus acquires a binarized blocking template corresponding to each of the pair of sampling points of the K sampling point pairs traversed by the current blocking template. Wherein K is a positive integer. The different sampling point pairs of the K sampling point pairs are different in starting point and/or ending point.
其中,所述K种采样点对例如可为所述当前分块模板所能遍历的部分或全部采样点对。The K sample point pairs may be, for example, some or all of the sample point pairs that the current block template can traverse.
例如所述K可等于1、2、3、4、10、15、30、50、65或其他值。For example, the K can be equal to 1, 2, 3, 4, 10, 15, 30, 50, 65 or other values.
403、视频编码装置设置f=1。403. The video encoding device sets f=1.
404、视频编码装置设置g=1。404. The video encoding device sets g=1.
405、视频编码装置将获取的所述K种采样点对中的第f种采样点对所对应的二值化分块模板与楔形模板集中的第g个二值化分块模板进行比较。所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集。405. The video encoding apparatus compares the obtained binarized block template corresponding to the fth sample point pair of the K sample point pairs with the gth binarized block template of the wedge template set. The set of wedge templates is a current set of wedge templates of the image block of size N*M.
406、视频编码装置判断第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间的差异是否符合预设的筛选条件。406. The video encoding apparatus determines whether a difference between the corresponding binarized block template of the f-th sample point pair and the g-th binarized block template of the wedge template set meets a preset screening condition.
若是,则执行步骤407。If yes, go to step 407.
若否,则执行步骤410。If no, step 410 is performed.
407、g=g+1。407, g=g+1.
408、判断g是否大于所述楔形模板集当前包括的二值化分块模板总数。408. Determine whether g is greater than a total number of binarized block templates currently included in the set of wedge templates.
若是,则执行步骤409。If yes, go to step 409.
若否,则执行步骤405。If no, step 405 is performed.
其中,第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间的差异是否符合预设的筛选条件的判决方式,可参考上述实施例中的关于二值化分块模板i与二值化分块模板j之间的差异是否符合预设的筛选条件的判决方式,此处不在赘述。The method for determining whether the difference between the corresponding binarized block template and the g-th binary block template in the wedge template meets the preset screening condition may be referred to The manner of determining whether the difference between the binarized block template i and the binarized block template j meets the preset screening condition in the above embodiment is not described herein.
409、视频编码装置将第f种采样点对所对应的二值化分块模板添加到所述楔形模板集中。409. The video encoding apparatus adds, to the wedge template set, the binarized blocking template corresponding to the fth sampling point pair.
410、f=f+1。
410, f = f + 1.
411、视频编码装置判断所述f是否大于所述K。411. The video encoding apparatus determines whether the f is greater than the K.
若否,则执行步骤404。If no, step 404 is performed.
若是,则结束流程。If yes, the process ends.
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。Optionally, in some possible implementation manners of the present invention, the set of wedge templates may be, for example, a wedge template table.
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two of the K sample points are sampled.
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。It can be understood that if the above-mentioned K sample point pairs are obtained by interval sampling, it is equivalent to not obtaining the binarization corresponding to each sample point pair of all the sample point pairs traversed by the current block template. The block template, therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which also helps to further reduce the addition to size N * The number of binarized block templates of the wedge template set of the image block of M, which is advantageous for reducing the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点。Optionally, in some possible implementation manners of the present invention, the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least one sampling point, that is, the sampling point pair x The included starting point and the sampling point are separated by one or more sampling points between the starting points included in y.
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x2 is not adjacent to the starting point included in the sampling point pair y2, and the sampling point pair x2 and the sampling point pair y2 are Two of the K sampling points are paired.
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。Wherein, the set of wedge templates of the image block of size N*M can be used for prediction of image blocks of size N*M, and the like. For example, an image block of size N*M can also be predicted using a set of wedge templates of image blocks of size N*M.
可以看出,本实施例方案中,视频编码装置获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进
行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集(这也是现有技术导致楔形模板集中二值化分块模板数量巨大的主要原因),可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编码设备的复杂度。It can be seen that, in the solution of this embodiment, the video encoding apparatus acquires each sampling point pair of the K sampling point pairs traversed by the current blocking template of the binarized blocking template of the image block of size N*M. After the corresponding binarized block template, the binarized block template corresponding to each sample point pair of the obtained K sample point pairs and the image block wedge template set of size N*M are obtained. Valued block template
Row comparison; in the case that the difference between the binarized block template i and the binary block template j in the wedge template set is compared with a preset screening condition, the binarized block template is i is added to the wedge template set of the image block of size N*M, wherein the candidate binarization of the candidate binarized block template is selected due to the introduction of the filter condition, and the alternative binarization corresponding to the filter condition is The block template is added to the wedge template set of the image block of size N*M, whereas in the conventional technique, all the alternative binarized block templates which are different from the binarized block template in the wedge template set are added to Wedge template set (this is also the main reason for the huge number of binarized block templates in the wedge template set in the prior art), it can be seen that the above scheme is beneficial to reduce the binarization of the wedge template set added to the image block of size N*M. The number of block templates is further beneficial to reduce the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video encoding device.
请参见图5,图5为本发明的另一个实施例提供的另一种模板处理方法的流程示意图。本实施例从视频解码装置的角度进行举例描述。如图5所示,本发明的另一个实施例提供的另一种模板处理方法可以包括:Referring to FIG. 5, FIG. 5 is a schematic flowchart diagram of another template processing method according to another embodiment of the present invention. This embodiment is described by way of example from the perspective of a video decoding apparatus. As shown in FIG. 5, another template processing method provided by another embodiment of the present invention may include:
501、视频解码装置确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。501. The video decoding apparatus determines a current blocking template of the binarized blocking template of the image block of size N*M.
其中,所述N和所述M为正整数。Wherein N and the M are positive integers.
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。Wherein, the N may be equal to or not equal to M, for example, the N may be greater than or less than the M.
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。Optionally, in some possible implementation manners of the present invention, the N may be equal to a positive integer power of 2. The N may, for example, also be equal to a positive integer power of two.
例如所述N可等于2、4、8、16、30、64或其他值。For example, the N can be equal to 2, 4, 8, 16, 30, 64 or other values.
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。For example, an image block of size N*M can be, for example, an image block of size 2*2, an image block of size 4*4, an image block of size 8*8, and an image block of size 16*16. An image block of size 32*32 or an image block of size 64*64, an image block of size 8*16, an image block of size 32*16 or an image block of other sizes.
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。Wherein, the image block mentioned in each embodiment of the present invention may refer to an image block of a depth map or an image block of other types of images. For example, the image block of the above size N*M may be an image block of size N*M of the depth map.
其中,不同尺寸的图像块和不同二值化分块模板的当前分块模板之间具有
映射关系,因此基于图像块的尺寸,可确定与之对应的二值化分块模板的当前分块模板。Wherein, between the image blocks of different sizes and the current block templates of different binarized block templates
The relationship is mapped, so based on the size of the image block, the current block template of the binarized block template corresponding thereto can be determined.
502、视频解码装置获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板。其中,所述K为正整数。所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同。502. The video decoding device acquires a binarized block template corresponding to each of the pair of sampling points of the K sample point pairs traversed by the current block template. Wherein K is a positive integer. The different sampling point pairs of the K sampling point pairs are different in starting point and/or ending point.
其中,所述K种采样点对例如可为所述当前分块模板所能遍历的部分或全部采样点对。The K sample point pairs may be, for example, some or all of the sample point pairs that the current block template can traverse.
例如所述K可等于1、2、3、4、10、15、30、50、65或其他值。For example, the K can be equal to 1, 2, 3, 4, 10, 15, 30, 50, 65 or other values.
503、视频解码装置设置f=1。503. The video decoding device sets f=1.
504、设置g=1。504. Set g=1.
505、视频解码装置将获取的所述K种采样点对中的第f种采样点对所对应的二值化分块模板与楔形模板集中的第g个二值化分块模板进行比较。所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集。505. The video decoding device compares the obtained binarized block template corresponding to the fth sample point pair of the K sample point pairs with the gth binarized block template of the wedge template set. The set of wedge templates is a current set of wedge templates of the image block of size N*M.
506、视频解码装置判断第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间的差异是否符合预设的筛选条件。506. The video decoding apparatus determines whether a difference between the corresponding binarized block template of the f-th sample point pair and the g-th binarized block template of the wedge template set meets a preset screening condition.
若是,则执行步骤507。If yes, go to step 507.
若否,则执行步骤510。If no, step 510 is performed.
507、g=g+1。507, g=g+1.
508、判断g是否大于所述楔形模板集当前包括的二值化分块模板总数。508. Determine whether g is greater than a total number of binarized block templates currently included in the set of wedge templates.
若是,则执行步骤509。If yes, go to step 509.
若否,则执行步骤505。If no, step 505 is performed.
其中,第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间的差异是否符合预设的筛选条件的判决方式,可参考上述实施例中的关于二值化分块模板i与二值化分块模板j之间的差异是否符合预设的筛选条件的判决方式,此处不在赘述。The method for determining whether the difference between the corresponding binarized block template and the g-th binary block template in the wedge template meets the preset screening condition may be referred to The manner of determining whether the difference between the binarized block template i and the binarized block template j meets the preset screening condition in the above embodiment is not described herein.
509、视频解码装置将第f种采样点对所对应的二值化分块模板添加到所述楔形模板集中。509. The video decoding apparatus adds, to the wedge template set, the binarized block template corresponding to the fth sample point pair.
510、f=f+1。
510, f = f + 1.
511、视频解码装置判断所述f是否大于所述K。511. The video decoding apparatus determines whether the f is greater than the K.
若否,则执行步骤504。If no, step 504 is performed.
若是,则结束流程。If yes, the process ends.
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。Optionally, in some possible implementation manners of the present invention, the set of wedge templates may be, for example, a wedge template table.
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two of the K sample points are sampled.
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。It can be understood that if the above-mentioned K sample point pairs are obtained by interval sampling, it is equivalent to not obtaining the binarization corresponding to each sample point pair of all the sample point pairs traversed by the current block template. The block template, therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which also helps to further reduce the addition to size N * The number of binarized block templates of the wedge template set of the image block of M, which is advantageous for reducing the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点。Optionally, in some possible implementation manners of the present invention, the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least one sampling point, that is, the sampling point pair x The included starting point and the sampling point are separated by one or more sampling points between the starting points included in y.
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x2 is not adjacent to the starting point included in the sampling point pair y2, and the sampling point pair x2 and the sampling point pair y2 are Two of the K sampling points are paired.
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。Wherein, the set of wedge templates of the image block of size N*M can be used for prediction of image blocks of size N*M, and the like. For example, an image block of size N*M can also be predicted using a set of wedge templates of image blocks of size N*M.
可以看出,本实施例的方案中,视频解码装置获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板
进行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集(这也是现有技术导致楔形模板集中二值化分块模板数量巨大的主要原因),可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频解码设备的复杂度。It can be seen that, in the solution of this embodiment, the video decoding device acquires each sample point pair of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M. After the corresponding binarized block template, the binarized block template corresponding to each sample point pair of the obtained K sample point pairs and the image block wedge template of size N*M are collected. Binary block template
Comparing; in the case that the difference between the binarized block template i and the binary block template j in the wedge template set is compared with a preset screening condition, the binarized block template is i is added to the wedge template set of the image block of size N*M, wherein the candidate binarization of the candidate binarized block template is selected due to the introduction of the filter condition, and the alternative binarization corresponding to the filter condition is The block template is added to the wedge template set of the image block of size N*M, whereas in the conventional technique, all the alternative binarized block templates which are different from the binarized block template in the wedge template set are added to Wedge template set (this is also the main reason for the huge number of binarized block templates in the wedge template set in the prior art), it can be seen that the above scheme is beneficial to reduce the binarization of the wedge template set added to the image block of size N*M. The number of block templates is further beneficial to reduce the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video decoding device.
请参见图6-a,图6-a为本发明的另一个实施例提供的另一种模板处理方法的流程示意图。本实施例从视频编码装置的角度进行举例描述。其中,如图6-a所示,本发明的另一个实施例提供的另一种模板处理方法可以包括:Referring to FIG. 6-a, FIG. 6-a is a schematic flowchart diagram of another template processing method according to another embodiment of the present invention. This embodiment is described by way of example from the perspective of a video encoding apparatus. As shown in FIG. 6-a, another template processing method provided by another embodiment of the present invention may include:
601、视频编码装置确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。601. The video encoding apparatus determines a current blocking template of the binarized blocking template of the image block of size N*M.
其中,所述N和所述M为正整数。Wherein N and the M are positive integers.
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。Wherein, the N may be equal to or not equal to M, for example, the N may be greater than or less than the M.
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。Optionally, in some possible implementation manners of the present invention, the N may be equal to a positive integer power of 2. The N may, for example, also be equal to a positive integer power of two.
例如所述N可等于2、4、8、16、30、64或其他值。For example, the N can be equal to 2, 4, 8, 16, 30, 64 or other values.
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。For example, an image block of size N*M can be, for example, an image block of size 2*2, an image block of size 4*4, an image block of size 8*8, and an image block of size 16*16. An image block of size 32*32 or an image block of size 64*64, an image block of size 8*16, an image block of size 32*16 or an image block of other sizes.
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。
Wherein, the image block mentioned in each embodiment of the present invention may refer to an image block of a depth map or an image block of other types of images. For example, the image block of the above size N*M may be an image block of size N*M of the depth map.
602、视频编码装置获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板。其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。602. The video encoding apparatus acquires a binarized blocking template corresponding to each of the pair of sampling points of the K sampling point pairs traversed by the current blocking template. Wherein, the K is a positive integer, the different sampling point pairs of the K sampling point pairs are different in starting point and/or the ending point, and the starting point included in the sampling point pair x and the starting point included in the sampling point pair y Not adjacent, the sample point pair x and the sample point pair y are any two sample point pairs of the K sample points.
例如所述K可等于2、3、4、10、15、30、50、65或其他值。For example, the K can be equal to 2, 3, 4, 10, 15, 30, 50, 65 or other values.
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。It can be understood that if the above-mentioned K sample point pairs are obtained by interval sampling, it is equivalent to not obtaining the binarization corresponding to each sample point pair of all the sample point pairs traversed by the current block template. The block template, therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which also helps to further reduce the addition to size N * The number of binarized block templates of the wedge template set of the image block of M, which is advantageous for reducing the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点,Optionally, in some possible implementation manners of the present invention, the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least one sampling point, that is, the sampling point pair x The included starting point and the sampling point are separated by one or more sampling points between the starting points included in y,
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x2 is not adjacent to the starting point included in the sampling point pair y2, and the sampling point pair x2 and the sampling point pair y2 are Two of the K sampling points are paired.
例如图6-b~图6-g举例所示,图6-b~图6-g举例示出了某种采样点对的起点和终点可能位于的边界位置,其中,图中具有箭头的边界位置为采样点对的起点和终点可能位于的边界位置。For example, as shown in FIG. 6-b to FIG. 6-g, FIG. 6-b to FIG. 6-g exemplify a boundary position at which the start point and the end point of a certain pair of sample points may be located, wherein the figure has an arrow boundary. The position is the boundary position at which the start and end points of the pair of sample points may be located.
例如图6-h所示,图6-h举例示出了通过起点隔采样来得到的上述K种采样点对的方式。For example, as shown in FIG. 6-h, FIG. 6-h exemplifies the manner of the above-mentioned K sample point pairs obtained by the start interval sampling.
603、视频编码装置设置f=1。603. The video encoding device sets f=1.
604、视频编码装置设置g=1。604. The video encoding device sets g=1.
605、视频编码装置将获取的所述K种采样点对中的第f种采样点对所对应的二值化分块模板与楔形模板集中的第g个二值化分块模板进行比较,所述楔
形模板集为所述尺寸为N*M的图像块的当前楔形模板集。605. The video encoding apparatus compares the obtained binarized block template corresponding to the fth sample point pair of the K sample point pairs with the gth binarized block template of the wedge template set. Wedge
The template set is the current set of wedge templates of the image block of size N*M.
606、视频编码装置判断第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间是否存在差异。606. The video encoding apparatus determines whether there is a difference between the binarized block template corresponding to the f-th sample point pair and the g-th binarized block template in the wedge template set.
若是,则执行步骤607。If yes, go to step 607.
若否,则执行步骤610。If no, step 610 is performed.
607、g=g+1。607, g=g+1.
608、判断g是否大于所述楔形模板集当前包括的二值化分块模板总数。608. Determine whether g is greater than a total number of binarized block templates currently included in the set of wedge templates.
若是,则执行步骤609。If yes, go to step 609.
若否,则执行步骤605。If no, step 605 is performed.
其中,第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间是否存在差异的判决方式,可参考上述实施例中的关于二值化分块模板i与二值化分块模板j之间是否存在差异的判决方式,此处不在赘述。For the determination manner of whether there is a difference between the corresponding binarized block template and the g-th binarized block template in the wedge template set, refer to the foregoing in the foregoing embodiment. A method for determining whether there is a difference between the binarized block template i and the binarized block template j is not described herein.
609、视频编码装置将第f种采样点对所对应的二值化分块模板添加到所述楔形模板集中。609. The video encoding apparatus adds, to the wedge template set, the binarized blocking template corresponding to the fth sampling point pair.
610、f=f+1。610, f=f+1.
611、视频编码装置判断所述f是否大于所述K。611. The video encoding apparatus determines whether the f is greater than the K.
若否,则执行步骤604。If no, step 604 is performed.
若是,则结束流程。If yes, the process ends.
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。Optionally, in some possible implementation manners of the present invention, the set of wedge templates may be, for example, a wedge template table.
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。Wherein, the set of wedge templates of the image block of size N*M can be used for prediction of image blocks of size N*M, and the like. For example, an image block of size N*M can also be predicted using a set of wedge templates of image blocks of size N*M.
可以看出,本实施例方案中,视频编码装置获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进
行比较;并在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中。由于采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对,也就是说上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编码设备的复杂度。It can be seen that, in the solution of this embodiment, the video encoding apparatus acquires each sampling point pair of the K sampling point pairs traversed by the current blocking template of the binarized blocking template of the image block of size N*M. After the corresponding binarized block template, the binarized block template corresponding to each sample point pair of the obtained K sample point pairs and the image block wedge template set of size N*M are obtained. Valued block template
Row comparison; and comparing the difference between the binarized block template i and the binarized block template j in the wedge template set, adding the binarized block template i to the A set of wedge templates for image blocks of size N*M. Since the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, the sampling point pair x and the sampling point pair y are any two sampling point pairs among the K sampling points. That is to say, the above-mentioned K sampling point pairs are obtained by interval sampling, which is equivalent to not obtaining the binarization corresponding to each sampling point pair of all the sampling point pairs traversed by the current blocking template. The block template, therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which is advantageous for reducing the addition to size N*M The number of binarized block templates of the wedge template set of the image block, thereby facilitating the reduction of the number of binarized block templates in the wedge template set of the image block, thereby facilitating the reduction of the complexity of the video encoding device.
请参见图7,图7为本发明的另一个实施例提供的另一种模板处理方法的流程示意图。本实施例从视频解码装置的角度进行举例描述。如图6所示,本发明的另一个实施例提供的另一种模板处理方法可以包括:Referring to FIG. 7, FIG. 7 is a schematic flowchart diagram of another template processing method according to another embodiment of the present invention. This embodiment is described by way of example from the perspective of a video decoding apparatus. As shown in FIG. 6, another template processing method provided by another embodiment of the present invention may include:
701、视频解码装置确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。701. The video decoding apparatus determines a current blocking template of the binarized blocking template of the image block of size N*M.
其中,所述N和所述M为正整数。Wherein N and the M are positive integers.
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。Wherein, the N may be equal to or not equal to M, for example, the N may be greater than or less than the M.
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。Optionally, in some possible implementation manners of the present invention, the N may be equal to a positive integer power of 2. The N may, for example, also be equal to a positive integer power of two.
例如所述N可等于2、4、8、16、30、64或其他值。For example, the N can be equal to 2, 4, 8, 16, 30, 64 or other values.
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。For example, an image block of size N*M can be, for example, an image block of size 2*2, an image block of size 4*4, an image block of size 8*8, and an image block of size 16*16. An image block of size 32*32 or an image block of size 64*64, an image block of size 8*16, an image block of size 32*16 or an image block of other sizes.
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。Wherein, the image block mentioned in each embodiment of the present invention may refer to an image block of a depth map or an image block of other types of images. For example, the image block of the above size N*M may be an image block of size N*M of the depth map.
702、视频解码装置获取所述当前分块模板所遍历的K种采样点对中的每
种采样点对所对应的二值化分块模板。其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。702. The video decoding device acquires each of the K sample point pairs traversed by the current block template.
The paired sampling point pair corresponds to the binarized blocking template. Wherein, the K is a positive integer, the different sampling point pairs of the K sampling point pairs are different in starting point and/or the ending point, and the starting point included in the sampling point pair x and the starting point included in the sampling point pair y Not adjacent, the sample point pair x and the sample point pair y are any two sample point pairs of the K sample points.
例如所述K可等于2、3、4、10、15、30、50、65或其他值。For example, the K can be equal to 2, 3, 4, 10, 15, 30, 50, 65 or other values.
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。It can be understood that if the above-mentioned K sample point pairs are obtained by interval sampling, it is equivalent to not obtaining the binarization corresponding to each sample point pair of all the sample point pairs traversed by the current block template. The block template, therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which also helps to further reduce the addition to size N * The number of binarized block templates of the wedge template set of the image block of M, which is advantageous for reducing the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点,Optionally, in some possible implementation manners of the present invention, the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least one sampling point, that is, the sampling point pair x The included starting point and the sampling point are separated by one or more sampling points between the starting points included in y,
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x2 is not adjacent to the starting point included in the sampling point pair y2, and the sampling point pair x2 and the sampling point pair y2 are Two of the K sampling points are paired.
703、视频解码装置设置f=1。703. The video decoding device sets f=1.
704、视频解码装置设置g=1。704. The video decoding device sets g=1.
705、视频解码装置将获取的所述K种采样点对中的第f种采样点对所对应的二值化分块模板与楔形模板集中的第g个二值化分块模板进行比较,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集。705. The video decoding device compares the obtained binarized block template corresponding to the fth sample point pair of the obtained K sample point pairs with the gth binarized block template of the wedge template set. The set of wedge templates is the current set of wedge templates of the image block of size N*M.
706、视频解码装置判断第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间是否存在差异。706. The video decoding apparatus determines whether there is a difference between the binarized block template corresponding to the f-th sample point pair and the g-th binarized block template in the wedge template set.
若是,则执行步骤707。If yes, go to step 707.
若否,则执行步骤710。If no, step 710 is performed.
707、g=g+1。
707, g=g+1.
708、判断g是否大于所述楔形模板集当前包括的二值化分块模板总数。708. Determine whether g is greater than a total number of binarized block templates currently included in the set of wedge templates.
若是,则执行步骤709。If yes, step 709 is performed.
若否,则执行步骤705。If no, step 705 is performed.
其中,第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间是否存在差异的判决方式,可参考上述实施例中的关于二值化分块模板i与二值化分块模板j之间是否存在差异的判决方式,此处不在赘述。For the determination manner of whether there is a difference between the corresponding binarized block template and the g-th binarized block template in the wedge template set, refer to the foregoing in the foregoing embodiment. A method for determining whether there is a difference between the binarized block template i and the binarized block template j is not described herein.
709、视频解码装置将第f种采样点对所对应的二值化分块模板添加到所述楔形模板集中。709. The video decoding apparatus adds, to the wedge template set, the binarized block template corresponding to the fth sample point pair.
710、f=f+1。710, f = f + 1.
711、视频解码装置判断所述f是否大于所述K。711. The video decoding apparatus determines whether the f is greater than the K.
若否,则执行步骤704。If no, step 704 is performed.
若是,则结束流程。If yes, the process ends.
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。Optionally, in some possible implementation manners of the present invention, the set of wedge templates may be, for example, a wedge template table.
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。Wherein, the set of wedge templates of the image block of size N*M can be used for prediction of image blocks of size N*M, and the like. For example, an image block of size N*M can also be predicted using a set of wedge templates of image blocks of size N*M.
可以看出,本实施例方案中,视频解码装置获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;并在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中。由于采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对,也就是说上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二
值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频解码设备的复杂度。It can be seen that, in the solution of the embodiment, the video decoding device acquires each sample point pair of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M. After the corresponding binarized block template, the binarized block template corresponding to each sample point pair of the obtained K sample point pairs and the image block wedge template set of size N*M are obtained. The valued block template is compared; and when the difference between the binarized block template i and the binary block template j in the wedge template set is compared, the binarized block template is used i is added to the wedge template set of the image block of size N*M. Since the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, the sampling point pair x and the sampling point pair y are any two sampling point pairs among the K sampling points. That is to say, the above-mentioned K sampling point pairs are obtained by interval sampling, which is equivalent to not acquiring the corresponding two pairs of each sampling point pair of all the sampling point pairs traversed by the current blocking template.
The valued block template, therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which is advantageous for reducing the addition to size N * The number of binarized block templates of the wedge template set of the image block of M, which in turn helps to reduce the number of binarized block templates in the wedge template set of the image block, thereby facilitating the reduction of the complexity of the video decoding device.
下面再通过更为具体的一些应用场景进行举例介绍。The following is an example of a more specific application scenario.
在本发明各实施例中可将深度图的图像块简称为深度图像块。An image block of a depth map may be simply referred to as a depth image block in various embodiments of the present invention.
举例场景1,其中,假设场景1中需要获得尺寸为16×16的深度图像块的楔形模板集。假设,K种采样点对中的第f种采样点对的起点坐标和终点的坐标分别为(0,15)和(7,15)。假设第一阈值为7,假设尺寸为16×16的深度图像块的楔形模板集中当前已存在176个对应尺寸为16×16的二值化分块模板,将第f种采样点所对应的二值化分块模板,与上述楔形模板集中当前已经存在的176个二值化分块模板进行循环比较。根据比较得到的差异结果来确定是否将第f种采样点所对应的二值化分块模板添加到上述楔形模板集。例如,若对于楔形模板集中176个二值化分块模板中任意1个二值化分块模板,第f种采样点所对应的二值化分块模板的像素点中的A类像素点的数量均大于或等于7,并且第f种采样点所对应的二值化分块模板的像素点中存在B类像素点(即A类像素点的数量小于256),那么便可将第f种采样点所对应的二值化分块模板添加到上述尺寸为16×16的深度图像块的楔形模板集中。若对于楔形模板集中176个二值化分块模板中的第38个二值化分块模板,第f种采样点所对应的二值化分块模板的A类像素点的数量小于7(即两个二值化分块模板之间的差异较小),那么可确定不将第f种采样点所对应的二值化分块模板添加到上述尺寸为16×16的深度图像块的楔形模板集中。 Example Scenario 1, wherein it is assumed that a set of wedge templates of a depth image block having a size of 16×16 needs to be obtained in the scene 1. It is assumed that the coordinates of the start point and the end point of the f-th sample point pair of the K sample point pairs are (0, 15) and (7, 15), respectively. Assuming that the first threshold is 7, assuming that there are 176 binarized block templates corresponding to size 16×16 in the wedge template set of the depth image block of size 16×16, the second corresponding to the fth sample point The valued block template is cyclically compared with the 176 binarized block templates that are currently existing in the wedge template set. It is determined whether the binarized block template corresponding to the fth sample point is added to the wedge template set according to the difference result obtained by the comparison. For example, if any one of the 176 binarized block templates in the wedge template is used, the pixel of the class A of the binarized block template corresponding to the fth sample point is If the number is greater than or equal to 7, and there is a type B pixel in the pixel of the binarized block template corresponding to the fth sample point (ie, the number of class A pixels is less than 256), then the fth type The binarized block template corresponding to the sample point is added to the wedge template set of the above-mentioned depth image block of size 16×16. If the 38th binarized block template in the 176 binarized block templates in the wedge template set, the number of class A pixels of the binarized block template corresponding to the fth sample point is less than 7 (ie, The difference between the two binarized block templates is small, then it can be determined that the binarized block template corresponding to the fth sample point is not added to the wedge template of the above-mentioned 16×16 depth image block. concentrated.
举例场景2,其中,假设场景1中需要获得尺寸为16×16的深度图像块的楔形模板集。假设K种采样点对中的任意两种采样点对的起点不相邻,即可K种采样点的起点是间隔采样得到的,例如对应与每种楔形划分方向,采样点对中的任意两种采样点对的起点均不相邻。K种采样点对中的第f种采样点对的起点坐标和终点的坐标分别为(13,15)和(15,13)。假设第一阈值为8,尺寸为16×16的深度图像块的楔形模板集中当前已经存在197个对应尺寸为16×16的二值化分块模板,将第f种采样点所对应的二值化分块模板,与上述楔形模板集中当
前已经存在的197个二值化分块模板进行循环比较。其中,根据比较得到的差异结果来确定是否将第f种采样点所对应的二值化分块模板添加到上述楔形模板集。例如,若对于楔形模板集中197个二值化分块模板中任意1个二值化分块模板,第f种采样点所对应的二值化分块模板的像素点中的A类像素点的数量均大于或等于8,并且第f种采样点所对应的二值化分块模板的像素点中存在B类像素点(即A类像素点的数量小于256),那么,将第f种采样点所对应的二值化分块模板添加到上述尺寸为16×16的深度图像块的楔形模板集中。若对于楔形模板集中197个二值化分块模板中的第151个二值化分块模板,第f种采样点所对应的二值化分块模板的A类像素点的数量小于8,那么可确定不将第f种采样点所对应的二值化分块模板添加到上述尺寸为16×16的深度图像块的楔形模板集中。Example 2, in which it is assumed that a set of wedge templates of a depth image block of size 16×16 needs to be obtained in scene 1. It is assumed that the starting points of any two sampling point pairs of the K sampling point pairs are not adjacent, that is, the starting point of the K sampling points is obtained by interval sampling, for example, corresponding to each wedge dividing direction, any two of the sampling point pairs. The starting points of the pair of sampling points are not adjacent. The coordinates of the start point and the end point of the f-th sample point pair in the K sample pair are (13, 15) and (15, 13), respectively. Assuming that the first threshold is 8, the wedge template set of the depth image block of size 16×16 currently has 197 binarized block templates corresponding to size 16×16, and the binary value corresponding to the fth sample point is Blocking template, with the above wedge template concentrated
The 197 binarized block templates that existed before are cyclically compared. And determining, according to the difference result obtained by the comparison, whether the binarized block template corresponding to the fth sample point is added to the wedge template set. For example, if any one of the 197 binarized block templates in the wedge template is used, the pixel of the class A of the binarized block template corresponding to the fth sample point is The number is greater than or equal to 8, and there is a class B pixel in the pixel of the binarized block template corresponding to the fth sample point (ie, the number of class A pixels is less than 256), then the fth sample is sampled. The binarized block template corresponding to the point is added to the wedge template set of the above-mentioned depth image block of size 16×16. If the 151nd binarized block template in the 197 binarized block templates in the wedge template set, the number of class A pixels of the binarized block template corresponding to the fth sample point is less than 8, then It may be determined that the binarized block template corresponding to the fth sample point is not added to the wedge template set of the above-mentioned 16×16 depth image block.
举例场景3,其中,假设场景1中需要获得尺寸为16×16的深度图像块的楔形模板集。假设K种采样点对中的任意两种采样点对的起点不相邻,即可K种采样点的起点是间隔采样得到的,例如对应与每种楔形划分方向,采样点对中的任意两种采样点对的起点均不相邻。K种采样点对中的第f种采样点对的起点坐标和终点的坐标分别为(13,15)和(15,13)。假设尺寸为16×16的深度图像块的楔形模板集中当前已经存在80个对应尺寸为16×16的二值化分块模板,将第f种采样点所对应的二值化分块模板,与上述楔形模板集中当前已经存在的80个二值化分块模板进行循环比较。其中,根据比较得到的差异结果来确定是否将第f种采样点所对应的二值化分块模板添加到上述楔形模板集。例如若对于楔形模板集中80个二值化分块模板中任意1个二值化分块模板,第f种采样点所对应的二值化分块模板的像素点中的存在A类像素点(两个二值化分块模板之间存在差异),那么将第f种采样点所对应的二值化分块模板添加到上述尺寸为16×16的深度图像块的楔形模板集中。若对于楔形模板集中80个二值化分块模板中的第65个二值化分块模板,第f种采样点所对应的二值化分块模板的像素点中不存在A类像素点(即两个二值化分块模板之间存在差异),那么可确定不将第f种采样点所对应的二值化分块模板添加到上述尺寸为16×16的深度图像块的楔形模板集中。Example 3, in which it is assumed that a set of wedge templates of a depth image block of size 16×16 needs to be obtained in scene 1. It is assumed that the starting points of any two sampling point pairs of the K sampling point pairs are not adjacent, that is, the starting point of the K sampling points is obtained by interval sampling, for example, corresponding to each wedge dividing direction, any two of the sampling point pairs. The starting points of the pair of sampling points are not adjacent. The coordinates of the start point and the end point of the f-th sample point pair in the K sample pair are (13, 15) and (15, 13), respectively. It is assumed that there are 80 binarized block templates corresponding to size 16×16 in the wedge template set of the depth image block of size 16×16, and the binarized block template corresponding to the fth sample point is The above-mentioned wedge template sets 80 existing binarized block templates that are already existing in the loop for cyclic comparison. And determining, according to the difference result obtained by the comparison, whether the binarized block template corresponding to the fth sample point is added to the wedge template set. For example, if there is any one binarized block template in the 80 binary templated templates in the wedge template set, the type A pixel points exist in the pixels of the binarized block template corresponding to the fth sample point ( A difference exists between the two binarized block templates. Then, the binarized block template corresponding to the fth sample point is added to the wedge template set of the above-mentioned 16×16 depth image block. If there is a 65th binarized block template in the 80 binary templated templates in the wedge template set, there is no class A pixel in the pixel of the binarized block template corresponding to the fth sample point ( That is, there is a difference between the two binarized block templates, then it can be determined that the binarized block template corresponding to the fth sample point is not added to the wedge template set of the above-mentioned 16×16 depth image block. .
可以理解,本发明实施例提及的二值化分块模板的像素点中的存在的A类
像素点和B类像素点是相对概念,因此,二值化分块模板i对应于其他不同的二值化分块模板,二值化分块模板i的像素点中的存在的A类像素点和B类像素点的数量可能不同,举例来说,与二值化分块模板j相比,二值化分块模板i的像素点中的A类像素点和B类像素点的数量可能分别为16和240;与二值化分块模板j2相比,二值化分块模板i的像素点中的A类像素点和B类像素点的数量可能分别为25和231;与二值化分块模板j3相比,二值化分块模板i的像素点中的A类像素点和B类像素点的数量可能分别为56和200。C类像素区域和D类像素区域的概念可以此类推。It can be understood that the class A existing in the pixel of the binarized block template mentioned in the embodiment of the present invention is
Pixels and B-type pixels are relative concepts. Therefore, the binarized block template i corresponds to other different binarized block templates, and the class A pixels present in the bins of the binarized block template i The number of B-type pixels may be different. For example, compared with the binarized block template j, the number of class A pixels and B-type pixels in the bins of the binarized block template i may be respectively 16 and 240; compared with the binarized block template j2, the number of class A pixels and class B pixels in the bins of the binarized block template i may be 25 and 231, respectively; and binarization Compared with the block template j3, the number of class A pixels and class B pixels in the bins of the binarized block template i may be 56 and 200, respectively. The concept of a class C pixel region and a class D pixel region can be deduced by analogy.
参见图8,本发明实施例提供的一种模板处理装置800,可包括:Referring to FIG. 8, a template processing apparatus 800 according to an embodiment of the present invention may include:
确定单元810,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;a determining unit 810, configured to determine a current blocking template of the binarized blocking template of the image block of size N*M;
获取单元820,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;The obtaining unit 820 is configured to obtain a binarized blocking template corresponding to each of the pair of sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K Different sampling points of different pairs of sampling points have different starting points and/or different ending points;
比较单元830,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;The comparing unit 830 is configured to compare the binarized blocking template corresponding to each of the acquired sampling point pairs to the binary templated template in the wedge template set, wherein the The set of wedge templates is a current set of wedge templates of the image block of size N*M;
添加单元840,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。The adding unit 840 is configured to: when comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition, the binarization a block template i is added to the set of wedge templates, wherein the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, wherein The binarized block template j is any binarized block template in the set of wedge templates, wherein the N and the M are positive integers.
可选的,在本发明的一些可能的实施方式中,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:Optionally, in some possible implementation manners of the present invention, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to preset screening conditions, including:
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的
与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where Binaryized block template values of the class A pixel points in the binarized block template i and the binarized block template j
The binarized block template values of the same pixel points are different; the binarized block template values of the class B pixels in the binarized block template i and the binarized block template j The binarized block template values of the same pixel points in the same are the same;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of class A pixels in the pixel of the binarized block template i is greater than or equal to a first threshold, and the number of class B pixels in the bins in the binarized block template i is greater than Or equal to a second threshold, wherein the second threshold is a positive integer, the binarized block template value of the class A pixel in the binarized block template i and the binarized block template j The value of the binarized block template value of the pixel having the same coordinate is different; the binarized block template value of the class B pixel in the binarized block template i and the binarized block The binarized block template values of the same pixel points in the template j are the same;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the type A pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the number of the class B pixels in the pixel in the binarized block template i accounts for The ratio of the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the second threshold is a positive number; and the type A pixel of the binarized block template i The binarized block template value is different from the binarized block template value of the same pixel in the binarized block template j; the class B pixel in the binarized block template i The binarized block template value of the point is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization There is a class B pixel in the pixel in the block template i, wherein the fourth threshold is a positive number, wherein the binarized block template of the class A pixel in the binarized block template i The value is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarization of the class B pixel in the binarized block template i The block template value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,
Or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The number of class B pixels in the pixel in the block template i is greater than or equal to a second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and the binarized block The binarized block template value of the class A pixel in the template i is different from the binarized block template value of the pixel having the same coordinate in the binarized block template j; the binarization The binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The ratio of the number of class B pixel points in the pixel in the block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number Wherein the second threshold is a positive number, the binarized block template value of the class A pixel in the binarized block template i and the coordinate in the binarized block template j The binarized block template values of the same pixel are different; the binarized block template value of the class B pixel in the binarized block template i and the binary in the binarized block template j The binarized block template values of the same coordinates are the same;
或者or
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i, The binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相
同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j In the coordinate
The binarized block template values of the same pixel region are different; the binarized block template value of the D-type pixel region in the binarized block template i and the binarized block template j The binarized block template values of the pixel regions having the same coordinates are the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i The binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i The binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization There is a D-type pixel region in the pixel region in the block template i, wherein the eighth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are different; the binarized block templates of the D-type pixel regions in the binarized block template i The value is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The number of the D-type pixel regions in the pixel region in the block template i is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, the binarized block template i The binarized block template value of the C-type pixel region is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the binarized block The binarized block template value of the D-type pixel region in the template i is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The ratio of the number of the D-type pixel regions in the pixel region in the block template i to the total amount of the pixel regions of the binarized block template i is greater than or equal to a seventh threshold, and the eighth threshold is a positive number. The sixth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is the same as the pixel region in the binary block template j The binarized block template values are different; the binarized block template values of the class D pixel regions in the binarized block template i are the same as the coordinates in the binarized block template j The binarized block template values of the pixel area are the same.
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。Optionally, in some possible implementation manners of the present invention, the set of wedge templates may be, for example, a wedge template table.
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two of the K sample points are sampled.
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。Optionally, in some possible implementation manners of the present invention, the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least 1 sampling point.
可选的,在本发明的一些可能的实施方式中,所述模板处理装置用于视频编码装置中或视频解码装置中。Optionally, in some possible implementation manners of the present invention, the template processing apparatus is used in a video encoding apparatus or a video decoding apparatus.
可以理解的是,本实施例的模板处理装置800的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。It is to be understood that the functions of the functional modules of the template processing apparatus 800 of the present embodiment may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, reference may be made to the related description of the foregoing method embodiments, and details are not described herein again. .
可以看出,本实施例的方案中,模板处理装置800获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对
备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集(这也是现有技术导致楔形模板集中二值化分块模板数量巨大的主要原因),可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频解码设备的复杂度。It can be seen that, in the solution of the embodiment, the template processing apparatus 800 acquires each sampling point of the K sampling point pairs traversed by the current blocking template of the binarized blocking template of the image block of size N*M. After the corresponding binarized block template is obtained, the binarized block template corresponding to each sample point pair of the acquired K sample point pairs and the image block wedge template of size N*M are concentrated. Comparing the binarized block templates; comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition, The binarized block template i is added to the wedge template set of the image block of size N*M, wherein the screening condition is introduced
The alternative binarized block template is filtered, and the candidate binarized block template conforming to the filter condition is added to the wedge template set of the image block of size N*M, whereas in the conventional technology, the wedge template is concentrated. All alternative binarized block templates with different binarized block templates are added to the wedge template set (this is also the main reason why the number of binarized block templates in the wedge template set is huge in the prior art). The above solution is advantageous for reducing the number of binarized block templates added to the wedge template set of the image block of size N*M, which is advantageous for reducing the number of binarized block templates in the wedge template set of the image block, thereby facilitating the number of binarized block templates in the wedge template set of the image block. Reduce the complexity of video decoding devices.
参见图9,本发明实施例提供的一种模板处理装置900,可包括:Referring to FIG. 9, a template processing apparatus 900 according to an embodiment of the present invention may include:
确定单元910,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;a determining unit 910, configured to determine a current blocking template of the binarized blocking template of the image block of size N*M;
获取单元920,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;The obtaining unit 920 is configured to obtain a binarized blocking template corresponding to each of the pair of sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K Different sampling points of different sampling point pairs are different in starting point and/or ending point, and the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point is x and The sampling point pair y is any two sampling point pairs of the K sampling points;
比较单元930,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;The comparing unit 930 is configured to compare the binarized blocking template corresponding to each of the acquired sampling point pairs with the binary templated template in the wedge template set, wherein the The set of wedge templates is a current set of wedge templates of the image block of size N*M;
添加单元940,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。The adding unit 940 is configured to add the binarized block template i to the case where there is a difference between the binarized block template i and the binarized block template j in the wedge template set. The binary template is set, and the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, wherein the binarized block is The template j is any type of binarized block template in the set of wedge templates, and the N and the M are positive integers.
可选的,在本发明的一些可能的实施方式中,所述楔形模板集可以为楔形模板表。Optionally, in some possible implementation manners of the present invention, the set of wedge templates may be a wedge template table.
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two of the K sample points are sampled.
可选的,在本发明的一些可能的实施方式中,Optionally, in some possible implementation manners of the present invention,
所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。The starting point included in the sampling point pair x and the starting point included in the sampling point pair y are separated by at least one sampling point.
可选的,在本发明的一些可能的实施方式中,所述模板处理装置900用于视频编码装置中或视频解码装置中。Optionally, in some possible implementation manners of the present invention, the template processing apparatus 900 is used in a video encoding apparatus or in a video decoding apparatus.
可以理解的是,本实施例的模板处理装置900的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。It is to be understood that the functions of the functional modules of the template processing apparatus 900 of the present embodiment may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, reference may be made to the related description of the foregoing method embodiments, and details are not described herein again. .
可以看出,本实施例的方案中,模板处理装置900获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;并在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中。由于采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对,也就是说上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。It can be seen that, in the solution of the embodiment, the template processing apparatus 900 acquires each sampling point of the K sampling point pairs traversed by the current blocking template of the binarized blocking template of the image block of size N*M. After the corresponding binarized block template is obtained, the binarized block template corresponding to each sample point pair of the acquired K sample point pairs and the image block wedge template of size N*M are concentrated. Comparing the binarized block templates; and comparing the difference between the binarized block template i and the binarized block template j in the wedge template set, the binarization is divided A block template i is added to the wedge template set of the image block of size N*M. Since the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, the sampling point pair x and the sampling point pair y are any two sampling point pairs among the K sampling points. That is to say, the above-mentioned K sampling point pairs are obtained by interval sampling, which is equivalent to not obtaining the binarization corresponding to each sampling point pair of all the sampling point pairs traversed by the current blocking template. The block template, therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which is advantageous for reducing the addition to size N*M The number of binarized block templates of the wedge template set of the image block, thereby facilitating the reduction of the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
参见图10,本发明实施例提供的一种模板处理装置1000,可包括:Referring to FIG. 10, a template processing apparatus 1000 according to an embodiment of the present invention may include:
处理器1002和存储器1003。其中,处理器1002和存储器1003通过总线1001耦合连接。The processor 1002 and the memory 1003. The processor 1002 and the memory 1003 are coupled by a bus 1001.
所述处理器1002通过调用所述存储器1003中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板
所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。The processor 1002 is configured to determine a current blocking template of a binarized blocking template of an image block of size N*M by calling a code or an instruction in the memory 1003; acquiring the current blocking template
a binarized blocking template corresponding to each of the pair of sampling point pairs traversed, wherein the K is a positive integer, and the different sampling point pairs included in the K sampling point pairs are included The start point is different and/or the end point is different; the binarized block template corresponding to each sample point pair of the obtained K sample point pairs is compared with the binary block template in the wedge template set, wherein The set of wedge templates is a current set of wedge templates of the image block of size N*M; comparing the difference between the binarized block template i and the binarized block template j of the wedge template set Adding the binarized block template i to the wedge template set, wherein the binarized block template i is any of the K sample point pairs. A binarized block template corresponding to a pair of sample points, wherein the binarized block template j is any binarized block template in the set of wedge templates, wherein the N and the M is a positive integer.
可选的,在本发明的一些可能的实施方式中,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:Optionally, in some possible implementation manners of the present invention, the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to preset screening conditions, including:
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where The binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Differentiating; the binarized block template value of the class B pixel in the binarized block template i and the binarized block of the same pixel in the binarized block template j The template values are the same;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of class A pixels in the pixel of the binarized block template i is greater than or equal to a first threshold, and the number of class B pixels in the bins in the binarized block template i is greater than Or equal to a second threshold, wherein the second threshold is a positive integer, the binarized block template value of the class A pixel in the binarized block template i and the binarized block template j The value of the binarized block template value of the pixel having the same coordinate is different; the binarized block template value of the class B pixel in the binarized block template i and the binarized block The binarized block template values of the same pixel points in the template j are the same;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一
阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the type A pixel points in the pixel of the binarized block template i is greater than or equal to the first
a threshold value, and a ratio of the number of the B-type pixel points in the pixel in the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, where The second threshold is a positive number; the binarized block template value of the class A pixel in the binarized block template i is the same as the pixel in the binarized block template j The binarized block template values of the points are different; the binarized block template values of the class B pixels in the binarized block template i are the same as the coordinates in the binarized block template j The binarized block template values of the pixels are the same;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization There is a class B pixel in the pixel in the block template i, wherein the fourth threshold is a positive number, wherein the binarized block template of the class A pixel in the binarized block template i The value is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarization of the class B pixel in the binarized block template i The block template value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The number of class B pixels in the pixel in the block template i is greater than or equal to a second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and the binarized block The binarized block template value of the class A pixel in the template i is different from the binarized block template value of the pixel having the same coordinate in the binarized block template j; the binarization The binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化
分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The ratio of the number of class B pixel points in the pixel in the block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number The second threshold value is a positive number, and the binarized block template value of the class A pixel point in the binarized block template i is compared with the binarization
The binarized block template values of the same pixel points in the block template j are different; the binarized block template values of the class B pixels in the binarized block template i are the same as the two The value of the binarized block template of the pixel with the same coordinate in the valued block template j is the same;
或者or
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i, The binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j The binarized block template values of the pixel regions having the same coordinates are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarized block The binarized block template value of the same pixel region in the template j is the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i The binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i The binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化
分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of C-type pixel regions in the pixel region of the binarized block template i occupies the binarization
The ratio of the total number of the pixel regions of the block template i is greater than or equal to the eighth threshold, and the pixel region of the binarized block template i has a D-type pixel region, wherein the eighth threshold is a positive number. The binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template value of the pixel region having the same coordinate in the binarized block template j Differentiating; the binarized block template value of the D-type pixel region in the binarized block template i and the binarized block of the pixel region having the same coordinate in the binarized block template j The template values are the same;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The number of the D-type pixel regions in the pixel region in the block template i is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, the binarized block template i The binarized block template value of the C-type pixel region is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the binarized block The binarized block template value of the D-type pixel region in the template i is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;
或者,or,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The ratio of the number of the D-type pixel regions in the pixel region in the block template i to the total amount of the pixel regions of the binarized block template i is greater than or equal to a seventh threshold, and the eighth threshold is a positive number. The sixth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is the same as the pixel region in the binary block template j The binarized block template values are different; the binarized block template values of the class D pixel regions in the binarized block template i are the same as the coordinates in the binarized block template j The binarized block template values of the pixel area are the same.
可选的,在本发明的一些可能的实施方式中,所述楔形模板集可以为楔形模板表。Optionally, in some possible implementation manners of the present invention, the set of wedge templates may be a wedge template table.
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种
采样点中的任意两种采样点对。Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are The K species
Any two pairs of sample points in the sample point.
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。Optionally, in some possible implementation manners of the present invention, the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least 1 sampling point.
可选的,在本发明的一些可能的实施方式中,所述模板处理装置1000用于视频编码装置中或视频解码装置中。Optionally, in some possible implementation manners of the present invention, the template processing apparatus 1000 is used in a video encoding apparatus or a video decoding apparatus.
可以理解的是,本实施例的模板处理装置1000的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。It is to be understood that the functions of the functional modules of the template processing apparatus 1000 of the present embodiment may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, reference may be made to the related description of the foregoing method embodiments, and details are not described herein again. .
可以看出,本实施例的方案中,模板处理装置1000获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集(这也是现有技术导致楔形模板集中二值化分块模板数量巨大的主要原因),可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频解码设备的复杂度。It can be seen that, in the solution of the embodiment, the template processing apparatus 1000 acquires each of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M. After the corresponding binarized block template is obtained, the binarized block template corresponding to each sample point pair of the acquired K sample point pairs and the image block wedge template of size N*M are concentrated. Comparing the binarized block templates; comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition, The binarized block template i is added to the wedge template set of the image block of size N*M, wherein the screening condition is selected by screening the candidate binarized block template The alternative binarized blocking template is added to the wedge template set of the image block of size N*M, whereas in the conventional technique, all the alternative binary values which are different from the binarized blocking template in the wedge template set are used. The split block templates are added to the wedge template set (this is also the prior art The main reason is that the number of binary templated templates in the wedge template is large. It can be seen that the above scheme is beneficial to reduce the number of binary templated templates added to the wedge template set of the image block of size N*M, which is beneficial to The number of binarized block templates in the wedge template set of the image block is reduced, which in turn helps to reduce the complexity of the video decoding device.
参见图11,本发明实施例提供的一种模板处理装置1100,可包括:Referring to FIG. 11, a template processing apparatus 1100 according to an embodiment of the present invention may include:
处理器1102和存储器1103。其中,处理器1102和存储器1103通过总线1101耦合连接。 Processor 1102 and memory 1103. The processor 1102 and the memory 1103 are coupled by a bus 1101.
所述处理器1102通过调用所述存储器1103中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所
述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。The processor 1102 is configured to determine a current blocking template of a binarized blocking template of an image block of size N*M by calling a code or an instruction in the memory 1103; acquiring the current blocking template a binarized block template corresponding to each sample point pair of the K sample point pairs traversed, wherein
K is a positive integer, the different sampling point pairs of the K sampling point pairs are different in starting point and/or the ending point, and the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y And the sampling point pair x and the sampling point pair y are any two sampling point pairs of the K sampling points; corresponding to each of the obtained K sampling point pairs The binarized block template is compared with the binarized block template in the set of wedge templates, wherein the set of wedge templates is the current set of wedge templates of the image block of size N*M; In the case where there is a difference between the block template i and the binarized block template j in the set of wedge templates, the binarized block template i is added to the wedge template set, and the binary value is divided into The block template i is a binarized block template corresponding to any one of the K sample point pairs, wherein the binarized block template j is any one of the wedge template sets. A binarized block template, the N and the M being positive integers.
可选的,在本发明的一些可能的实施方式中,所述楔形模板集可为楔形模板表。Optionally, in some possible implementation manners of the present invention, the set of wedge templates may be a wedge template table.
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。Optionally, in some possible implementation manners of the present invention, the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two of the K sample points are sampled.
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。Optionally, in some possible implementation manners of the present invention, the starting point included by the sampling point pair x and the starting point included by the sampling point pair y are separated by at least 1 sampling point.
可选的,在本发明的一些可能的实施方式中,所述模板处理装置1100用于视频编码装置中或视频解码装置中。Optionally, in some possible implementation manners of the present invention, the template processing apparatus 1100 is used in a video encoding apparatus or in a video decoding apparatus.
可以理解的是,本实施例的模板处理装置1100的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。It is to be understood that the functions of the functional modules of the template processing apparatus 1100 of the present embodiment may be specifically implemented according to the method in the foregoing method embodiments. For the specific implementation process, reference may be made to the related description of the foregoing method embodiments, and details are not described herein again. .
可以看出,本实施例的方案中,模板处理装置1100获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;并在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述尺寸为
N*M的图像块的楔形模板集中。由于采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对,也就是说上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。It can be seen that, in the solution of this embodiment, the template processing apparatus 1100 acquires each of the K sample point pairs traversed by the current block template of the binarized block template of the image block of size N*M. After the corresponding binarized block template is obtained, the binarized block template corresponding to each sample point pair of the acquired K sample point pairs and the image block wedge template of size N*M are concentrated. Comparing the binarized block templates; and comparing the difference between the binarized block template i and the binarized block template j in the wedge template set, the binarization is divided Block template i is added to the size as
The wedge template of the N*M image block is concentrated. Since the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, the sampling point pair x and the sampling point pair y are any two sampling point pairs among the K sampling points. That is to say, the above-mentioned K sampling point pairs are obtained by interval sampling, which is equivalent to not obtaining the binarization corresponding to each sampling point pair of all the sampling point pairs traversed by the current blocking template. The block template, therefore, is equivalent to reducing the number of alternative binarized block templates that may be added to the wedge template set of image blocks of size N*M, which is advantageous for reducing the addition to size N*M The number of binarized block templates of the wedge template set of the image block, thereby facilitating the reduction of the number of binarized block templates in the wedge template set of the image block, thereby reducing the complexity of the video codec device.
本发明实施例还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时包括上述方法实施例中记载的任意一种信号处理方法的部分或全部步骤。The embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium can store a program, and the program includes some or all of the steps of any one of the signal processing methods described in the foregoing method embodiments.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the details that are not detailed in a certain embodiment can be referred to the related descriptions of other embodiments.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可能可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the present invention is not limited by the described action sequence. Because certain steps may be performed in other sequences or concurrently in accordance with the present invention. In addition, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided herein, it should be understood that the disclosed apparatus may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above units is only a logical function division. In actual implementation, there may be another division manner. For example, multiple units or components may be combined or integrated. Go to another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical or otherwise.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者
也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, ie may be located in one place, or
It can also be distributed to multiple network elements. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以为个人计算机、服务器或者网络设备等,具体可以是计算机设备中的处理器)执行本发明各个实施例上述方法的全部或部分步骤。其中,而前述的存储介质可包括:U盘、移动硬盘、磁碟、光盘、只读存储器(ROM,Read-Only Memory)或者随机存取存储器(RAM,Random Access Memory)等各种可以存储程序代码的介质。The above-described integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. The instructions include a plurality of instructions for causing a computer device (which may be a personal computer, server or network device, etc., and in particular a processor in a computer device) to perform all or part of the steps of the above-described methods of various embodiments of the present invention. The foregoing storage medium may include: a U disk, a mobile hard disk, a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), and the like. The medium of the code.
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。
The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the embodiments are modified, or the equivalents of the technical features are replaced by the equivalents of the technical solutions of the embodiments of the present invention.
Claims (33)
- 一种模板处理方法,其特征在于,包括:A template processing method, comprising:确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;Determining a current blocking template of the binarized blocking template of the image block of size N*M;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;Obtaining a binarized blocking template corresponding to each of the pair of sampling points of the K sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K sampling points are in a pair Different sampling points have different start points and/or different end points;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;Comparing the obtained binarized block template of each of the pair of sample points of the obtained K pairs of sampling points with the binarized block template of the wedge template set, wherein the wedge template set is a current set of wedge templates of image blocks of size N*M;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。Comparing the difference between the binarized block template i and the binarized block template j in the wedge template set according to a preset screening condition, adding the binarized block template i to The wedge template is set, wherein the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, and the binarized block The template j is any binarized blocking template in the set of wedge templates, wherein the N and the M are positive integers.
- 根据权利要求1所述的方法,其特征在于,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:The method according to claim 1, wherein the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to preset screening conditions includes:所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where The binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Differentiating; the binarized block template value of the class B pixel in the binarized block template i and the binarized block of the same pixel in the binarized block template j The template values are the same;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模 板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of class A pixels in the pixel of the binarized block template i is greater than or equal to a first threshold, and the number of class B pixels in the bins in the binarized block template i is greater than Or equal to a second threshold, wherein the second threshold is a positive integer, the binarized block template value of the class A pixel in the binarized block template i and the binarized block template j The binarized block template values of the pixels having the same coordinates are different; the binarized block mode of the class B pixels in the binarized block template i The plate value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the type A pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the number of the class B pixels in the pixel in the binarized block template i accounts for The ratio of the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the second threshold is a positive number; and the type A pixel of the binarized block template i The binarized block template value is different from the binarized block template value of the same pixel in the binarized block template j; the class B pixel in the binarized block template i The binarized block template value of the point is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization There is a class B pixel in the pixel in the block template i, wherein the fourth threshold is a positive number, wherein the binarized block template of the class A pixel in the binarized block template i The value is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarization of the class B pixel in the binarized block template i The block template value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The number of class B pixels in the pixel in the block template i is greater than or equal to a second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and the binarized block The binarized block template value of the class A pixel in the template i is different from the binarized block template value of the pixel having the same coordinate in the binarized block template j; the binarization The binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块 模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of class A pixel points in the pixel of the binarized block template i occupies the binarized block The ratio of the total number of pixel points of the template i is greater than or equal to a fourth threshold, and the number of the B-type pixel points in the pixel in the binarized blocking template i occupies the pixel of the binary-based block template i The ratio of the total amount of points is greater than or equal to a third threshold, wherein the fourth threshold is a positive number, wherein the second threshold is a positive number, and the type A pixel of the binarized block template i The binarized block template value is different from the binarized block template value of the same pixel in the binarized block template j; the class B pixel in the binarized block template i The binarized block template value of the point is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;或者or所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i, The binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j The binarized block template values of the pixel regions having the same coordinates are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarized block The binarized block template value of the same pixel region in the template j is the same;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值 不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i Binaryized block template value of the binarized block template value and the same pixel region in the binarized block template j Differentiating; the binarized block template value of the D-type pixel region in the binarized block template i and the binarized block of the pixel region having the same coordinate in the binarized block template j The template values are the same;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization There is a D-type pixel region in the pixel region in the block template i, wherein the eighth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are different; the binarized block templates of the D-type pixel regions in the binarized block template i The value is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The number of the D-type pixel regions in the pixel region in the block template i is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, the binarized block template i The binarized block template value of the C-type pixel region is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the binarized block The binarized block template value of the D-type pixel region in the template i is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。 The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The ratio of the number of the D-type pixel regions in the pixel region in the block template i to the total amount of the pixel regions of the binarized block template i is greater than or equal to a seventh threshold, and the eighth threshold is a positive number. The sixth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is the same as the pixel region in the binary block template j The binarized block template values are different; the binarized block template values of the class D pixel regions in the binarized block template i are the same as the coordinates in the binarized block template j The binarized block template values of the pixel area are the same.
- 根据权利要求1或2所述的方法,其特征在于,所述楔形模板集为楔形模板表。The method according to claim 1 or 2, wherein the set of wedge templates is a wedge template table.
- 根据权利要求1至3任一项所述的方法,其特征在于,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。The method according to any one of claims 1 to 3, characterized in that the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, the sampling point pair x and the sampling point For y, it is any two pairs of sampling points of the K sampling points.
- 根据权利要求4所述的方法,其特征在于,The method of claim 4 wherein:所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。The starting point included in the sampling point pair x and the starting point included in the sampling point pair y are separated by at least one sampling point.
- 根据权利要求1至5任一项所述的方法,其特征在于,所述模板处理方法用于视频编码过程中或视频解码过程中。The method according to any one of claims 1 to 5, characterized in that the template processing method is used in a video encoding process or in a video decoding process.
- 一种模板处理方法,其特征在于,包括:A template processing method, comprising:确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;Determining a current blocking template of the binarized blocking template of the image block of size N*M;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;Obtaining a binarized blocking template corresponding to each of the pair of sampling points of the K sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K sampling points are in a pair Different sampling points are different for the included starting point and/or the ending point, and the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, and the sampling point pair x and the sampling point pair y are Any two pairs of sampling points of the K sampling points;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;Comparing the obtained binarized block template of each of the pair of sample points of the obtained K pairs of sampling points with the binarized block template of the wedge template set, wherein the wedge template set is a current set of wedge templates of image blocks of size N*M;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。In a case where there is a difference between the binarized block template i and the binarized block template j in the wedge template set, the binarized block template i is added to the wedge template set. The binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, wherein the binarized block template j is the wedge shape Any of the binarized block templates in the set of templates, wherein the N and the M are positive integers.
- 根据权利要求7所述的方法,其特征在于,The method of claim 7 wherein:所述楔形模板集为楔形模板表。The wedge template set is a wedge template table.
- 根据权利要求7至8任一项所述的方法,其特征在于,采样点对x所包括 的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。The method according to any one of claims 7 to 8, characterized in that the sampling point pair x is included The starting point and the sampling point are not adjacent to the starting point included in y, and the sampling point pair x and the sampling point pair y are any two sampling point pairs of the K kinds of sampling points.
- 根据权利要求9所述的方法,其特征在于,The method of claim 9 wherein:所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。The starting point included in the sampling point pair x and the starting point included in the sampling point pair y are separated by at least one sampling point.
- 根据权利要求7至10任一项所述的方法,其特征在于,所述模板处理方法用于视频编码过程中或视频解码过程中。The method according to any one of claims 7 to 10, characterized in that the template processing method is used in a video encoding process or in a video decoding process.
- 一种模板处理装置,其特征在于,包括:A template processing apparatus, comprising:确定单元,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;a determining unit, configured to determine a current blocking template of the binarized blocking template of the image block of size N*M;获取单元,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;An obtaining unit, configured to acquire a binarized blocking template corresponding to each of the pair of sampling points of the K sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K species Different sampling points in the pair of sampling points have different starting points and/or different ending points;比较单元,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;a comparison unit, configured to compare the binarized block template corresponding to each sample point pair of the acquired K sample point pairs with the binarized block template in the wedge template set, wherein the wedge shape The template set is a current set of wedge templates of the image block of size N*M;添加单元,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。Adding a unit, configured to compare the difference between the binarized block template i and the binary block template j in the wedge template set according to a preset screening condition, and divide the binarization a block template i is added to the set of wedge templates, wherein the binarized block template i is a binarized block template corresponding to any one of the K pairs of sample points, wherein The binarized block template j is any binarized block template in the set of wedge templates, wherein the N and the M are positive integers.
- 根据权利要求12所述的装置,其特征在于,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:The apparatus according to claim 12, wherein the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to preset screening conditions includes:所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B 类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where The binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Different; B in the binarized block template i The binarized block template value of the pixel-like point is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of class A pixels in the pixel of the binarized block template i is greater than or equal to a first threshold, and the number of class B pixels in the bins in the binarized block template i is greater than Or equal to a second threshold, wherein the second threshold is a positive integer, the binarized block template value of the class A pixel in the binarized block template i and the binarized block template j The value of the binarized block template value of the pixel having the same coordinate is different; the binarized block template value of the class B pixel in the binarized block template i and the binarized block The binarized block template values of the same pixel points in the template j are the same;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the type A pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the number of the class B pixels in the pixel in the binarized block template i accounts for The ratio of the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the second threshold is a positive number; and the type A pixel of the binarized block template i The binarized block template value is different from the binarized block template value of the same pixel in the binarized block template j; the class B pixel in the binarized block template i The binarized block template value of the point is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization There is a class B pixel in the pixel in the block template i, wherein the fourth threshold is a positive number, wherein the binarized block template of the class A pixel in the binarized block template i The value is different from the binarized block template value of the pixel with the same coordinate in the binarized block template j; the binarization of the class B pixel in the binarized block template i The block template value is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块 模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of class A pixel points in the pixel of the binarized block template i occupies the binarized block The ratio of the total number of pixel points of the template i is greater than or equal to a fourth threshold, and the number of the B-type pixel points in the pixel in the binarized blocking template i is greater than or equal to a second threshold, wherein the The fourth threshold is a positive number, the second threshold is a positive integer, and the binarized block template value of the class A pixel in the binarized block template i and the binarized block template j The binarized block template values of the same pixel points are different; the binarized block template values of the class B pixels in the binarized block template i and the binarized block template j The binarized block template values of the same pixel points in the same are the same;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The ratio of the number of class B pixel points in the pixel in the block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number Wherein the second threshold is a positive number, the binarized block template value of the class A pixel in the binarized block template i and the coordinate in the binarized block template j The binarized block template values of the same pixel are different; the binarized block template value of the class B pixel in the binarized block template i and the binary in the binarized block template j The binarized block template values of the same coordinates are the same;或者or所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i, The binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; a binarized block template value of the D-type pixel region in the binarized block template i and a binarized block template value of the same pixel region in the binarized block template j the same;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区 域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j The binarized block template values of the pixel regions having the same coordinates are different; the D-type pixel regions in the binarized block template i The binarized block template value of the domain is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i The binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i The binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization There is a D-type pixel region in the pixel region in the block template i, wherein the eighth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are different; the binarized block templates of the D-type pixel regions in the binarized block template i The value is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The number of the D-type pixel regions in the pixel region in the block template i is greater than or equal to a sixth threshold, the eighth threshold is a positive number, and the sixth threshold is a positive integer, the binarized block template i The binarized block template value of the C-type pixel region is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the binarized block The binarized block template value of the D-type pixel region in the template i is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;或者, Or,所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The ratio of the number of the D-type pixel regions in the pixel region in the block template i to the total amount of the pixel regions of the binarized block template i is greater than or equal to a seventh threshold, and the eighth threshold is a positive number. The sixth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is the same as the pixel region in the binary block template j The binarized block template values are different; the binarized block template values of the class D pixel regions in the binarized block template i are the same as the coordinates in the binarized block template j The binarized block template values of the pixel area are the same.
- 根据权利要求12或13所述的装置,其特征在于,所述楔形模板集为楔形模板表。Apparatus according to claim 12 or claim 13 wherein the set of wedge templates is a wedge template table.
- 根据权利要求12至14任一项所述的装置,其特征在于,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。The apparatus according to any one of claims 12 to 14, wherein the starting point included in the sampling point pair x and the starting point included in the sampling point pair y are not adjacent, the sampling point pair x and the sampling point For y, it is any two pairs of sampling points of the K sampling points.
- 根据权利要求15所述的装置,其特征在于,The device of claim 15 wherein:所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。The starting point included in the sampling point pair x and the starting point included in the sampling point pair y are separated by at least one sampling point.
- 根据权利要求12至16任一项所述的装置,其特征在于,所述模板处理装置用于视频编码装置中或视频解码装置中。The apparatus according to any one of claims 12 to 16, wherein the template processing means is used in a video encoding apparatus or in a video decoding apparatus.
- 一种模板处理装置,其特征在于,包括:A template processing apparatus, comprising:确定单元,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;a determining unit, configured to determine a current blocking template of the binarized blocking template of the image block of size N*M;获取单元,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;An obtaining unit, configured to acquire a binarized blocking template corresponding to each of the pair of sampling points of the K sampling point pairs traversed by the current blocking template, where the K is a positive integer, and the K species Different sampling points in the pair of sampling points have different start points and/or end points, and the starting point included in the sampling point pair x is not adjacent to the starting point included in the sampling point pair y, the sampling point pair x and the The sampling point pair y is any two sampling point pairs of the K sampling points;比较单元,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模 板集为所述尺寸为N*M的图像块的当前楔形模板集;a comparison unit, configured to compare the binarized block template corresponding to each sample point pair of the acquired K sample point pairs with the binarized block template in the wedge template set, wherein the wedge shape Mode The set of plates is a current set of wedge templates of the image block of size N*M;添加单元,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。Adding a unit, if the difference between the binarized block template i and the binarized block template j in the wedge template set is compared, the binarized block template i is added to the a set of wedge templates, wherein the binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, wherein the binarized block template j is any binarized blocking template in the set of wedge templates, and the N and the M are positive integers.
- 根据权利要求18所述的装置,其特征在于,The device of claim 18, wherein所述楔形模板集为楔形模板表。The wedge template set is a wedge template table.
- 根据权利要求18至19任一项所述的装置,其特征在于,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。The apparatus according to any one of claims 18 to 19, characterized in that the starting point included in the sampling point pair x and the starting point included in the sampling point pair y are not adjacent, the sampling point pair x and the sampling point For y, it is any two pairs of sampling points of the K sampling points.
- 根据权利要求20所述的装置,其特征在于,The device of claim 20 wherein:所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。The starting point included in the sampling point pair x and the starting point included in the sampling point pair y are separated by at least one sampling point.
- 根据权利要求18至21任一项所述的装置,其特征在于,所述模板处理装置用于视频编码装置中或视频解码装置中。Apparatus according to any one of claims 18 to 21, wherein said template processing means is used in a video encoding apparatus or in a video decoding apparatus.
- 一种模板处理装置,其特征在于,包括:A template processing apparatus, comprising:处理器和存储器;Processor and memory;其中,所述处理器通过调用所述存储器中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所 述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。The processor is configured to determine a current blocking template of a binarized blocking template of an image block of size N*M by calling a code or an instruction in the memory; acquiring the current blocking template a binarized blocking template corresponding to each of the pair of sampling point pairs traversed, wherein the K is a positive integer, and the starting point of the different sampling point pairs of the K sampling point pairs The difference between the different and/or the end points is different; the binarized block template corresponding to each sample point pair of the obtained K sample point pairs is compared with the binarized block template in the wedge template set, wherein The wedge template set is the current wedge template set of the image block of size N*M; comparing the difference between the binarized block template i and the binarized block template j of the wedge template set In the case of a preset screening condition, the binarized block template i is added to the wedge template set, wherein the binarized block template i is any one of the K sample point pairs a pair of sampling points corresponding to the binarized block template, wherein The binarized block template j is any binarized block template in the set of wedge templates, wherein the N and the M are positive integers.
- 根据权利要求23所述的装置,其特征在于,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:The apparatus according to claim 23, wherein the difference between the binarized block template i and the binarized block template j in the set of wedge templates conforms to preset screening conditions includes:所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the A-type pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the B-type pixel points are present in the pixel in the binarized block template i, where The binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Differentiating; the binarized block template value of the class B pixel in the binarized block template i and the binarized block of the same pixel in the binarized block template j The template values are the same;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of class A pixels in the pixel of the binarized block template i is greater than or equal to a first threshold, and the number of class B pixels in the bins in the binarized block template i is greater than Or equal to a second threshold, wherein the second threshold is a positive integer, the binarized block template value of the class A pixel in the binarized block template i and the binarized block template j The value of the binarized block template value of the pixel having the same coordinate is different; the binarized block template value of the class B pixel in the binarized block template i and the binarized block The binarized block template values of the same pixel points in the template j are the same;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of the type A pixel points in the pixel of the binarized block template i is greater than or equal to the first threshold, and the number of the class B pixels in the pixel in the binarized block template i accounts for The ratio of the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the second threshold is a positive number; and the type A pixel of the binarized block template i The binarized block template value is different from the binarized block template value of the same pixel in the binarized block template j; the class B pixel in the binarized block template i The binarized block template value of the point is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块 模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The number of class A pixel points in the pixel of the binarized block template i occupies the binarized block The ratio of the total number of the pixel points of the template i is greater than or equal to the fourth threshold, and the B-type pixel is present in the pixel in the binarized block template i, wherein the fourth threshold is a positive number, wherein The binarized block template value of the class A pixel in the binarized block template i and the binarized block template value of the same pixel in the binarized block template j Differentiating; the binarized block template value of the class B pixel in the binarized block template i and the binarized block of the same pixel in the binarized block template j The template values are the same;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The number of class B pixels in the pixel in the block template i is greater than or equal to a second threshold, wherein the fourth threshold is a positive number, the second threshold is a positive integer, and the binarized block The binarized block template value of the class A pixel in the template i is different from the binarized block template value of the pixel having the same coordinate in the binarized block template j; the binarization The binarized block template value of the class B pixel in the block template i is the same as the binarized block template value of the pixel with the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;The ratio of the number of class A pixel points in the pixel of the binarized block template i to the total number of pixel points of the binarized block template i is greater than or equal to a fourth threshold, and the binarization The ratio of the number of class B pixel points in the pixel in the block template i to the total number of pixel points of the binarized block template i is greater than or equal to a third threshold, wherein the fourth threshold is a positive number Wherein the second threshold is a positive number, the binarized block template value of the class A pixel in the binarized block template i and the coordinate in the binarized block template j The binarized block template values of the same pixel are different; the binarized block template value of the class B pixel in the binarized block template i and the binary in the binarized block template j The binarized block template values of the same coordinates are the same;或者or所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板 i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the D-type pixel region exists in the pixel region in the binarized block template i, The binarized block template value of the C-type pixel region in the binarized block template i is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; Binaryized block template The binarized block template value of the D-type pixel region in i is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of the C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than Or equal to a sixth threshold, wherein the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j The binarized block template values of the pixel regions having the same coordinates are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarized block The binarized block template value of the same pixel region in the template j is the same;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of C-type pixel regions in the pixel region of the binarized block template i is greater than or equal to a fifth threshold, and the number of D-type pixel regions in the pixel region in the binarized block template i accounts for The ratio of the total number of pixel regions of the binarized block template i is greater than or equal to a seventh threshold, wherein the sixth threshold is a positive number; and the C-type pixel region of the binarized block template i The binarized block template value is different from the binarized block template value of the pixel region having the same coordinate in the binarized block template j; the class D pixel in the binarized block template i The binarized block template value of the region is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization There is a D-type pixel region in the pixel region in the block template i, wherein the eighth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is The binarized block template values of the pixel regions having the same coordinates in the binarized block template j are different; the binarized block templates of the D-type pixel regions in the binarized block template i The value is the same as the binarized block template value of the pixel region having the same coordinate in the binarized block template j;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化 分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;The number of C-type pixel regions in the pixel region of the binarized block template i occupies the binarization The ratio of the total number of pixel regions of the block template i is greater than or equal to an eighth threshold, and the number of the D-type pixel regions in the pixel region in the binarized block template i is greater than or equal to a sixth threshold. The eighth threshold is a positive number, the sixth threshold is a positive integer, the binarized block template value of the C-type pixel region in the binarized block template i and the binarized block template j The binarized block template values of the pixel regions having the same coordinates are different; the binarized block template values of the D-type pixel regions in the binarized block template i and the binarized block templates j The binarized block template value of the same pixel region in the same coordinate is the same;或者,or,所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。The ratio of the number of C-type pixel regions in the pixel region of the binarized block template i to the total number of pixel regions of the binarized block template i is greater than or equal to an eighth threshold, and the binarization The ratio of the number of the D-type pixel regions in the pixel region in the block template i to the total amount of the pixel regions of the binarized block template i is greater than or equal to a seventh threshold, and the eighth threshold is a positive number. The sixth threshold is a positive number, and the binarized block template value of the C-type pixel region in the binarized block template i is the same as the pixel region in the binary block template j The binarized block template values are different; the binarized block template values of the class D pixel regions in the binarized block template i are the same as the coordinates in the binarized block template j The binarized block template values of the pixel area are the same.
- 根据权利要求23或24所述的装置,其特征在于,所述楔形模板集为楔形模板表。The device according to claim 23 or 24, wherein the set of wedge templates is a wedge template table.
- 根据权利要求23至25任一项所述的装置,其特征在于,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。The apparatus according to any one of claims 23 to 25, wherein the starting point included in the sampling point pair x and the starting point included in the sampling point pair y are not adjacent, the sampling point pair x and the sampling point For y, it is any two pairs of sampling points of the K sampling points.
- 根据权利要求26所述的装置,其特征在于,The device of claim 26, wherein所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。The starting point included in the sampling point pair x and the starting point included in the sampling point pair y are separated by at least one sampling point.
- 根据权利要求23至27任一项所述的装置,其特征在于,所述模板处理装置用于视频编码装置中或视频解码装置中。The apparatus according to any one of claims 23 to 27, wherein the template processing means is used in a video encoding apparatus or in a video decoding apparatus.
- 一种模板处理装置,其特征在于,包括:A template processing apparatus, comprising:处理器和存储器; Processor and memory;其中,所述处理器通过调用所述存储器中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。The processor is configured to determine a current blocking template of a binarized blocking template of an image block of size N*M by calling a code or an instruction in the memory; acquiring the current blocking template a binarized blocking template corresponding to each of the pair of sampling point pairs traversed, wherein the K is a positive integer, and the starting point of the different sampling point pairs of the K sampling point pairs The difference between the sampling point pair x and the starting point of the sampling point pair y are not adjacent, and the sampling point pair x and the sampling point pair y are in the K sampling points. Comparing any two pairs of sampling points; comparing the obtained binarized blocking template of each pair of sampling points of the pair of sampling points with the binary template of the wedge template set, wherein The set of wedge templates is the current set of wedge templates of the image block of size N*M; there is a difference between comparing the binarized block template i with the binarized block template j of the wedge template set. In the case, the binarized block template i is added to the wedge template set The binarized block template i is a binarized block template corresponding to any one of the K sample point pairs, wherein the binarized block template j is the Any of the binarized block templates in the set of wedge templates, wherein N and M are positive integers.
- 根据权利要求29所述的装置,其特征在于,The device according to claim 29, wherein所述楔形模板集为楔形模板表。The wedge template set is a wedge template table.
- 根据权利要求29至30任一项所述的装置,其特征在于,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。The apparatus according to any one of claims 29 to 30, characterized in that the starting point included in the sampling point pair x and the starting point included in the sampling point pair y are not adjacent, the sampling point pair x and the sampling point For y, it is any two pairs of sampling points of the K sampling points.
- 根据权利要求31所述的装置,其特征在于,The device according to claim 31, wherein所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。The starting point included in the sampling point pair x and the starting point included in the sampling point pair y are separated by at least one sampling point.
- 根据权利要求29至32任一项所述的装置,其特征在于,所述模板处理装置用于视频编码装置中或视频解码装置中。 Apparatus according to any one of claims 29 to 32, wherein said template processing means is used in a video encoding apparatus or in a video decoding apparatus.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201580001246.3A CN105519110B (en) | 2015-02-05 | 2015-02-05 | Template processing method and relevant device |
PCT/CN2015/072344 WO2016123782A1 (en) | 2015-02-05 | 2015-02-05 | Method for template processing, and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2015/072344 WO2016123782A1 (en) | 2015-02-05 | 2015-02-05 | Method for template processing, and related device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016123782A1 true WO2016123782A1 (en) | 2016-08-11 |
Family
ID=55725081
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2015/072344 WO2016123782A1 (en) | 2015-02-05 | 2015-02-05 | Method for template processing, and related device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105519110B (en) |
WO (1) | WO2016123782A1 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100208818A1 (en) * | 2007-10-12 | 2010-08-19 | Thomson Licensing | Methods and apparatus for video encoding and decoding geometrically partitioned bii-predictive mode partitions |
CN102156868A (en) * | 2011-03-31 | 2011-08-17 | 汉王科技股份有限公司 | Image binaryzation method and device |
CN104221379A (en) * | 2011-11-11 | 2014-12-17 | 弗兰霍菲尔运输应用研究公司 | Adaptive partition coding |
CN104247427A (en) * | 2011-11-11 | 2014-12-24 | 弗兰霍菲尔运输应用研究公司 | Effective prediction using partition coding |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6046246B2 (en) * | 2012-07-02 | 2016-12-14 | クゥアルコム・インコーポレイテッドQualcomm Incorporated | Depth map intra coding for 3D video coding |
CN103826115B (en) * | 2014-03-21 | 2016-03-02 | 华为技术有限公司 | The coding and decoding processing method of Iamge Segmentation mode and device |
-
2015
- 2015-02-05 WO PCT/CN2015/072344 patent/WO2016123782A1/en active Application Filing
- 2015-02-05 CN CN201580001246.3A patent/CN105519110B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100208818A1 (en) * | 2007-10-12 | 2010-08-19 | Thomson Licensing | Methods and apparatus for video encoding and decoding geometrically partitioned bii-predictive mode partitions |
CN102156868A (en) * | 2011-03-31 | 2011-08-17 | 汉王科技股份有限公司 | Image binaryzation method and device |
CN104221379A (en) * | 2011-11-11 | 2014-12-17 | 弗兰霍菲尔运输应用研究公司 | Adaptive partition coding |
CN104247427A (en) * | 2011-11-11 | 2014-12-24 | 弗兰霍菲尔运输应用研究公司 | Effective prediction using partition coding |
Also Published As
Publication number | Publication date |
---|---|
CN105519110A (en) | 2016-04-20 |
CN105519110B (en) | 2018-09-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI665907B (en) | Method and apparatus for template-based intra prediction in image and video coding | |
US20240276006A1 (en) | Picture prediction method and related apparatus | |
US20200260117A1 (en) | Methods and Apparatuses for Coding and Decoding Depth Map | |
US9860559B2 (en) | Method of video coding using symmetric intra block copy | |
BR112020026713A2 (en) | INTRA SMOOTHING DEPENDENT COMBINATION MODE (MDIS) WITH INTRA INTERPOLATION FILTER SWITCH | |
TW202002657A (en) | Component-dependent sub-block dividing | |
JP6387582B2 (en) | Image prediction method and related apparatus | |
WO2019194496A1 (en) | Parallel processing method for color component of video signal, and device therefor | |
US20240267553A1 (en) | Filtering method for removing blocking artifact and apparatus | |
US20200396461A1 (en) | Apparatus and method for picture coding with selective loop-filtering | |
CN104581159B (en) | Block partitioning scheme in coding and decoding video determines method and relevant apparatus | |
EP3353748A1 (en) | Generation of triangle mesh for a three dimensional image | |
BR112021006798A2 (en) | wide angle intraprediction smoothing and interpolation | |
CN114731394A (en) | Position dependent intra prediction combining of angular intra prediction modes for video coding | |
WO2019114225A1 (en) | Coding unit division determining method and device, computing device and readable storage medium | |
BR112021004124A2 (en) | video decoding method and video decoder | |
WO2020140215A1 (en) | Intra-frame chromaticity prediction method and device, and computer storage medium | |
JP2015080207A (en) | Method and apparatus for simplified depth coding with extended prediction mode | |
CN113491115A (en) | Image decoding method and device based on CCLM prediction | |
JP7492067B2 (en) | Image encoding/decoding method and device using maximum size limit for chroma transform block, and method for transmitting bitstream - Patents.com | |
WO2016123782A1 (en) | Method for template processing, and related device | |
CN105637865B (en) | Image prediction processing method and relevant device | |
WO2016123774A1 (en) | Method and device for encoding and decoding | |
CN105245905A (en) | Multi-view video coding (MVC) strong filtering implementation method applied to parallel structure | |
Maceira et al. | Region-based depth map coding using a 3D scene representation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15880738 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 15880738 Country of ref document: EP Kind code of ref document: A1 |