Patent ID: 8885705

Claim:
A method of transcoding a digital stream of compressed frames, the method comprising: (a) receiving a compressed video frame having content information and non-content information included therein; (b) determining the total compressed size of the frame (N T ); (c) determining from at least the total compressed size of the frame the total number of bits (N s ) to shave from the compressed frame; (d) determining a plurality of statistics about a given portion of the frame, the given portion of the frame having levels corresponding to non-zero coefficients for content information of the frame; (e) determining whether to requantize the given portion based on at least one of the statistics about the given portion; (f) responsive to determining to requantize the given portion, requantizing the levels of the given portion; (g) determining whether to threshold the given portion based on a number of bits saved (N_saved) by requantizing the levels of the given portion; (h) responsive to determining to threshold the given portion, thresholding the levels of the given portion, wherein the thresholding further comprises: adjusting a threshold level of a threshold function based on a number of levels zeroed (cnt) in the given portion by the thresholding function and an approximate number of levels in the given portion to set to zero by thresholding (N_thresh); determining a final scan index threshold and a split index value (SplitIndexVal) based on the number of levels zeroed (cnt) in the given portion; segmenting the given portion into segments based on the split index value (SplitIndexVal); and thresholding the segments of the given portion with a thresholding function at the adjusted threshold level and the final scan index threshold; and (i) transmitting the given portion.