WO2016123782A1 - 模板处理方法和相关设备 - Google Patents

模板处理方法和相关设备 Download PDF

Info

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
Application number
PCT/CN2015/072344
Other languages
English (en)
French (fr)
Inventor
陈旭
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201580001246.3A priority Critical patent/CN105519110B/zh
Priority to PCT/CN2015/072344 priority patent/WO2016123782A1/zh
Publication of WO2016123782A1 publication Critical patent/WO2016123782A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/189Methods 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/196Methods 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

一种模板处理方法和相关设备。一种模板处理方法包括:确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中。本发明实施例的技术方案有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而降低视频编解码设备的复杂度。

Description

模板处理方法和相关设备 技术领域
本发明涉及视频编解码领域,具体涉及模板处理方法和相关设备。
背景技术
目前,在视频编码和解码框架中,混合编码结构通常用于视频序列的编码和解码。
混合编码结构的编码端通常包括预测、变换、量化和熵编码等。混合编码结构的解码端通常包括:熵解码、反量化、反变换和预测补偿等。在视频编码和解码框架中,视频序列中的图像通常划分成图像块来进行编码。一幅图像可被划分成若干图像块。
目前预测技术通常包含帧内预测和帧间预测两种技术。帧内预测技术利用当前图像块的空间像素信息去除当前图像块的冗余信息以获得残差。帧间预测技术利用当前图像块邻近的已编码或已解码图像像素信息去除当前图像块的冗余信息以获得残差。在帧间预测技术里,用于帧间预测的当前图像块邻近的图像被称为参考图像。
帧内预测或帧间预测均涉及块划分(block partitioning)技术,即可将一个图像块划分成多于一个的区域(partition),然后再以所述区域为单位进行帧内预测或帧间预测。其中,常用的块划分方式两种,一种是将一个方形图像块沿水平或垂直方向划分成两个矩形区域(rectangular partition),例如图1-a和图1-b举例所示,图1-a和图1-b所示举例中,方形图像块分别沿水平与垂直方向划分成两个矩形区域。此外,另一种块划分方式是可沿任意角度将一个方形图像块划分成两个非矩形区域(non-rectangular partition),具体可以例如图1-c举例所示。
三维视频编解码涉及了深度图的编解码,其中,深度图可反映场景内物体到相机的距离,深度图具有与自然图像(例如纹理图像/彩色图像)完全不同的特性。首先,深度图由大部分的平坦区域和少部分的锐利边缘组成。其次是深度图的用途不是直接用来观看的,而是用作视点合成的辅助工具。传统编码工具在深度图像的平坦部分有很高的压缩效率,在锐利边缘区域会带来较大的 编码误差,直接导致合成的虚拟视点中有较大失真。为了在压缩平坦区域同时更好的保护边缘部分,深度图像建模模式(DMM,Depth Map Modeling mode)作为一种可选的帧内预测模式被引入到三维视频编解码框架中。
三维视频编解码过程也可使用块划分技术。例如在三维视频的深度图的编解码技术中,楔形(wedgelet)划分是一种常用方法。其原理是图像块经块划分技术可划分成两个具有任意形状的区域之后,每个区域使用一个预测值进行编码和解码操作。对深度图进行编解码通常需要使用到楔形模板集,每种尺寸的图像块均需要对应的楔形模板集,每种尺寸的图像块的楔形模板集中可包括多个二值化分块模板。
现有技术中,每种尺寸的图像块的楔形模板集中通常包括极其大量的二值化分块模板,例如尺寸为4x4的图像块的楔形模板集中通常包括86个二值化分块模板,又例如尺寸为8x8的图像块的楔形模板集中通常包括766个二值化分块模板,尺寸为16x16的图像块的楔形模板集中通常包括1350个二值化分块模板。然而,研究和实践过程中发现,一种尺寸的图像块的楔形模板集中包括大量二值化分块模板将增加视频编解码设备的复杂度。举例来说,楔形模板集中的二值化分块模板数量较多就会占用较多的存储空间进而会增加编解码设备的负担。
发明内容
本发明实施例提供模板处理方法和相关设备,以期缩减图像块的楔形模板集中的二值化分块模板数量,进而降低视频编解码设备的复杂度。
本发明实施例第一方面提供一种模板处理方法,包括:
确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;
获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;
将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;
在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。
结合第一方面,在第一方面的第一种可能的实施方式中,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值 化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板 i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
结合第一方面或第一方面的第一种可能的实施方式,在第一方面的第二种可能的实施方式中,所述楔形模板集为楔形模板表。
结合第一方面或第一方面的第一种可能的实施方式或第一方面的第二种可能的实施方式,在第一方面的第三种可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
结合第一方面的第三种可能的实施方式,在第一方面的第四种可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少 1个采样点。
结合第一方面或第一方面的第一种可能的实施方式或第一方面的第二种可能的实施方式或第一方面的第三种可能的实施方式或第一方面的第四种可能的实施方式,在第一方面的第五种可能的实施方式中,所述模板处理方法用于视频编码过程中或视频解码过程中。
本发明实施例第二方面提供一种模板处理方法,包括:
确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;
获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;
将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;
在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。
结合第二方面,在第二方面的第一种可能的实施方式中,所述楔形模板集为楔形模板表。
结合第二方面或者第二方面的第一种可能的实施方式,在第二方面的第二种可能的实施方式中,
采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
结合第二方面的第二种可能的实施方式,在第二方面的第三种可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少 1个采样点。
结合第二方面或第二方面的第一种可能的实施方式或第二方面的第二种可能的实施方式或第二方面的第三种可能的实施方式,在第二方面的第四种可能的实施方式中,
所述模板处理方法用于视频编码过程中或视频解码过程中。
本发明实施例第三方面提供一种模板处理装置,包括:
确定单元,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;
获取单元,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;
比较单元,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;
添加单元,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。
结合第三方面,在第三方面的第一种可能的实施方式中,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像 素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中 的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域 的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化 分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
结合第三方面或第三方面的第一种可能的实施方式,在第三方面的第二种可能的实施方式中,所述楔形模板集为楔形模板表。
结合第三方面或第三方面的第一种可能的实施方式或第三方面的第二种可能的实施方式,在第三方面的第三种可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
结合第三方面的第三种可能的实施方式,在第三方面的第四种可能的实施方式中,
所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
结合第三方面或第三方面的第一种可能的实施方式或第三方面的第二种可能的实施方式或第三方面的第三种可能的实施方式或第三方面的第四种可能的实施方式,在第三方面的第五种可能的实施方式中,所述模板处理装置用于视频编码装置中或视频解码装置中。
本发明实施例第四方面提供一种模板处理装置,包括:
确定单元,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。
获取单元,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K 种采样点中的任意两种采样点对;
比较单元,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;
添加单元,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。
结合第四方面,在第四方面的第一种可能的实施方式中,所述楔形模板集为楔形模板表。
结合第四方面或者第四方面的第一种可能的实施方式,在第四方面的第二种可能的实施方式中,
采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
结合第四方面的第二种可能的实施方式,在第四方面的第三种可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
结合第四方面或第四方面的第一种可能的实施方式或第四方面的第二种可能的实施方式或第四方面的第三种可能的实施方式,在第四方面的第四种可能的实施方式中,
所述模板处理装置用于视频编码装置中或视频解码装置中。
本发明实施例第五方面提供一种模板处理装置,包括:
处理器和存储器;
其中,所述处理器通过调用所述存储器中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点 不同;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。
结合第五方面,在第五方面的第一种可能的实施方式中,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化 分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化 分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块 模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
结合第五方面或第五方面的第一种可能的实施方式,在第五方面的第二种可能的实施方式中,所述楔形模板集可为楔形模板表。
结合第五方面或第五方面的第一种可能的实施方式或第五方面的第二种可能的实施方式,在第五方面的第三种可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为 所述K种采样点中的任意两种采样点对。
结合第五方面的第三种可能的实施方式,在第五方面的第四种可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
结合第五方面或第五方面的第一种可能的实施方式或第五方面的第二种可能的实施方式或第五方面的第三种可能的实施方式或第五方面的第四种可能的实施方式,在第五方面的第五种可能的实施方式中,所述模板处理装置用于视频编码装置中或视频解码装置中。
本发明实施例第六方面提供一种模板处理装置,包括:
处理器和存储器;
其中,所述处理器通过调用所述存储器中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。
结合第六方面,在第六方面的第一种可能的实施方式中,所述楔形模板集为楔形模板表。
结合第六方面或者第六方面的第一种可能的实施方式,在第六方面的第二种可能的实施方式中,
采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对 x和所述采样点对y为所述K种采样点中的任意两种采样点对。
结合第六方面的第二种可能的实施方式,在第六方面的第三种可能的实施方式中,
所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
结合第六方面或第六方面的第一种可能的实施方式或第六方面的第二种可能的实施方式或第六方面的第三种可能的实施方式,在第六方面的第四种可能的实施方式中,所述模板处理装置用于视频编码装置中或视频解码装置中。
可以看出,本发明一些实施例的技术方案中,获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集,可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。
附图说明
为了更清楚地说明本发明实施例技术方案,下面将对实施例和现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。
图1-a~图1-c为本发明实施例提供的几种图像块的划分示意图;
图2-a为本发明实施例提供的一种模板处理方法的流程示意图;
图2-b为本发明实施例提供的一种模板比较示意图;
图3为本发明实施例提供的另一种模板处理方法的流程示意图;
图4为本发明实施例提供的另一种模板处理方法的流程示意图;
图5为本发明实施例提供的另一种模板处理方法的流程示意图;
图6-a为本发明实施例提供的另一种模板处理方法的流程示意图;
图6-b~图6-g为本发明实施例提供的几种模板采样起点和终点的分布边界的示意图;
图6-h为本发明实施例提供的一种起点间隔采样的示意图;
图7为本发明实施例提供的另一种模板处理方法的流程示意图;
图8为本发明实施例提供的一种模板处理装置的示意图;
图9为本发明实施例提供的另一种模板处理装置的示意图;
图10为本发明实施例提供的另一种模板处理装置的示意图;
图11为本发明实施例提供的另一种模板处理装置的示意图。
具体实施方式
本发明实施例提供模板处理方法和相关设备,以期缩减图像块的楔形模板集中的二值化分块模板数量,进而降低视频编解码设备的复杂度。
为使得本发明的发明目的、特征、优点能够更加的明显和易懂,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,下面所描述的实施例仅仅是本发明的一部分实施例,而非全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包括。例如包括了一系列步骤或单元的过程、方法、***、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
本发明模板处理方法的一个实施例。一种模板处理方法可包括:确定尺寸 为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。
首先参见图2-a,图2-a为本发明的一个实施例提供的一种模板处理方法的流程示意图。其中,如图2-a所示,本发明的一个实施例提供的一种模板处理方法可以包括:
201、确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。
其中,所述N和所述M为正整数。
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。
例如所述N可等于2、4、8、16、30、64或其他值。
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。
其中,不同尺寸的图像块和不同二值化分块模板的当前分块模板之间具有 映射关系,因此基于图像块的尺寸,可确定与之对应的二值化分块模板的当前分块模板。
202、获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板。其中,所述K为正整数。所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同。
其中,所述K种采样点对例如可为所述当前分块模板所能遍历的部分或全部采样点对。
例如所述K可等于1、2、3、4、10、15、30、50、65或其他值。
203、将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较。其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集。
204、在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中。其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板。所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板。
其中,由于所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,因此换句话说,对于所述K种采样点对中的每一种采样点对所对应的二值化分块模板,均可将其与所述尺寸为N*M的图像块的当前楔形模板集中的各个二值化分块模板进行比较,在其与所述尺寸为N*M的图像块的当前楔形模板集中的任意一个二值化分块模板之间的差异均符合预设的筛选条件的情况下,便可将其添加到尺寸为N*M的图像块的当前楔形模板集中。可以理解,随着二值化分块模板的逐步添加,尺寸为N*M的图像块的当前楔形模板集中的二值化分块模板的数量将逐步增加。
可以理解,在本发明的各实施例中,尺寸为N*M的图像块的楔形模板集中的各二值化分块模板对应的尺寸为N*M。
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸 为N*M的图像块进行预测。
可以看出,本实施例方案中,获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集(这也是现有技术导致楔形模板集中二值化分块模板数量巨大的主要原因),可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。
其中,预设的筛选条件可以根据需要来灵活设定,预设的筛选条件可能是多种多样的。
例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同。
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,所述第二阈值为正整数,所述 二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同。
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类 像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同。
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;其中,所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同。
其中,第一阈值例如可等于10、15、23、30、50或其他值。
其中,第二阈值例如可等于1、2、5、10、20或其他值。
其中,第三阈值例如可等于1%、2%、3%、5%、10%或其他值。
其中,第四阈值例如可等于90%、80%、71%、65%、95%或其他值。
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;其中,所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值 为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,例如可以包括:所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件,可包括:所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模 板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
又例如,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件可包括:所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
其中,一个像素区域中可包括至少两个像素点。
其中,第五阈值例如可等于4、5、8、10、20或其他值。
其中,第六阈值例如可等于1、2、5、8、11或其他值。
其中,第七阈值例如可等于1%、2%、3%、5%、10%或其他值。
其中,第八阈值例如可等于91%、80%、71%、65%、95%或其他值。
参见图2-b,图2-b为两个二值化分块模板的比较示意图,图中的两个二值化分块模板的均为黑色的位置的像素点的二值化分块模板值相同,图中的两个二值化分块模板的均为白色的位置的像素点的二值化分块模板值相同。左边的二值化分块模板的像素点为白色而右边的二值化分块模板的像素点为灰色的那些位置的像素点的二值化分块模板值不同。
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点,
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。
可选的,在本发明的一些可能的实施方式中,所述模板处理方法可以用于视频编码过程中或视频解码过程中。举例来说,在视频编码过程中或视频解码过程中,例如所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。即可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。也即是所,所述模板处理方法的执行主体可以是视频编码装置或视频解码装置。该视频编码装置或视频解码装置可以是任何需要输出或存储视频的装置,如笔记本电脑、平板电脑、个人电脑、手机、数字电视或视频服务器等设备。
本发明模板处理方法的另一实施例。另一种模板处理方法包括:确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的 二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。
请参见图3,图3为本发明的另一个实施例提供的另一种模板处理方法的流程示意图。其中,如图3所示,本发明的另一个实施例提供的另一种模板处理方法可以包括:
301、确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。
其中,所述N和所述M为正整数。
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。
例如所述N可等于2、4、8、16、30、64或其他值。
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。
302、获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板。其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
例如所述K可等于2、3、4、10、15、30、50、65或其他值。
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点,
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。
303、将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集。
304、在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板。其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板。
其中,由于所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,因此换句话说,对于所述K种采样点对中的每一种采样点对所对应的二值化分块模板,均可将其与所述尺寸为N*M的图像块的当前楔形模板集中的各个二值化分块模板进行比较,在其与所述尺寸为N*M的图像块的当前楔形模板集中的任意一个二值化分块模板之间的差异均符合预设的筛选条件的情况下,便可将其添加到尺寸为N*M的图像块的当前楔形模板集中。可以理解,随着二值化分块模板的逐步添加,尺寸为N*M的图像块的 当前楔形模板集中的二值化分块模板的数量将逐步增加。
其中,二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异例如可包括:所述二值化分块模板i的像素点中存在A类像素点,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同。
又例如,二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异可包括:所述二值化分块模板i的像素区域中存在C类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同。
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。
可以看出,本实施例方案中,获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;并在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中。由于采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对,也就是说上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。
可选的,在本发明的一些可能的实施方式中,所述模板处理方法可以用于视频编码过程中或视频解码过程中。举例来说,在视频编码过程中或视频解码过程中,例如所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。即可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。也即是说,所述模板处理方法的执行主体可以是视频编码装置或视频解码装置。该视频编码装置或视频解码装置可以是任何需要输出或存储视频的装置,如笔记本电脑、平板电脑、个人电脑、手机、数字电视或视频服务器等设备。
为便于更好的理解和实施本发明实施例的上述方案,下面结合一些具体的应用场景进行举例说明。
请参见图4,图4为本发明的另一个实施例提供的另一种模板处理方法的流程示意图。本实施例从视频编码装置的角度进行举例描述。如图4所示,本发明的另一个实施例提供的另一种模板处理方法可以包括:
401、视频编码装置确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。
其中,所述N和所述M为正整数。
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。
例如所述N可等于2、4、8、16、30、64或其他值。
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。
其中,不同尺寸的图像块和不同二值化分块模板的当前分块模板之间具有 映射关系,因此基于图像块的尺寸,可确定与之对应的二值化分块模板的当前分块模板。
402、视频编码装置获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板。其中,所述K为正整数。所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同。
其中,所述K种采样点对例如可为所述当前分块模板所能遍历的部分或全部采样点对。
例如所述K可等于1、2、3、4、10、15、30、50、65或其他值。
403、视频编码装置设置f=1。
404、视频编码装置设置g=1。
405、视频编码装置将获取的所述K种采样点对中的第f种采样点对所对应的二值化分块模板与楔形模板集中的第g个二值化分块模板进行比较。所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集。
406、视频编码装置判断第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间的差异是否符合预设的筛选条件。
若是,则执行步骤407。
若否,则执行步骤410。
407、g=g+1。
408、判断g是否大于所述楔形模板集当前包括的二值化分块模板总数。
若是,则执行步骤409。
若否,则执行步骤405。
其中,第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间的差异是否符合预设的筛选条件的判决方式,可参考上述实施例中的关于二值化分块模板i与二值化分块模板j之间的差异是否符合预设的筛选条件的判决方式,此处不在赘述。
409、视频编码装置将第f种采样点对所对应的二值化分块模板添加到所述楔形模板集中。
410、f=f+1。
411、视频编码装置判断所述f是否大于所述K。
若否,则执行步骤404。
若是,则结束流程。
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点。
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。
可以看出,本实施例方案中,视频编码装置获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进 行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集(这也是现有技术导致楔形模板集中二值化分块模板数量巨大的主要原因),可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编码设备的复杂度。
请参见图5,图5为本发明的另一个实施例提供的另一种模板处理方法的流程示意图。本实施例从视频解码装置的角度进行举例描述。如图5所示,本发明的另一个实施例提供的另一种模板处理方法可以包括:
501、视频解码装置确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。
其中,所述N和所述M为正整数。
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。
例如所述N可等于2、4、8、16、30、64或其他值。
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。
其中,不同尺寸的图像块和不同二值化分块模板的当前分块模板之间具有 映射关系,因此基于图像块的尺寸,可确定与之对应的二值化分块模板的当前分块模板。
502、视频解码装置获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板。其中,所述K为正整数。所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同。
其中,所述K种采样点对例如可为所述当前分块模板所能遍历的部分或全部采样点对。
例如所述K可等于1、2、3、4、10、15、30、50、65或其他值。
503、视频解码装置设置f=1。
504、设置g=1。
505、视频解码装置将获取的所述K种采样点对中的第f种采样点对所对应的二值化分块模板与楔形模板集中的第g个二值化分块模板进行比较。所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集。
506、视频解码装置判断第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间的差异是否符合预设的筛选条件。
若是,则执行步骤507。
若否,则执行步骤510。
507、g=g+1。
508、判断g是否大于所述楔形模板集当前包括的二值化分块模板总数。
若是,则执行步骤509。
若否,则执行步骤505。
其中,第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间的差异是否符合预设的筛选条件的判决方式,可参考上述实施例中的关于二值化分块模板i与二值化分块模板j之间的差异是否符合预设的筛选条件的判决方式,此处不在赘述。
509、视频解码装置将第f种采样点对所对应的二值化分块模板添加到所述楔形模板集中。
510、f=f+1。
511、视频解码装置判断所述f是否大于所述K。
若否,则执行步骤504。
若是,则结束流程。
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点。
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。
可以看出,本实施例的方案中,视频解码装置获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板 进行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集(这也是现有技术导致楔形模板集中二值化分块模板数量巨大的主要原因),可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频解码设备的复杂度。
请参见图6-a,图6-a为本发明的另一个实施例提供的另一种模板处理方法的流程示意图。本实施例从视频编码装置的角度进行举例描述。其中,如图6-a所示,本发明的另一个实施例提供的另一种模板处理方法可以包括:
601、视频编码装置确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。
其中,所述N和所述M为正整数。
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。
例如所述N可等于2、4、8、16、30、64或其他值。
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。
602、视频编码装置获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板。其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
例如所述K可等于2、3、4、10、15、30、50、65或其他值。
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点,
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。
例如图6-b~图6-g举例所示,图6-b~图6-g举例示出了某种采样点对的起点和终点可能位于的边界位置,其中,图中具有箭头的边界位置为采样点对的起点和终点可能位于的边界位置。
例如图6-h所示,图6-h举例示出了通过起点隔采样来得到的上述K种采样点对的方式。
603、视频编码装置设置f=1。
604、视频编码装置设置g=1。
605、视频编码装置将获取的所述K种采样点对中的第f种采样点对所对应的二值化分块模板与楔形模板集中的第g个二值化分块模板进行比较,所述楔 形模板集为所述尺寸为N*M的图像块的当前楔形模板集。
606、视频编码装置判断第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间是否存在差异。
若是,则执行步骤607。
若否,则执行步骤610。
607、g=g+1。
608、判断g是否大于所述楔形模板集当前包括的二值化分块模板总数。
若是,则执行步骤609。
若否,则执行步骤605。
其中,第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间是否存在差异的判决方式,可参考上述实施例中的关于二值化分块模板i与二值化分块模板j之间是否存在差异的判决方式,此处不在赘述。
609、视频编码装置将第f种采样点对所对应的二值化分块模板添加到所述楔形模板集中。
610、f=f+1。
611、视频编码装置判断所述f是否大于所述K。
若否,则执行步骤604。
若是,则结束流程。
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。
可以看出,本实施例方案中,视频编码装置获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进 行比较;并在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中。由于采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对,也就是说上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编码设备的复杂度。
请参见图7,图7为本发明的另一个实施例提供的另一种模板处理方法的流程示意图。本实施例从视频解码装置的角度进行举例描述。如图6所示,本发明的另一个实施例提供的另一种模板处理方法可以包括:
701、视频解码装置确定尺寸为N*M的图像块的二值化分块模板的当前分块模板。
其中,所述N和所述M为正整数。
其中,所述N可等于或不等于M,例如所述N可大于或小于所述M。
可选的,在本发明的一些可能的实施方式中,所述N例如可等于2的正整数次幂。所述N例如也可等于2的正整数次幂。
例如所述N可等于2、4、8、16、30、64或其他值。
举例来说,尺寸为N*M的图像块例如可为尺寸为2*2的图像块、尺寸为4*4的图像块、尺寸为8*8的图像块、尺寸为16*16的图像块、尺寸为32*32的图像块或尺寸为64*64的图像块、尺寸为8*16的图像块、尺寸为32*16的图像块或其他尺寸的图像块。
其中,本发明的各实施例提及的图像块可指深度图的图像块或其他类型图像的图像块。例如,上述尺寸为N*M的图像块可为深度图的尺寸为N*M的图像块。
702、视频解码装置获取所述当前分块模板所遍历的K种采样点对中的每 种采样点对所对应的二值化分块模板。其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
例如所述K可等于2、3、4、10、15、30、50、65或其他值。
可以理解,若上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这也有利于进一步减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点,即所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔1个或1个以上的采样点,
可选的,在本发明的一些可能的实施方式中,采样点对x2所包括的起点和采样点对y2所包括的起点不相邻,所述采样点对x2和所述采样点对y2为所述K种采样点中的其中两种采样点对。
703、视频解码装置设置f=1。
704、视频解码装置设置g=1。
705、视频解码装置将获取的所述K种采样点对中的第f种采样点对所对应的二值化分块模板与楔形模板集中的第g个二值化分块模板进行比较,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集。
706、视频解码装置判断第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间是否存在差异。
若是,则执行步骤707。
若否,则执行步骤710。
707、g=g+1。
708、判断g是否大于所述楔形模板集当前包括的二值化分块模板总数。
若是,则执行步骤709。
若否,则执行步骤705。
其中,第f种采样点对所对应的二值化分块模板与所述楔形模板集中的第g个二值化分块模板之间是否存在差异的判决方式,可参考上述实施例中的关于二值化分块模板i与二值化分块模板j之间是否存在差异的判决方式,此处不在赘述。
709、视频解码装置将第f种采样点对所对应的二值化分块模板添加到所述楔形模板集中。
710、f=f+1。
711、视频解码装置判断所述f是否大于所述K。
若否,则执行步骤704。
若是,则结束流程。
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。
其中,所述尺寸为N*M的图像块的楔形模板集可被用于对尺寸为N*M的图像块进行预测等。例如,还可利用尺寸为N*M的图像块的楔形模板集对尺寸为N*M的图像块进行预测。
可以看出,本实施例方案中,视频解码装置获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;并在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中。由于采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对,也就是说上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二 值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频解码设备的复杂度。
下面再通过更为具体的一些应用场景进行举例介绍。
在本发明各实施例中可将深度图的图像块简称为深度图像块。
举例场景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的深度图像块的楔形模板集中。
举例场景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的深度图像块的楔形模板集中。
举例场景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的深度图像块的楔形模板集中。
可以理解,本发明实施例提及的二值化分块模板的像素点中的存在的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类像素区域的概念可以此类推。
参见图8,本发明实施例提供的一种模板处理装置800,可包括:
确定单元810,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;
获取单元820,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;
比较单元830,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;
添加单元840,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。
可选的,在本发明的一些可能的实施方式中,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的 与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相 同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
可选的,在本发明的一些可能的实施方式中,所述楔形模板集例如可为楔形模板表。
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
可选的,在本发明的一些可能的实施方式中,所述模板处理装置用于视频编码装置中或视频解码装置中。
可以理解的是,本实施例的模板处理装置800的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
可以看出,本实施例的方案中,模板处理装置800获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对 备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集(这也是现有技术导致楔形模板集中二值化分块模板数量巨大的主要原因),可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频解码设备的复杂度。
参见图9,本发明实施例提供的一种模板处理装置900,可包括:
确定单元910,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;
获取单元920,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;
比较单元930,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;
添加单元940,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。
可选的,在本发明的一些可能的实施方式中,所述楔形模板集可以为楔形模板表。
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
可选的,在本发明的一些可能的实施方式中,
所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
可选的,在本发明的一些可能的实施方式中,所述模板处理装置900用于视频编码装置中或视频解码装置中。
可以理解的是,本实施例的模板处理装置900的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
可以看出,本实施例的方案中,模板处理装置900获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;并在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中。由于采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对,也就是说上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。
参见图10,本发明实施例提供的一种模板处理装置1000,可包括:
处理器1002和存储器1003。其中,处理器1002和存储器1003通过总线1001耦合连接。
所述处理器1002通过调用所述存储器1003中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板 所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。
可选的,在本发明的一些可能的实施方式中,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一 阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化 分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
或者
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化 分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
或者,
所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
可选的,在本发明的一些可能的实施方式中,所述楔形模板集可以为楔形模板表。
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种 采样点中的任意两种采样点对。
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
可选的,在本发明的一些可能的实施方式中,所述模板处理装置1000用于视频编码装置中或视频解码装置中。
可以理解的是,本实施例的模板处理装置1000的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
可以看出,本实施例的方案中,模板处理装置1000获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述尺寸为N*M的图像块的楔形模板集中,其中,由于引入了筛选条件来对备选的二值化分块模板进行筛选,将符合筛选条件来的备选二值化分块模板加入尺寸为N*M的图像块的楔形模板集,而传统技术中是将与楔形模板集中的二值化分块模板存在差异的所有备选的二值化分块模板均加入到楔形模板集(这也是现有技术导致楔形模板集中二值化分块模板数量巨大的主要原因),可见上述方案有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频解码设备的复杂度。
参见图11,本发明实施例提供的一种模板处理装置1100,可包括:
处理器1102和存储器1103。其中,处理器1102和存储器1103通过总线1101耦合连接。
所述处理器1102通过调用所述存储器1103中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所 述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。
可选的,在本发明的一些可能的实施方式中,所述楔形模板集可为楔形模板表。
可选的,在本发明的一些可能的实施方式中,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
可选的,在本发明的一些可能的实施方式中,所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
可选的,在本发明的一些可能的实施方式中,所述模板处理装置1100用于视频编码装置中或视频解码装置中。
可以理解的是,本实施例的模板处理装置1100的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。
可以看出,本实施例的方案中,模板处理装置1100获取尺寸为N*M的图像块的二值化分块模板的当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板后,将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与尺寸为N*M的图像块楔形模板集中的二值化分块模板进行比较;并在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述尺寸为 N*M的图像块的楔形模板集中。由于采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对,也就是说上述K种采样点对是通过间隔采样来得到的,那么就相当于未获取所述当前分块模板所遍历的全部采样点对中的每种采样点对所对应的二值化分块模板,因此,相当于减少了可能被添加到尺寸为N*M的图像块的楔形模板集的备选的二值化分块模板的数量,这有利于减少添加到尺寸为N*M的图像块的楔形模板集的二值化分块模板的数量,进而有利于缩减图像块的楔形模板集中的二值化分块模板数量,进而有利于降低视频编解码设备的复杂度。
本发明实施例还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时包括上述方法实施例中记载的任意一种信号处理方法的部分或全部步骤。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可能可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置,可通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者 也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
上述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以为个人计算机、服务器或者网络设备等,具体可以是计算机设备中的处理器)执行本发明各个实施例上述方法的全部或部分步骤。其中,而前述的存储介质可包括:U盘、移动硬盘、磁碟、光盘、只读存储器(ROM,Read-Only Memory)或者随机存取存储器(RAM,Random Access Memory)等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (33)

  1. 一种模板处理方法,其特征在于,包括:
    确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;
    获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;
    将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;
    在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。
  2. 根据权利要求1所述的方法,其特征在于,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:
    所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模 板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块 模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者
    所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值 不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
  3. 根据权利要求1或2所述的方法,其特征在于,所述楔形模板集为楔形模板表。
  4. 根据权利要求1至3任一项所述的方法,其特征在于,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
  5. 根据权利要求4所述的方法,其特征在于,
    所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
  6. 根据权利要求1至5任一项所述的方法,其特征在于,所述模板处理方法用于视频编码过程中或视频解码过程中。
  7. 一种模板处理方法,其特征在于,包括:
    确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;
    获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;
    将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;
    在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。
  8. 根据权利要求7所述的方法,其特征在于,
    所述楔形模板集为楔形模板表。
  9. 根据权利要求7至8任一项所述的方法,其特征在于,采样点对x所包括 的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
  10. 根据权利要求9所述的方法,其特征在于,
    所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
  11. 根据权利要求7至10任一项所述的方法,其特征在于,所述模板处理方法用于视频编码过程中或视频解码过程中。
  12. 一种模板处理装置,其特征在于,包括:
    确定单元,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;
    获取单元,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;
    比较单元,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;
    添加单元,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。
  13. 根据权利要求12所述的装置,其特征在于,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:
    所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B 类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块 模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者
    所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区 域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
  14. 根据权利要求12或13所述的装置,其特征在于,所述楔形模板集为楔形模板表。
  15. 根据权利要求12至14任一项所述的装置,其特征在于,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
  16. 根据权利要求15所述的装置,其特征在于,
    所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
  17. 根据权利要求12至16任一项所述的装置,其特征在于,所述模板处理装置用于视频编码装置中或视频解码装置中。
  18. 一种模板处理装置,其特征在于,包括:
    确定单元,用于确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;
    获取单元,用于获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;
    比较单元,用于将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模 板集为所述尺寸为N*M的图像块的当前楔形模板集;
    添加单元,用于在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。
  19. 根据权利要求18所述的装置,其特征在于,
    所述楔形模板集为楔形模板表。
  20. 根据权利要求18至19任一项所述的装置,其特征在于,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
  21. 根据权利要求20所述的装置,其特征在于,
    所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
  22. 根据权利要求18至21任一项所述的装置,其特征在于,所述模板处理装置用于视频编码装置中或视频解码装置中。
  23. 一种模板处理装置,其特征在于,包括:
    处理器和存储器;
    其中,所述处理器通过调用所述存储器中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件的情况下,将所述二值化分块模板i添加到所述楔形模板集中,其中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所 述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,其中,所述N和所述M为正整数。
  24. 根据权利要求23所述的装置,其特征在于,所述二值化分块模板i与所述楔形模板集中的二值化分块模板j之间的差异符合预设的筛选条件包括:
    所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,并且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量大于或者等于第一阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第二阈值为正数;所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块 模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中存在B类像素点,其中,所述第四阈值为正数,其中,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量大于或等于第二阈值,其中,所述第四阈值为正数,所述第二阈值为正整数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素点中的A类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第四阈值,且所述二值化分块模板i中的像素点中的B类像素点的数量占所述二值化分块模板i的像素点总量的比例大于或者等于第三阈值,其中,所述第四阈值为正数,其中,所述第二阈值为正数,所述二值化分块模板i中的A类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值不同;所述二值化分块模板i中的B类像素点的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素点的二值化分块模板值相同;
    或者
    所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板 i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,并且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,其中,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量大于或者等于第五阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,其中,所述第六阈值为正数;所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中存在D类像素区域,其中,所述第八阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化 分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量大于或等于第六阈值,所述第八阈值为正数,所述第六阈值为正整数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同;
    或者,
    所述二值化分块模板i的像素区域中的C类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第八阈值,且所述二值化分块模板i中的像素区域中的D类像素区域的数量占所述二值化分块模板i的像素区域总量的比例大于或者等于第七阈值,所述第八阈值为正数,所述第六阈值为正数,所述二值化分块模板i中的C类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值不同;所述二值化分块模板i中的D类像素区域的二值化分块模板值与所述二值化分块模板j中的与之坐标相同的像素区域的二值化分块模板值相同。
  25. 根据权利要求23或24所述的装置,其特征在于,所述楔形模板集为楔形模板表。
  26. 根据权利要求23至25任一项所述的装置,其特征在于,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
  27. 根据权利要求26所述的装置,其特征在于,
    所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
  28. 根据权利要求23至27任一项所述的装置,其特征在于,所述模板处理装置用于视频编码装置中或视频解码装置中。
  29. 一种模板处理装置,其特征在于,包括:
    处理器和存储器;
    其中,所述处理器通过调用所述存储器中的代码或指令以用于,确定尺寸为N*M的图像块的二值化分块模板的当前分块模板;获取所述当前分块模板所遍历的K种采样点对中的每种采样点对所对应的二值化分块模板,其中,所述K为正整数,所述K种采样点对中的不同采样点对所包括的起点不同和/或终点不同,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对;将获取的所述K种采样点对中的每种采样点对所对应的二值化分块模板与楔形模板集中的二值化分块模板进行比较,其中,所述楔形模板集为所述尺寸为N*M的图像块的当前楔形模板集;在比较出二值化分块模板i与所述楔形模板集中的二值化分块模板j之间存在差异的情况下,将所述二值化分块模板i添加到所述楔形模板集中,所述二值化分块模板i为所述K种采样点对中的任意一种采样点对所对应的二值化分块模板,其中,所述二值化分块模板j为所述楔形模板集中的任意一种二值化分块模板,所述N和所述M为正整数。
  30. 根据权利要求29所述的装置,其特征在于,
    所述楔形模板集为楔形模板表。
  31. 根据权利要求29至30任一项所述的装置,其特征在于,采样点对x所包括的起点和采样点对y所包括的起点不相邻,所述采样点对x和所述采样点对y为所述K种采样点中的任意两种采样点对。
  32. 根据权利要求31所述的装置,其特征在于,
    所述采样点对x所包括的起点和采样点对y所包括的起点之间间隔至少1个采样点。
  33. 根据权利要求29至32任一项所述的装置,其特征在于,所述模板处理装置用于视频编码装置中或视频解码装置中。
PCT/CN2015/072344 2015-02-05 2015-02-05 模板处理方法和相关设备 WO2016123782A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201580001246.3A CN105519110B (zh) 2015-02-05 2015-02-05 模板处理方法和相关设备
PCT/CN2015/072344 WO2016123782A1 (zh) 2015-02-05 2015-02-05 模板处理方法和相关设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/072344 WO2016123782A1 (zh) 2015-02-05 2015-02-05 模板处理方法和相关设备

Publications (1)

Publication Number Publication Date
WO2016123782A1 true WO2016123782A1 (zh) 2016-08-11

Family

ID=55725081

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/072344 WO2016123782A1 (zh) 2015-02-05 2015-02-05 模板处理方法和相关设备

Country Status (2)

Country Link
CN (1) CN105519110B (zh)
WO (1) WO2016123782A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
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 (zh) * 2011-03-31 2011-08-17 汉王科技股份有限公司 图像二值化方法和装置
CN104221379A (zh) * 2011-11-11 2014-12-17 弗兰霍菲尔运输应用研究公司 自适应分区编码
CN104247427A (zh) * 2011-11-11 2014-12-24 弗兰霍菲尔运输应用研究公司 使用分区编码的有效预测

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6046246B2 (ja) * 2012-07-02 2016-12-14 クゥアルコム・インコーポレイテッドQualcomm Incorporated 3dビデオコーディングのための深度マップのイントラコーディング
CN103826115B (zh) * 2014-03-21 2016-03-02 华为技术有限公司 图像分割方式的编解码处理方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
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 (zh) * 2011-03-31 2011-08-17 汉王科技股份有限公司 图像二值化方法和装置
CN104221379A (zh) * 2011-11-11 2014-12-17 弗兰霍菲尔运输应用研究公司 自适应分区编码
CN104247427A (zh) * 2011-11-11 2014-12-24 弗兰霍菲尔运输应用研究公司 使用分区编码的有效预测

Also Published As

Publication number Publication date
CN105519110A (zh) 2016-04-20
CN105519110B (zh) 2018-09-28

Similar Documents

Publication Publication Date Title
TWI665907B (zh) 用於圖像和視訊編碼的基於模板的圖框內預測的方法和裝置
US20200260117A1 (en) Methods and Apparatuses for Coding and Decoding Depth Map
US20200244983A1 (en) Picture prediction method and related apparatus
US9860559B2 (en) Method of video coding using symmetric intra block copy
BR112020026713A2 (pt) Modo de combinação dependente de suavização intra (mdis) com comutação de filtro de interpolação intra
TW202002657A (zh) 成分依賴的子區塊分割
US11343504B2 (en) Apparatus and method for picture coding with selective loop-filtering
WO2020132294A1 (en) Adaptive loop filtering classification in video coding
JP6387582B2 (ja) 画像予測方法および関連する装置
EP3353748A1 (en) Generation of triangle mesh for a three dimensional image
WO2019194496A1 (ko) 비디오 신호의 컬러 컴포넌트에 대한 병렬 처리 방법 및 이를 위한 장치
KR102214937B1 (ko) 디블로킹 필터 방법 및 장치
BR112021006798A2 (pt) suavização e interpolação de intrapredição de ângulo amplo
EP3282701A1 (en) Prediction mode selection method, apparatus and device
WO2019114225A1 (zh) 编码单元划分确定方法及装置、计算设备及可读存储介质
WO2020140215A1 (zh) 色度帧内预测方法和装置、及计算机存储介质
BR112021004124A2 (pt) método de decodificação de vídeo e decodificador de vídeo
WO2019160795A1 (en) Intra prediction for 360-degree video
CN114731394A (zh) 用于视频编解码的角度帧内预测模式的位置相关帧内预测组合
JP2015080207A (ja) 拡張予測モードを有する簡易深度符号化の方法と装置
JP7492067B2 (ja) クロマ変換ブロックの最大サイズ制限を用いた画像符号化/復号化方法、装置、及びビットストリームを伝送する方法
WO2016123782A1 (zh) 模板处理方法和相关设备
WO2016123783A1 (zh) 图像预测处理方法和相关设备
WO2016123774A1 (zh) 编解码方法和编解码器
CN105245905A (zh) 一种用于并行结构的多视点视频编码强滤波实现方法

Legal Events

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

Ref document number: 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