A method provides for encoding a frame of video using an edge map made up of one or more edge-blocks detected in the frame. When the edge-blocks are contiguous, at least one slice partition is formed using the edge-blocks and the slice partition is encoded using a sample adaptive offset (SAO) filter, wherein the slice partition is formed with an adaptive slice width, and the sample adaptive offset (SAO) filter is turned on or off during the encoding based on whether the edge-blocks are being encoded. When the edge-blocks are not contiguous, edge-block processing is performed around edges in the frame during encoding of the edge-blocks. The edge-block processing involves configuring one or more of: an intra block size, a transform block size, an inter prediction block size, a quantization parameter, candidate modes for intra prediction, pyramid level for motion estimation, and fractional pixel motion estimation search.