Video Classification Systems and Methods
Video encoder systems and methods are described that employ table-based content classification. One or more tables relate quantization parameters and P-points for a frame of video that typically comprises macroblocks. A deviation representative of a difference between original and decoded versions of a macroblock is determined, the deviation being further representative of a distribution frequency of the value of a distortion for a P-point. The P-point corresponds to a distortion value that is associated with a minimum rate difference between encoding modes for a macroblock. A motion complexity index is updated using a quantization parameter and non-zero coefficients of the encoded frame. An encoding mode for the macroblock can be retrieved from the tables using the motion complexity index to reference mode information maintained in the tables.
1 . A method of content classification in a video encoder, comprising:
calculating a deviation representative of a difference between original and decoded versions of a macroblock in a frame of video, a distribution frequency of the value of a distortion and the location of a P-point, wherein the macroblock is associated with a bit rate representing bits used to encode the macroblock, and wherein a P-point represents a point in the frame at which a rate of change of bit rate is equal to zero;
updating a motion complexity index using a quantization parameter and a number of non-zero coefficients in the macroblock when encoded; and
selecting an encoding mode for the macroblock using the motion complexity index to reference mode information maintained in one or more tables relating quantization parameters to one or more P-points for the frame of video, wherein the mode is selected to yield a least cost encoding,
wherein the frame comprises a plurality of macroblocks, each macroblock associated with a bit rate representing bits used to encode the each macroblock, and
wherein each P-point corresponds to a distortion value that is associated with a minimum rate difference between encoding modes for a macroblock.
2 . The method of claim 1 , wherein the deviation comprises a weighted difference of estimated distortion and measured distortion for a selected quantization parameter value.
3 . The method of claim 1 , wherein the deviation is normalized.
4 . The method of claim 1 , wherein calculating the deviation representative of the difference between original and decoded versions of a macroblock is based on a tangential relationship between the distortion and a rate difference between the encoding modes.
5 . The method of claim 1 , wherein each P-point corresponds to a distortion value that is associated with no rate difference between encoding modes for the macroblock.
6 . The method of claim 1 , wherein the motion complexity index is initiated during receipt of an initial number of frames in a video sequence.
7 . The method of claim 6 , wherein the initial number of frames in the video sequence comprises 5 frames.
8 . The method of claim 1 , further comprising modeling a cost of deviation for each motion complexity class for each macroblock as a function of P-point, distortion and quantization parameter.
9 . The method of claim 1 , further comprising looking up a P-point for a current frame using a weighted quantization parameter value of a previous frame.
10 . The method of claim 1 , wherein the encoding modes comprise an inter-prediction mode and an intra-prediction mode.
11 . The method of claim 1 , wherein the encoding modes are defined by the H.264 video standard.
12 . A video encoder, comprising:
non-transitory storage adapted to maintain a plurality of tables relating quantization parameters and encoding modes for a video frame; and
a content classifier that selects an encoding mode for a macroblock of the video frame from the plurality of tables using a deviation representative of a difference between original and decoded versions of the macroblock; and
wherein the video encoder maintains a motion complexity index corresponding to a quantization parameter and non-zero coefficients of the encoded frame, the motion complexity index being operable to select the encoding mode as a function of the motion complexity of the video frame, wherein the selected encoding mode yields a least-cost encoding.
13 . The video encoder of claim 12 , wherein the deviation is represented by a function of a P-point, a distortion and a quantization parameter, wherein each P-point corresponds to a distortion value that is associated with a minimum rate difference between encoding modes for the macroblock.
14 . A non-transitory computer-readable medium encoded with data and instructions wherein the data and instructions, when executed by a processor of a video encoder, cause the video encoder to perform a content classification method comprising:
calculating a deviation representative of a difference between original and decoded versions of a macroblock of a frame of video, a distribution frequency of the value of a distortion and the location of a minimum point corresponding to a distortion value associated with a minimum rate difference between possible encoding modes for the macroblock;
updating a motion complexity index using a quantization parameter and a number of non-zero coefficients in the encoded macroblock; and
selecting an encoding mode for the macroblock using the motion complexity index to reference mode information maintained in one or more tables by the video encoder, the one or more tables relating quantization parameters and minimum points for the frame, wherein each macroblock of the frame is associated with a bit rate representing bits used to encode the each macroblock, and wherein each minimum point represents a point in the frame at which a rate of change of bit rate is equal to zero.
15 . The non-transitory computer-readable medium of claim 14 , wherein the deviation comprises a weighted difference of estimated distortion and measured distortion for a selected quantization parameter value, and wherein the selected mode yields a least cost encoding.
16 . The non-transitory computer-readable medium of claim 15 , wherein the deviation comprises a weighted difference of estimated distortion and measured distortion for a selected quantization parameter value and wherein calculating the deviation representative of the difference between original and decoded versions of a macroblock includes determining a tangential relationship between the distortion and a rate difference between the encoding modes.
17 . The non-transitory computer-readable medium of claim 14 , wherein the method further comprises modeling cost of deviation for each motion complexity class for each macroblock as a function of minimum point, distortion and quantization parameter.
18 . The non-transitory computer-readable medium of claim 14 , wherein the method further comprises looking up a minimum point for a current frame using a weighted quantization parameter value of a previous frame.
19 . The non-transitory computer-readable medium of claim 14 , wherein the encoding modes comprise an inter-prediction mode and an intra-prediction mode.
20 . The non-transitory computer-readable medium of claim 14 , wherein the encoding modes are defined by the H.264 video standard.