1. An apparatus comprising: a memory; a processor coupled to the memory and configured to: extract a video object having an arbitrary shape from an image and then divide the video object into blocks; generate a rectangular block of transform coefficients comprising applying a discrete separable unitary transform to a rectangular boundary block of the video object as extracted and divided, wherein the transform coefficients comprise a number of zero-valued transform coefficients greater than or equal to a number of masked pixels, and wherein the transform coefficients comprise at least one non-zero-valued transform coefficient; and generate an encoded output comprising compressing only the non-zero-valued transform coefficients, wherein a number of non-zero-valued transform coefficients is equal to a number of unmasked pixels in the boundary block, and wherein a number of zero-valued transform coefficients is equal to a number of masked pixels in the boundary block, wherein the boundary block has a symmetric size, wherein each pixel in the boundary block is either a masked pixel or an unmasked pixel, wherein each set of pixels is a row or a column of the boundary block, wherein each set of pixels comprises sequentially pixels at a first, a second, a third, and a fourth locations, wherein, when a set comprises two masked pixels and two unmasked pixels, the processor is further configured to: rearrange the set and assign two values to the two masked pixels such that an even sequence is created and generate two non-zero transform coefficients based on the even sequence when the two masked pixels are at the first and the fourth locations or at the second and third locations; and assign two values to the two masked pixels such that an even sequence is created and generate two non-zero transform coefficients based on the even sequence when the two masked pixels are at the first and the second locations, or at the first and the third locations, or at the second and the fourth locations, or at the third and fourth locations.