wiki:

Postprocessing


Version 2 (modified by llogan, 5 years ago) (diff)

fix images

Post-processing filters are used in videos for quality-improvement. These filters are intended for recovering quality of videos ripped from DVD, VideoCD or after decompressing.

Following sections contain various post-processing filters which are part of the FFmpeg project.

SPP - Simple Postprocessing

Simple Post-proceesing filter compresses and decompresses the image at several (or - in the case of quality level 6 - all) shifts and average the results. The options available are -

Quality

This option defines the number of levels for averaging. It accepts an integer in the range 0-6. If set to 0, the filter will have no effect. A value of 6 represents highest quality. For each increment of that value the speed drops by a factor of approximately 2. Default value is 3.

The filter basically smooths away blocking and other artifacts from low quality sources. The further you increment the value of quality, the more intensely it smooths away detail.

QP

Force a constant quantization parameter. It accepts an integer in range 0-63. If not set, the filter will use the QP from the video stream (if available).

In particular, the quantization parameter QP regulates how much spatial detail is saved. When QP is very small, almost all that detail is retained. As QP is increased, some of that detail is aggregated so that the bit rate drops – but at the price of some increase in distortion and some loss of quality. So, if you want to lower bit rate, you can do so by lowering QP at a cost of increased distortion.

Mode

To set the thresholding mode. Available modes are:

‘hard’

For hard thresholding - default.

‘soft’

For soft thresholding - better de-ringing effect but the results are blurrier when compared to the default mode.

use_bframe_qp

Enable the use of the QP from the B-Frames if set to 1. Using this option may cause flicker since the B-Frames have often larger QP. Default is 0 (not enabled).

Let's consider the example of test sequence called "Foreman"(frame 155, compressed using Xvid with bitrate option 50, 75, 100kbs):

SPP - Simple Postprocessing

USPP - Ultra Simple/Slow? Postprocessing

Ultra slow/simple postprocessing filter compresses and decompresses the image at several (or - in the case of quality level 8 - all) shifts and average the results.

The way this differs from the behavior of spp is that uspp actually encodes & decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8 DCT similar to MJPEG. So, you should use USPP if and only if your CPU is powerful.

The filter accepts the following options:

Quality

This option defines the number of levels for averaging. It accepts an integer in the range 0-8. If set to 0, the filter will have no effect. A value of 8 represents highest quality. For each increment of that value the speed drops by a factor of approximately 2. Default value is 3.

The filter basically smooths away blocking and other artifacts from low quality sources. The further you increment the value of quality, the more intensely it smooths away detail.

QP

Force a constant quantization parameter. It accepts an integer in range 0-63. If not set, the filter will use the QP from the video stream (if available).

In particular, the quantization parameter QP regulates how much spatial detail is saved. When QP is very small, almost all that detail is retained. As QP is increased, some of that detail is aggregated so that the bit rate drops – but at the price of some increase in distortion and some loss of quality. So, if you want to lower bit rate, you can do so by lowering QP at a cost of increased distortion.


FSPP - Fast Simple Postprocessing

FSPP is a faster version of SPP. The processing is performed on groups of pixels, instead of individual pixels, making computation faster. The filter accepts the following options:

Quality

This option defines the number of levels for averaging. It accepts an integer in the range 4-5. Default value is 4.

The filter basically smooths away blocking and other artifacts from low quality sources. The further you increment the value of quality, the more intensely it smooths away detail.

QP

Force a constant quantization parameter. It accepts an integer in range 0-63. If not set, the filter will use the QP from the video stream (if available).

In particular, the quantization parameter QP regulates how much spatial detail is saved. When QP is very small, almost all that detail is retained. As QP is increased, some of that detail is aggregated so that the bit rate drops – but at the price of some increase in distortion and some loss of quality. So, if you want to lower bit rate, you can do so by lowering QP at a cost of increased distortion.

Strength

To set the filter strength. It accepts an integer in range -15 to 32. Lower values mean more details but also more artifacts, while higher values make the image smoother but also blurrier. Default value is 0 (PSNR optimal).

use_bframe_qp

Enable the use of the QP from the B-Frames if set to 1. Using this option may cause flicker since the B-Frames have often larger QP. Default is 0 (not enabled).

Let's consider the example of test sequence called "Foreman"(frame 155, compressed using Xvid with bitrate option 50, 75, 100kbs):

FSPP - Fast Simple Postprocessing

PP7 - Postprocessing 7

PP7 is variant of the SPP filter. It is similar to SPP = 6 with 7 point DCT, where only the center sample is used after IDCT.

The filter accepts the following options:

QP

Force a constant quantization parameter. It accepts an integer in range 0-63. If not set, the filter will use the QP from the video stream (if available).

In particular, the quantization parameter QP regulates how much spatial detail is saved. When QP is very small, almost all that detail is retained. As QP is increased, some of that detail is aggregated so that the bit rate drops – but at the price of some increase in distortion and some loss of quality. So, if you want to lower bit rate, you can do so by lowering QP at a cost of increased distortion.

Mode

To set the thresholding mode. Available modes are:

‘hard’

For hard thresholding.

‘soft’

For soft thresholding - better de-ringing effect but the results are blurrier when compared to the default mode.

‘medium'

For medium thresholding. Gives good results. This is the default mode.

Let's consider the example of test sequence called "Foreman"(frame 155, compressed using Xvid with bitrate option 50, 75, 100kbs):

PP7 - Postprocessing 7

Attachments (60)