FFmpeg
|
#include "libavutil/opt.h"
#include "libavcodec/avcodec.h"
#include "avfilter.h"
#include "internal.h"
#include "video.h"
Go to the source code of this file.
Data Structures | |
struct | MCDeintContext |
Macros | |
#define | OFFSET(x) offsetof(MCDeintContext, x) |
#define | FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM |
#define | CONST(name, help, val, unit) { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit } |
#define | DELTA(j) av_clip(j, -x, w-1-x) |
#define | GET_SCORE_EDGE(j) |
#define | GET_SCORE(j) |
#define | CHECK_EDGE(j) |
#define | CHECK(j) |
Enumerations | |
enum | MCDeintMode { MODE_FAST = 0, MODE_MEDIUM, MODE_SLOW, MODE_EXTRA_SLOW, MODE_NB } |
enum | MCDeintParity { PARITY_TFF = 0, PARITY_BFF = 1 } |
Functions | |
AVFILTER_DEFINE_CLASS (mcdeint) | |
static int | config_props (AVFilterLink *inlink) |
static av_cold void | uninit (AVFilterContext *ctx) |
static int | filter_frame (AVFilterLink *inlink, AVFrame *inpic) |
CHECK (-1) CHECK(-2) }} }} CHECK(1) CHECK(2) }} }} } if(diff0+diff1 > 0) temp - | |
for (y=0;y< h;y++) | |
if (ret< 0) | |
return | ff_filter_frame (outlink, outpic) |
Variables | |
static const AVOption | mcdeint_options [] |
else | |
else | temp = (diff0 + diff1 + FFABS(FFABS(diff0) - FFABS(diff1)) / 2) / 2 |
* | filp = *dstp = temp > 255U ? ~(temp>>31) : temp |
mcdeint | parity = 1 |
end | __pad0__ |
av_frame_free & | inpic |
static const AVFilterPad | mcdeint_inputs [] |
const AVFilter | ff_vf_mcdeint |
Motion Compensation Deinterlacer Ported from MPlayer libmpcodecs/vf_mcdeint.c.
Known Issues:
The motion estimation is somewhat at the mercy of the input, if the input frames are created purely based on spatial interpolation then for example a thin black line or another random and not interpolateable pattern will cause problems. Note: completely ignoring the "unavailable" lines during motion estimation did not look any better, so the most obvious solution would be to improve tfields or penalize problematic motion vectors.
If non iterative ME is used then snow currently ignores the OBMC window and as a result sometimes creates artifacts.
Only past frames are used, we should ideally use future frames too, something like filtering the whole movie in forward and then backward direction seems like an interesting idea but the current filter framework is FAR from supporting such things.
Combining the motion compensated image with the input image also is not as trivial as it seems, simple blindly taking even lines from one and odd ones from the other does not work at all as ME/MC sometimes has nothing in the previous frames which matches the current. The current algorithm has been found by trial and error and almost certainly can be improved...
Definition in file vf_mcdeint.c.
#define OFFSET | ( | x | ) | offsetof(MCDeintContext, x) |
Definition at line 81 of file vf_mcdeint.c.
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM |
Definition at line 82 of file vf_mcdeint.c.
#define CONST | ( | name, | |
help, | |||
val, | |||
unit | |||
) | { name, help, 0, AV_OPT_TYPE_CONST, {.i64=val}, INT_MIN, INT_MAX, FLAGS, unit } |
Definition at line 83 of file vf_mcdeint.c.
#define GET_SCORE_EDGE | ( | j | ) |
#define GET_SCORE | ( | j | ) |
#define CHECK_EDGE | ( | j | ) |
#define CHECK | ( | j | ) |
enum MCDeintMode |
Enumerator | |
---|---|
MODE_FAST | |
MODE_MEDIUM | |
MODE_SLOW | |
MODE_EXTRA_SLOW | |
MODE_NB |
Definition at line 58 of file vf_mcdeint.c.
enum MCDeintParity |
Enumerator | |
---|---|
PARITY_TFF | top field first |
PARITY_BFF | bottom field first |
Definition at line 66 of file vf_mcdeint.c.
AVFILTER_DEFINE_CLASS | ( | mcdeint | ) |
|
static |
Definition at line 102 of file vf_mcdeint.c.
|
static |
Definition at line 160 of file vf_mcdeint.c.
|
static |
Definition at line 169 of file vf_mcdeint.c.
CHECK | ( | - | 1 | ) |
Referenced by aps(), aud(), dci(), dht(), dqt(), filler(), frame(), frame_header_obu(), frame_obu(), frame_size(), frame_size_with_refs(), global_motion_params(), hrd_parameters(), message(), message_list(), metadata_obu(), metadata_scalability(), ols_timing_hrd_parameters(), opi(), ph(), picture_header(), pps(), profile_tier_level(), ref_pic_lists(), sei(), SEI_FUNC(), sequence_header_obu(), slice_header(), slice_segment_header(), sps(), sps_extension(), tile_group_obu(), uncompressed_header(), vps(), vui_parameters(), and vui_payload().
for | ( | ) |
Definition at line 272 of file vf_mcdeint.c.
if | ( | ) |
Definition at line 286 of file vf_mcdeint.c.
return ff_filter_frame | ( | outlink | , |
outpic | |||
) |
|
static |
Definition at line 85 of file vf_mcdeint.c.
else |
Definition at line 253 of file vf_mcdeint.c.
Definition at line 263 of file vf_mcdeint.c.
Referenced by a64_compress_colram(), acb_search(), adpcm_decode_frame(), at1_subband_synthesis(), av_div_sf(), backward_filter(), bink_idct_c(), bink_idct_put_c(), bit8x8_c(), blur_power(), box_slice(), calculate_blockiness(), categorize_regions(), cbs_h2645_write_slice_data(), celt_frame_mdct(), colorscale_matrix(), comp_autocorr(), comp_interp_index(), compose2D2(), compute_vif2(), config_input(), dct_max8x8_c(), dct_sad8x8_c(), decode_8_pulses_31bits(), decode_plane(), decode_rgb_frame(), decompose2D2(), decompress_p(), decompress_p3(), diagonal_transformation(), do_block_ssd(), do_block_ssd16(), draw_response(), encode_mode(), estimate_pitch(), ff_atrac_iqmf(), ff_avg_h264_qpel16_mc12_lasx(), ff_avg_h264_qpel16_mc12_lsx(), ff_avg_h264_qpel16_mc12_mmi(), ff_avg_h264_qpel16_mc21_lasx(), ff_avg_h264_qpel16_mc21_lsx(), ff_avg_h264_qpel16_mc21_mmi(), ff_avg_h264_qpel16_mc22_mmi(), ff_avg_h264_qpel16_mc23_lasx(), ff_avg_h264_qpel16_mc23_lsx(), ff_avg_h264_qpel16_mc23_mmi(), ff_avg_h264_qpel16_mc32_lasx(), ff_avg_h264_qpel16_mc32_lsx(), ff_avg_h264_qpel16_mc32_mmi(), ff_avg_h264_qpel8_mc12_lasx(), ff_avg_h264_qpel8_mc12_lsx(), ff_avg_h264_qpel8_mc12_mmi(), ff_avg_h264_qpel8_mc21_lasx(), ff_avg_h264_qpel8_mc21_lsx(), ff_avg_h264_qpel8_mc21_mmi(), ff_avg_h264_qpel8_mc22_mmi(), ff_avg_h264_qpel8_mc23_lasx(), ff_avg_h264_qpel8_mc23_lsx(), ff_avg_h264_qpel8_mc23_mmi(), ff_avg_h264_qpel8_mc32_lasx(), ff_avg_h264_qpel8_mc32_lsx(), ff_avg_h264_qpel8_mc32_mmi(), ff_block_permute(), ff_celt_bitalloc(), ff_ea_idct_put_c(), ff_faandct(), ff_faandct248(), ff_faanidct(), ff_faanidct_add(), ff_faanidct_put(), ff_g723_1_inverse_quant(), ff_h264_chroma422_dc_dequant_idct(), ff_h264_chroma422_dc_dequant_idct_8_mmi(), ff_h264_luma_dc_dequant_idct(), ff_huffyuv_alloc_temp(), ff_huffyuv_common_end(), ff_mjpegenc_huffman_compute_bits(), ff_mkdir_p(), ff_put_h264_qpel16_mc12_lasx(), ff_put_h264_qpel16_mc12_lsx(), ff_put_h264_qpel16_mc12_mmi(), ff_put_h264_qpel16_mc21_lasx(), ff_put_h264_qpel16_mc21_lsx(), ff_put_h264_qpel16_mc21_mmi(), ff_put_h264_qpel16_mc22_mmi(), ff_put_h264_qpel16_mc23_lasx(), ff_put_h264_qpel16_mc23_lsx(), ff_put_h264_qpel16_mc23_mmi(), ff_put_h264_qpel16_mc32_lasx(), ff_put_h264_qpel16_mc32_lsx(), ff_put_h264_qpel16_mc32_mmi(), ff_put_h264_qpel8_mc12_lasx(), ff_put_h264_qpel8_mc12_lsx(), ff_put_h264_qpel8_mc12_mmi(), ff_put_h264_qpel8_mc21_lasx(), ff_put_h264_qpel8_mc21_lsx(), ff_put_h264_qpel8_mc21_mmi(), ff_put_h264_qpel8_mc22_mmi(), ff_put_h264_qpel8_mc23_lasx(), ff_put_h264_qpel8_mc23_lsx(), ff_put_h264_qpel8_mc23_mmi(), ff_put_h264_qpel8_mc32_lasx(), ff_put_h264_qpel8_mc32_lsx(), ff_put_h264_qpel8_mc32_mmi(), ff_put_wav_header(), ff_queue_destroy(), ff_simple_idct_add_lasx(), ff_simple_idct_lasx(), ff_simple_idct_put_lasx(), ff_spatial_dwt(), ff_spatial_idwt(), ff_spatial_idwt_buffered_slice(), filter(), filter_frame(), find_new_headers(), flac_parse(), flac_parse_close(), formant_postfilter(), ftx_2d(), gain_scale(), gen_fcb_excitation(), get_fcb_param(), get_tilt_comp(), h261_loop_filter(), hadamard8_diff8x8_c(), hadamard8_intra8x8_c(), handle_file(), harmonic_filter(), harmonic_noise_sub(), hblur(), horizontal_compose53i(), horizontal_compose_daub97i_TMPL(), horizontal_compose_dirac53i_TMPL(), horizontal_compose_haar0i_TMPL(), horizontal_compose_haar1i_TMPL(), horizontal_compose_haari_TMPL(), horizontal_decompose53i(), horizontal_decompose97i(), http_write(), hybrid6_cx(), hypot(), idct(), idct_put(), idctRowCondDC(), imdct_and_windowing(), imdct_and_windowing_960(), imdct_and_windowing_eld(), invert_step(), ivr_read_header(), kbd_window_init(), levinson_durbin(), libjxl_encode_frame(), lpc2lsp(), ls_encode_runterm(), ls_get_code_runterm(), magy_huffman_compute_bits(), main(), matrix_multiply(), on2avc_reconstruct_channel(), p8idct(), pack_bitstream(), pgx_get_number(), planar_rgb_to_uv_lasx(), planar_rgb_to_y_lasx(), postfilter(), pp_get_mode_by_name_and_quality(), qian_thresholding(), quant_psnr8x8_c(), queue_frame(), rd8x8_c(), read10in32_gray(), read16(), read32(), read_time(), render_slice(), rotate(), row_fdct(), rtmp_server_handshake(), rv34_idct_add_c(), rv34_inv_transform_noround_c(), rv34_row_transform(), sbc_unpack_frame(), sbr_gain_calc(), sbr_make_f_derived(), sbr_make_f_master(), scale_coefs(), set_noise_profile(), setup_classifs(), simple_idct_add_msa(), simple_idct_msa(), simple_idct_put_msa(), snow_horizontal_compose97i(), soft_thresholding(), spatial_compose53i_dy(), spatial_compose53i_dy_buffered(), spatial_compose97i_dy(), spatial_compose97i_dy_buffered(), spatial_decompose53i(), spatial_decompose97i(), spatial_idwt_slice(), ssim360_plane_16bit(), ssim360_plane_8bit(), ssim360_tape(), ssim_plane(), ssim_plane_16bit(), store_slice16_c(), store_slice2_c(), store_slice_c(), sub_acb_contrib(), sub_left_prediction(), svq1_encode_plane(), svq3_luma_dc_dequant_idct_c(), synth_percept_filter(), tta_encode_frame(), unpack_bitstream(), vblur(), vc1_inv_trans_8x8_c(), video_frame(), vif_filter1d(), vvc_extradata_to_annexb(), wavpack_encode_block(), yuv2rgb_full_X_template_lasx(), yuv2rgb_full_X_template_lsx(), yuv2rgb_X_template_lasx(), and yuv2rgb_X_template_lsx().
Definition at line 264 of file vf_mcdeint.c.
Referenced by filter_frame().
mcdeint parity = 1 |
Definition at line 281 of file vf_mcdeint.c.
Referenced by aptx_check_parity(), aptx_pack_codeword(), aptx_quantized_parity(), aptxhd_pack_codeword(), bwdif_vulkan_filter_frame(), call_kernel(), checkasm_check_vf_bwdif(), copy_field(), extract_line(), ff_bwdif_filter_edge_c(), ff_bwdif_filter_line3_c(), ff_bwdif_filter_line_c(), filter(), filter_edge_16bit(), filter_edge_helper(), filter_edges(), filter_edges_16bit(), filter_intra_helper(), filter_line3_helper(), filter_line_c(), filter_line_c_16bit(), filter_line_helper(), init_filter(), pic_as_field(), pullup_get_buffer(), pullup_lock_buffer(), pullup_release_buffer(), pullup_submit_field(), read_access_unit(), split_field_copy(), and write_substr().
end __pad0__ |
Definition at line 284 of file vf_mcdeint.c.
av_frame_free& inpic |
Definition at line 285 of file vf_mcdeint.c.
Referenced by filter_frame(), and for().
|
static |
Definition at line 293 of file vf_mcdeint.c.
const AVFilter ff_vf_mcdeint |
Definition at line 302 of file vf_mcdeint.c.