1. An apparatus for performing video coding, comprising: (a) a computer configured for encoding and/or decoding of video; and (b) programming executable on said computer for context adaptation by performing steps comprising: (i) assuming a block within a video frame is piece-wise smooth; (ii) identifying that a discontinuity exists in the block with respect to its context of neighbors; (iii) extracting a context feature of said discontinuity having directionality and location of discontinuity within the block, with location of discontinuity extracted in response to steps, including: (iii)(1) mapping a line along a direction of discontinuity; (iii)(2) determining distance from said line to the center of a current block; (iii)(3) determining an average of said distance for said block among neighboring pixels that have significant gradients; (iii)(4) utilizing said average as the discontinuity location; and (iv) performing coding of said block as a context adaptive operation in response to said context feature.