Commit Graph

5 Commits

Author SHA1 Message Date
Marton Balint 2cbe6bac03 avfilter/vf_framerate: change blend factor precision
This is done mainly in preparation for the SIMD patches.

- for the 8-bit input, decrease the blend factor precision to 7-bit.
- for the 16-bit input, increase the blend factor precision to 15-bit.
- make sure the blend functions are not called with 0 or maximum blending
  factors, because we don't want the signed factor integers to overflow.

Fate test changes are due to different rounding.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-01-28 18:50:50 +01:00
Marton Balint 0c31a3876d avfilter/vf_framerate: simplify filter
The framerate filter was quite convoluted with some filter_frame /
request_frame logic bugs. It seemed easier to rewrite the whole filter_frame /
request_frame part and also the frame interpolation ratio calculation part in
one step.

Notable changes:
- The filter now only stores 2 frames instead of 3
- filter_frame outputs all the frames it can to be able to handle consecutive
  filter_frame calls which previously caused early drops of buffered frames.
- because of this, request_frame is largely simplified and it only outputs
  frames on flush. Previously consecuitve request_frame calls could cause the
  filter to think it is in flush mode filling its buffer with the same frames
  causing a "ghost" effect on the output.
- PTS discontinuities are handled better
- frames with unknown PTS values are now dropped

Fixes ticket #4870.
Probably fixes ticket #5493.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-01-12 23:40:41 +01:00
Marton Balint f528c49c7c avfilter/vf_framerate: calculate interpolation as integer
It was truncated to int later on anyway. Fate test changes are due to rounding
instead of truncation.

Fixes fate test failures on x86-32 (gcc 4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1))
after 090b740680.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-01-04 22:37:43 +01:00
Marton Balint e1113a83cc avfilter/vf_framerate: fix scene change detection score
- normalize score to [0..100] instead of [0..85]
- change the default score to 8.2 to roughly keep existing behaviour
- take into account bit depth
- do not truncate to integer

Signed-off-by: Marton Balint <cus@passwd.hu>
2017-12-21 23:03:10 +01:00
Marton Balint d6a8e46f97 fate: add 12 bit framerate filter tests
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-12-21 23:03:10 +01:00