Method and apparatus for improved coding mode selection
Some embodiments provide a method of performing mode selection in a video compression and encoding system. The method encodes with several encoding modes from a set of encoding modes. The method computes a distortion value for each encoding mode from the several encoding modes. The method computes a bit rate value for each encoding mode from the several encoding modes. The method computes a Lagrangian value for each encoding mode from the several encoding modes, using the distortion value, the bit rate value, and a Lagrangian multiplier. The method selects an encoding mode based on the Lagrangian values. In some embodiments, computing the distortion value includes using a function that reduces the effects of outliers. In some embodiments, the Lagrangian multiplier is a slow varying Lagrangian multiplier that varies at a slower rate than a varying reference Lagrangian multiplier for a reference encoding mode. In yet some embodiments, the method clusters the Lagrangian values.
1. A method of performing mode selection in a video compression and encoding system, said method comprising:
encoding with a plurality of encoding modes from a set of encoding modes;
computing a distortion value for each encoding mode from the plurality of encoding modes;
computing a bit rate value for each encoding mode from the plurality of encoding modes;
computing a Lagrangian value for each encoding mode from the plurality of encoding modes using said distortion value, said bit rate value, and a Lagrangian multiplier;
clustering said Lagrangian values; and
selecting an encoding mode based on said Lagrangian values by selecting a mode 0 encoding method if said mode 0 encoding method is in a specific cluster.
2. The method as claimed in claim 1 , wherein computing said distortion value comprises using a function that reduces the effects of outliers.
3. The method as claimed in claim 1 , wherein computing said distortion value comprises using a Huber function.
4. The method as claimed in claim 1 , wherein computing said bit rate value comprises a total number of bits that are necessary to encode a set of motion vectors and a set of transform coefficients.
5. The method as claimed in claim 1 , wherein said Lagrangian multiplier comprises a slow varying Lagrangian multiplier as a function of a quantization value.
6. The method as claimed in claim 1 , wherein said specific cluster includes an encoding mode that produces a smallest Lagrangian value.
7. The method as claimed in claim 1 , said method further comprising:
selecting an encoding mode that produces a smallest Lagrangian value if said mode 0 encoding method is not in a specific cluster.