Commit Graph

18 Commits

Author SHA1 Message Date
James Almer 7f890b2fbb avfilter/ccfifo: remove unnecessary context allocations
This is not public API, no it has no need for an alloc() and free()
functions. The struct can reside on stack.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-12 16:21:18 -03:00
Devin Heitmueller f304c3a729 avfilter/tinterlace: Properly preserve CEA-708 closed captions
Because the interlacing filter halves the effective framerate, we
need to ensure that no CEA-708 data is lost as frames are merged.

Make use of the new ccfifo mechanism to ensure that caption data
is properly preserved as frames pass through the filter.

Thanks to Thomas Mundt for review and noticing a couple of
missed codepaths for injection on output.  Thanks to Lance Wang
for pointing out a memory leak.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2023-05-11 22:06:20 +08:00
Niklas Haas a69b08790b avfilter/vf_tinterlace: support full-range YUV
This filter, when used in the "pad" mode, currently makes the
distinction between limited and full range solely by testing for YUVJ
pixel formats at link setup time. This is deprecated and should be
improved to perform the detection based on the per-frame metadata.

In order to make this distinction based on color range metadata, which
is only known at the time of filtering frames, for simplicity, we simply
allocate two copies of the "black" frame - one for limited range and the
other for full range metadata. This could be done more dynamically (e.g.
as-needed or simply by blitting the appropriate pixel value directly),
but this change is relatively simple and preserves the structure of the
existing code.

This commit actually fixes a bug in FATE - the new output is correct for
the first time. The previous md5 ref was of a frame that incorrectly
combined full-range pixel data with limited-range black fields. The
corresponding result has been updated.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-12-20 14:02:37 +01:00
Paul B Mahol 24fea4d09b avfilter/vf_tinterlace: use frame counter from lavfi
Remove internal counter.
2020-07-17 13:53:55 +02:00
Marton Balint 6498522bef avfilter/vf_tinterlace: add support for bypassing already interlaced frames
The old interlace filter worked this way before it was merged with tinterlace.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-12-15 00:23:01 +01:00
Marton Balint 28b5dc6199 avfilter/vf_interlace: restore lowpass mode constants
The documentation still mentions numerical constants in addition to textual
ones. It is also wrong to use distinct modes as flags and it disallows us to
actually use the flags field for real flags in the future.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-12-14 22:53:56 +01:00
Thomas Mundt f4438e387e avfilter/vf_interlace: fix numerical options
Regression since 9c01cdb94e

Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
2018-09-07 18:46:56 +02:00
Thomas Mundt 40bfaa190c avfilter/interlace: add support for 10 and 12 bit
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-23 16:19:58 -03:00
Thomas Mundt 58ca446672 avfilter/tinterlace: use drawutils for pad mode
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-23 16:19:58 -03:00
Paul B Mahol ed93ed5ee3 avfilter: don't anonymously typedef structs
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-13 11:39:28 +02:00
Thomas Mundt 2da5bf4c2f avfilter/interlace: add complex vertical low-pass filter
This complex (-1 2 6 2 -1) filter slightly less reduces interlace 'twitter' but better retain detail and subjective sharpness impression compared to the linear (1 2 1) filter.

Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-02 14:09:50 -03:00
Thomas Mundt 207e6debf8 avfilter/interlace: change lowpass_line function prototype
Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-04-22 20:12:15 +02:00
Paul B Mahol 13090895cf avfilter/vf_tinterlace: add mergex2 mode
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-10-03 15:22:16 +02:00
Michael Niedermayer 8ae350004d avfilter/tinterlace: Change enum to int, which is accessed via AVOption as int
This fixes depending on implementation defined behavior

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-30 00:08:57 +02:00
Michael Niedermayer 59f1f764d6 avfilter/vf_tinterlace: Favor using standard timebases for the output
Reported-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Inspired by discussion with Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 18:28:06 +01:00
Michael Niedermayer fb3eb57369 avfilter/tinterlace: add Support for ff_lowpass_line_avx() & ff_lowpass_line_sse2()
Based-on: 2e1704059a by Kieran Kunhya

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-15 04:02:33 +01:00
Michael Niedermayer 18b46ecc93 avfilter/tinterlace: Move lowpass_line to a separate function and call it through a function pointer
This permits replacing it by a optimized implementation
Based-on / Idea-from: 2e1704059a by Kieran Kunhya

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-15 03:25:43 +01:00
Michael Niedermayer 9d548fce24 avfilter/tinterlace: split context definition into seperate header so it can be used by future optimizations
Idea from 2e1704059a from Kieran Kunhya

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-15 03:22:35 +01:00