Patent ID: 9635389
Date: 2017-04-25
CPC Classifications: H04N

Claim:
1. A method of compressing a binary mask in a computing device comprising a processor and a data storage device in communication with the processor, the method comprising: receiving, by a computing device, a binary mask; determining that the binary mask comprises a plurality of pixel values and spatial data describing a spatial arrangement of the plurality of pixel values on a two-dimensional grid described by an x-axis and a y-axis; determining, by the computing device, for a first pixel value of the plurality of pixel values at a first pixel position on the two-dimensional grid, a first predicted pixel value based at least in part on a set of pixel values of the plurality of pixel values that are adjacent to first pixel value according to the spatial arrangement of the plurality of pixel values; generating, by the computing device, a predicted binary mask comprising a second plurality of pixel values and second spatial data describing a spatial arrangement of the second plurality of pixel values on the two-dimensional grid, wherein the second plurality of pixel values comprises the first predicted pixel value and wherein the second spatial data describes the first predicted pixel value at the first pixel position on the two-dimensional grid; determining, by the computing device, a difference between the binary mask and the predicted binary mask, wherein the difference is a filtered binary mask comprising a third plurality of pixel values and third spatial data describing a third spatial arrangement of the third plurality of pixel values on the two-dimensional grid; determining, by the computing device, a first sequence of the third plurality of pixel values that comprise a plurality of rows from the third spatial arrangement ordered according to a positioning of the plurality of rows on the y-axis; determining, by the computing device, that a frequency of asserted pixel values in the third plurality of pixel values is less than a threshold frequency; selecting, by the computing device, a pixel value block size associated with the threshold frequency; determining, by the computing device, a first run length number of pixel value blocks of the pixel value block size in the first sequence that include only not asserted pixel values; writing, by the computing device, the first run length number to a first compression sequence; and writing, by the computing device, to a second compression sequence a pixel value block positioned in the first sequence after the first run length number in the first sequence; determining, by the computing device, that a frequency of pixel value blocks in the second compression sequence having a first pattern of asserted pixel values is greater than a block frequency threshold; determining, by the computing device, a second run length number of pixel values blocks in the second compression sequence having the first pattern of asserted pixel values; and writing, by the computing device, the second run length number to the first compression sequence.