Rho-domain Metrics
Video encoders, systems and methods are described that characterize video encoding processes using a ρ-domain deviation metric. The deviation metric represents a weighted difference between actual non-zero coefficients and the expected non-zero coefficients, the actual and expected coefficients corresponding to quantization of a macroblock in a video frame during video encoding of the frame. The deviation metric is used to adjust the video encoding process to obtain an optimized encoding bit rate for a desired video encoding quality by selecting a quantizing parameter based on a normalized value of the deviation metric. The quantizing parameter can be selected from a table indexed using the deviation metric.
1 . A method of video encoding performed by a video encoder comprising:
providing in non-transitory storage information relating a plurality of expected non-zero coefficients obtained from quantization of a macroblock to one or more quantization parameters used in a video encoding process;
generating information relating a plurality of actual non-zero coefficients obtained during video encoding of the macroblock to the one or more quantization parameters;
calculating a deviation metric comprising a ratio of the actual non-zero coefficients and the expected non-zero coefficients for one or more quantization step size; and
adjusting the video encoding process using the deviation metric to obtain an encoding bit rate for a desired video encoding quality.
2 . The method of claim 2 , wherein the deviation metric comprises a recursive weighted ratio and wherein adjusting the video encoding process includes using the deviation metric to obtain an optimized encoding bit rate for a predefined bit rate budget.
3 . The method of claim 1 , wherein adjusting the video encoding process using the deviation metric includes adjusting at least one quantizing parameter based on a normalized deviation metric value.
4 . The method of claim 3 , wherein the relationship between video encoding quality and the at least one quantizing parameter is a function of motion complexity of a sequence of video frames to be encoded.
5 . The method of claim 3 , wherein the normalized deviation metric value varies around a value of 1.0, wherein a normalized deviation metric value greater than 1.0 is indicative of a larger than expected encoded bit rate.
6 . The method of claim 3 , wherein an increase in the normalized deviation metric value is indicative of an increase in complexity of motion contextual content.
7 . The method of claim 3 , wherein the quantizing parameter is a function of the deviation metric.
8 . The method of claim 3 , wherein adjusting the video encoding process using the deviation metric includes selecting a quantizing parameter using the deviation metric to index a table relating quantization parameters and deviation metrics for one or more target qualities.
9 . The method of claim 1 , further comprising the step of selecting an encoding mode using the deviation metric, wherein the encoding mode is selected to maintain a constant bit rate for frame encoding.
10 . The method of claim 1 , further comprising the step of allocating bits to frames based on temporal and spatial changes between a sequence of frames, wherein the bits are allocated to maintain a target minimum video quality.
11 . A video encoder comprising:
an encoder configured to receive a sequence of video frames and to encode macroblocks within the video frames, wherein the encoder generates actual non-zero coefficients during video encoding of the macroblocks; and
a non-transitory storage adapted to maintain a table of quantization parameters, wherein the encoder is configured to select a quantization parameter from the table for a current macroblock using a deviation metric representing a weighted difference between actual non-zero coefficients generated for the current macroblock and non-zero coefficients expected for the current macroblock for one or more quantization step sizes,
wherein the selected quantization parameter is used to select an encoding bit rate used by the encoder for a desired video encoding quality.
12 . The video encoder of claim 11 , wherein the quantizing parameter is selected using a normalized value of the deviation metric and wherein the deviation metric comprises a recursive weighted ratio of actual and expected non-zero coefficients.
13 . The video encoder of claim 11 , wherein the quantizing parameter is selected to achieve a target video encoding quality.
14 . The video encoder of claim 13 , wherein video encoding quality and quantizing parameters are related by a function of motion complexity of the sequence of video frames.
15 . 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 video encoding method comprising:
generating actual non-zero coefficients during video encoding of a macroblock using a selected quantization parameter;
calculating a deviation metric representing a weighted difference between the actual non-zero coefficients and non-zero coefficients that were expected for the selected quantization parameter;
using the deviation metric to obtain an encoding bit rate and a desired video encoding quality for the macroblock.
16 . The method of claim 15 , wherein the deviation metric used to obtain an optimized encoding bit rate and a desired video encoding quality for the macroblock comprises a normalized recursive ratio of actual and expected non-zero coefficients.
17 . The method of claim 16 , wherein using the deviation metric to obtain a desired video encoding quality for the macroblock includes selecting a quantization parameter based on motion complexity of a sequence of video frames.
18 . The method of claim 16 , wherein the deviation metric is normalized and has a value that varies around a value of 1.0, wherein a normalized deviation metric value greater than 1.0 is indicative of a larger than expected encoded bit rate.
19 . The method of claim 16 , wherein an increase in the normalized deviation metric value is indicative of an increase in complexity of motion contextual content.