Merge commit '124e26971e69bb25f38c6c7cb3fa20c77cf10966'
authorClément Bœsch <cboesch@gopro.com>
Thu, 30 Mar 2017 08:41:24 +0000 (10:41 +0200)
committerClément Bœsch <cboesch@gopro.com>
Thu, 30 Mar 2017 08:51:32 +0000 (10:51 +0200)
* commit '124e26971e69bb25f38c6c7cb3fa20c77cf10966':
  lavfi: Hardware map filter

Merged-by: Clément Bœsch <cboesch@gopro.com>
1  2 
libavfilter/Makefile
libavfilter/allfilters.c
libavfilter/version.h
libavfilter/vf_hwmap.c

diff --combined libavfilter/Makefile
@@@ -1,5 -1,3 +1,5 @@@
 +include $(SUBDIR)../config.mak
 +
  NAME = avfilter
  
  HEADERS = avfilter.h                                                    \
@@@ -17,358 -15,93 +17,359 @@@ OBJS = allfilters.
         drawutils.o                                                      \
         fifo.o                                                           \
         formats.o                                                        \
 +       framepool.o                                                      \
 +       framequeue.o                                                     \
 +       graphdump.o                                                      \
         graphparser.o                                                    \
 +       opencl_allkernels.o                                              \
 +       transform.o                                                      \
         video.o                                                          \
  
  OBJS-$(HAVE_THREADS)                         += pthread.o
  
  # audio filters
 +OBJS-$(CONFIG_ABENCH_FILTER)                 += f_bench.o
 +OBJS-$(CONFIG_ACOMPRESSOR_FILTER)            += af_sidechaincompress.o
 +OBJS-$(CONFIG_ACROSSFADE_FILTER)             += af_afade.o
 +OBJS-$(CONFIG_ACRUSHER_FILTER)               += af_acrusher.o
 +OBJS-$(CONFIG_ADELAY_FILTER)                 += af_adelay.o
 +OBJS-$(CONFIG_AECHO_FILTER)                  += af_aecho.o
 +OBJS-$(CONFIG_AEMPHASIS_FILTER)              += af_aemphasis.o
 +OBJS-$(CONFIG_AEVAL_FILTER)                  += aeval.o
 +OBJS-$(CONFIG_AFADE_FILTER)                  += af_afade.o
 +OBJS-$(CONFIG_AFFTFILT_FILTER)               += af_afftfilt.o window_func.o
  OBJS-$(CONFIG_AFORMAT_FILTER)                += af_aformat.o
 +OBJS-$(CONFIG_AGATE_FILTER)                  += af_agate.o
 +OBJS-$(CONFIG_AINTERLEAVE_FILTER)            += f_interleave.o
 +OBJS-$(CONFIG_ALIMITER_FILTER)               += af_alimiter.o
 +OBJS-$(CONFIG_ALLPASS_FILTER)                += af_biquads.o
 +OBJS-$(CONFIG_ALOOP_FILTER)                  += f_loop.o
 +OBJS-$(CONFIG_AMERGE_FILTER)                 += af_amerge.o
 +OBJS-$(CONFIG_AMETADATA_FILTER)              += f_metadata.o
  OBJS-$(CONFIG_AMIX_FILTER)                   += af_amix.o
 +OBJS-$(CONFIG_ANEQUALIZER_FILTER)            += af_anequalizer.o
  OBJS-$(CONFIG_ANULL_FILTER)                  += af_anull.o
 +OBJS-$(CONFIG_APAD_FILTER)                   += af_apad.o
 +OBJS-$(CONFIG_APERMS_FILTER)                 += f_perms.o
 +OBJS-$(CONFIG_APHASER_FILTER)                += af_aphaser.o generate_wave_table.o
 +OBJS-$(CONFIG_APULSATOR_FILTER)              += af_apulsator.o
 +OBJS-$(CONFIG_AREALTIME_FILTER)              += f_realtime.o
 +OBJS-$(CONFIG_ARESAMPLE_FILTER)              += af_aresample.o
 +OBJS-$(CONFIG_AREVERSE_FILTER)               += f_reverse.o
 +OBJS-$(CONFIG_ASELECT_FILTER)                += f_select.o
 +OBJS-$(CONFIG_ASENDCMD_FILTER)               += f_sendcmd.o
 +OBJS-$(CONFIG_ASETNSAMPLES_FILTER)           += af_asetnsamples.o
  OBJS-$(CONFIG_ASETPTS_FILTER)                += setpts.o
 +OBJS-$(CONFIG_ASETRATE_FILTER)               += af_asetrate.o
  OBJS-$(CONFIG_ASETTB_FILTER)                 += settb.o
  OBJS-$(CONFIG_ASHOWINFO_FILTER)              += af_ashowinfo.o
 +OBJS-$(CONFIG_ASIDEDATA_FILTER)              += f_sidedata.o
  OBJS-$(CONFIG_ASPLIT_FILTER)                 += split.o
 -OBJS-$(CONFIG_ASYNCTS_FILTER)                += af_asyncts.o
 +OBJS-$(CONFIG_ASTATS_FILTER)                 += af_astats.o
 +OBJS-$(CONFIG_ASTREAMSELECT_FILTER)          += f_streamselect.o
 +OBJS-$(CONFIG_ATEMPO_FILTER)                 += af_atempo.o
  OBJS-$(CONFIG_ATRIM_FILTER)                  += trim.o
 +OBJS-$(CONFIG_AZMQ_FILTER)                   += f_zmq.o
 +OBJS-$(CONFIG_BANDPASS_FILTER)               += af_biquads.o
 +OBJS-$(CONFIG_BANDREJECT_FILTER)             += af_biquads.o
 +OBJS-$(CONFIG_BASS_FILTER)                   += af_biquads.o
 +OBJS-$(CONFIG_BIQUAD_FILTER)                 += af_biquads.o
  OBJS-$(CONFIG_BS2B_FILTER)                   += af_bs2b.o
  OBJS-$(CONFIG_CHANNELMAP_FILTER)             += af_channelmap.o
  OBJS-$(CONFIG_CHANNELSPLIT_FILTER)           += af_channelsplit.o
 +OBJS-$(CONFIG_CHORUS_FILTER)                 += af_chorus.o generate_wave_table.o
  OBJS-$(CONFIG_COMPAND_FILTER)                += af_compand.o
 +OBJS-$(CONFIG_COMPENSATIONDELAY_FILTER)      += af_compensationdelay.o
 +OBJS-$(CONFIG_CRYSTALIZER_FILTER)            += af_crystalizer.o
 +OBJS-$(CONFIG_DCSHIFT_FILTER)                += af_dcshift.o
 +OBJS-$(CONFIG_DYNAUDNORM_FILTER)             += af_dynaudnorm.o
 +OBJS-$(CONFIG_EARWAX_FILTER)                 += af_earwax.o
 +OBJS-$(CONFIG_EBUR128_FILTER)                += f_ebur128.o
 +OBJS-$(CONFIG_EQUALIZER_FILTER)              += af_biquads.o
 +OBJS-$(CONFIG_EXTRASTEREO_FILTER)            += af_extrastereo.o
 +OBJS-$(CONFIG_FIREQUALIZER_FILTER)           += af_firequalizer.o
 +OBJS-$(CONFIG_FLANGER_FILTER)                += af_flanger.o generate_wave_table.o
  OBJS-$(CONFIG_HDCD_FILTER)                   += af_hdcd.o
 +OBJS-$(CONFIG_HIGHPASS_FILTER)               += af_biquads.o
  OBJS-$(CONFIG_JOIN_FILTER)                   += af_join.o
 +OBJS-$(CONFIG_LADSPA_FILTER)                 += af_ladspa.o
 +OBJS-$(CONFIG_LOUDNORM_FILTER)               += af_loudnorm.o ebur128.o
 +OBJS-$(CONFIG_LOWPASS_FILTER)                += af_biquads.o
 +OBJS-$(CONFIG_PAN_FILTER)                    += af_pan.o
 +OBJS-$(CONFIG_REPLAYGAIN_FILTER)             += af_replaygain.o
  OBJS-$(CONFIG_RESAMPLE_FILTER)               += af_resample.o
 +OBJS-$(CONFIG_RUBBERBAND_FILTER)             += af_rubberband.o
 +OBJS-$(CONFIG_SIDECHAINCOMPRESS_FILTER)      += af_sidechaincompress.o
 +OBJS-$(CONFIG_SIDECHAINGATE_FILTER)          += af_agate.o
 +OBJS-$(CONFIG_SILENCEDETECT_FILTER)          += af_silencedetect.o
 +OBJS-$(CONFIG_SILENCEREMOVE_FILTER)          += af_silenceremove.o
 +OBJS-$(CONFIG_SOFALIZER_FILTER)              += af_sofalizer.o
 +OBJS-$(CONFIG_STEREOTOOLS_FILTER)            += af_stereotools.o
 +OBJS-$(CONFIG_STEREOWIDEN_FILTER)            += af_stereowiden.o
 +OBJS-$(CONFIG_TREBLE_FILTER)                 += af_biquads.o
 +OBJS-$(CONFIG_TREMOLO_FILTER)                += af_tremolo.o
 +OBJS-$(CONFIG_VIBRATO_FILTER)                += af_vibrato.o generate_wave_table.o
  OBJS-$(CONFIG_VOLUME_FILTER)                 += af_volume.o
 +OBJS-$(CONFIG_VOLUMEDETECT_FILTER)           += af_volumedetect.o
  
 -OBJS-$(CONFIG_ANULLSINK_FILTER)              += asink_anullsink.o
 +OBJS-$(CONFIG_AEVALSRC_FILTER)               += aeval.o
 +OBJS-$(CONFIG_ANOISESRC_FILTER)              += asrc_anoisesrc.o
  OBJS-$(CONFIG_ANULLSRC_FILTER)               += asrc_anullsrc.o
 +OBJS-$(CONFIG_FLITE_FILTER)                  += asrc_flite.o
 +OBJS-$(CONFIG_SINE_FILTER)                   += asrc_sine.o
 +
 +OBJS-$(CONFIG_ANULLSINK_FILTER)              += asink_anullsink.o
  
  # video filters
 +OBJS-$(CONFIG_ALPHAEXTRACT_FILTER)           += vf_extractplanes.o
 +OBJS-$(CONFIG_ALPHAMERGE_FILTER)             += vf_alphamerge.o
 +OBJS-$(CONFIG_ASS_FILTER)                    += vf_subtitles.o
 +OBJS-$(CONFIG_ATADENOISE_FILTER)             += vf_atadenoise.o
 +OBJS-$(CONFIG_AVGBLUR_FILTER)                += vf_avgblur.o
 +OBJS-$(CONFIG_BBOX_FILTER)                   += bbox.o vf_bbox.o
 +OBJS-$(CONFIG_BENCH_FILTER)                  += f_bench.o
 +OBJS-$(CONFIG_BITPLANENOISE_FILTER)          += vf_bitplanenoise.o
 +OBJS-$(CONFIG_BLACKDETECT_FILTER)            += vf_blackdetect.o
  OBJS-$(CONFIG_BLACKFRAME_FILTER)             += vf_blackframe.o
 +OBJS-$(CONFIG_BLEND_FILTER)                  += vf_blend.o dualinput.o framesync.o
  OBJS-$(CONFIG_BOXBLUR_FILTER)                += vf_boxblur.o
 +OBJS-$(CONFIG_BWDIF_FILTER)                  += vf_bwdif.o
 +OBJS-$(CONFIG_CHROMAKEY_FILTER)              += vf_chromakey.o
 +OBJS-$(CONFIG_CIESCOPE_FILTER)               += vf_ciescope.o
 +OBJS-$(CONFIG_CODECVIEW_FILTER)              += vf_codecview.o
 +OBJS-$(CONFIG_COLORBALANCE_FILTER)           += vf_colorbalance.o
 +OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER)      += vf_colorchannelmixer.o
 +OBJS-$(CONFIG_COLORKEY_FILTER)               += vf_colorkey.o
 +OBJS-$(CONFIG_COLORLEVELS_FILTER)            += vf_colorlevels.o
 +OBJS-$(CONFIG_COLORMATRIX_FILTER)            += vf_colormatrix.o
 +OBJS-$(CONFIG_COLORSPACE_FILTER)             += vf_colorspace.o colorspacedsp.o
 +OBJS-$(CONFIG_CONVOLUTION_FILTER)            += vf_convolution.o
  OBJS-$(CONFIG_COPY_FILTER)                   += vf_copy.o
 +OBJS-$(CONFIG_COREIMAGE_FILTER)              += vf_coreimage.o
 +OBJS-$(CONFIG_COVER_RECT_FILTER)             += vf_cover_rect.o lavfutils.o
  OBJS-$(CONFIG_CROP_FILTER)                   += vf_crop.o
  OBJS-$(CONFIG_CROPDETECT_FILTER)             += vf_cropdetect.o
 +OBJS-$(CONFIG_CURVES_FILTER)                 += vf_curves.o
 +OBJS-$(CONFIG_DATASCOPE_FILTER)              += vf_datascope.o
 +OBJS-$(CONFIG_DCTDNOIZ_FILTER)               += vf_dctdnoiz.o
 +OBJS-$(CONFIG_DEBAND_FILTER)                 += vf_deband.o
 +OBJS-$(CONFIG_DECIMATE_FILTER)               += vf_decimate.o
 +OBJS-$(CONFIG_DEFLATE_FILTER)                += vf_neighbor.o
  OBJS-$(CONFIG_DEINTERLACE_QSV_FILTER)        += vf_deinterlace_qsv.o
 +OBJS-$(CONFIG_DEINTERLACE_VAAPI_FILTER)      += vf_deinterlace_vaapi.o
 +OBJS-$(CONFIG_DEJUDDER_FILTER)               += vf_dejudder.o
  OBJS-$(CONFIG_DELOGO_FILTER)                 += vf_delogo.o
 +OBJS-$(CONFIG_DESHAKE_FILTER)                += vf_deshake.o
 +OBJS-$(CONFIG_DETELECINE_FILTER)             += vf_detelecine.o
 +OBJS-$(CONFIG_DILATION_FILTER)               += vf_neighbor.o
 +OBJS-$(CONFIG_DISPLACE_FILTER)               += vf_displace.o framesync.o
  OBJS-$(CONFIG_DRAWBOX_FILTER)                += vf_drawbox.o
 +OBJS-$(CONFIG_DRAWGRAPH_FILTER)              += f_drawgraph.o
 +OBJS-$(CONFIG_DRAWGRID_FILTER)               += vf_drawbox.o
  OBJS-$(CONFIG_DRAWTEXT_FILTER)               += vf_drawtext.o
 +OBJS-$(CONFIG_EDGEDETECT_FILTER)             += vf_edgedetect.o
 +OBJS-$(CONFIG_ELBG_FILTER)                   += vf_elbg.o
 +OBJS-$(CONFIG_EQ_FILTER)                     += vf_eq.o
 +OBJS-$(CONFIG_EROSION_FILTER)                += vf_neighbor.o
 +OBJS-$(CONFIG_EXTRACTPLANES_FILTER)          += vf_extractplanes.o
  OBJS-$(CONFIG_FADE_FILTER)                   += vf_fade.o
 +OBJS-$(CONFIG_FFTFILT_FILTER)                += vf_fftfilt.o
 +OBJS-$(CONFIG_FIELD_FILTER)                  += vf_field.o
 +OBJS-$(CONFIG_FIELDHINT_FILTER)              += vf_fieldhint.o
 +OBJS-$(CONFIG_FIELDMATCH_FILTER)             += vf_fieldmatch.o
  OBJS-$(CONFIG_FIELDORDER_FILTER)             += vf_fieldorder.o
 +OBJS-$(CONFIG_FIND_RECT_FILTER)              += vf_find_rect.o lavfutils.o
  OBJS-$(CONFIG_FORMAT_FILTER)                 += vf_format.o
  OBJS-$(CONFIG_FPS_FILTER)                    += vf_fps.o
  OBJS-$(CONFIG_FRAMEPACK_FILTER)              += vf_framepack.o
 +OBJS-$(CONFIG_FRAMERATE_FILTER)              += vf_framerate.o
 +OBJS-$(CONFIG_FRAMESTEP_FILTER)              += vf_framestep.o
  OBJS-$(CONFIG_FREI0R_FILTER)                 += vf_frei0r.o
 +OBJS-$(CONFIG_FSPP_FILTER)                   += vf_fspp.o
 +OBJS-$(CONFIG_GBLUR_FILTER)                  += vf_gblur.o
 +OBJS-$(CONFIG_GEQ_FILTER)                    += vf_geq.o
  OBJS-$(CONFIG_GRADFUN_FILTER)                += vf_gradfun.o
 +OBJS-$(CONFIG_HALDCLUT_FILTER)               += vf_lut3d.o dualinput.o framesync.o
  OBJS-$(CONFIG_HFLIP_FILTER)                  += vf_hflip.o
 +OBJS-$(CONFIG_HISTEQ_FILTER)                 += vf_histeq.o
 +OBJS-$(CONFIG_HISTOGRAM_FILTER)              += vf_histogram.o
  OBJS-$(CONFIG_HQDN3D_FILTER)                 += vf_hqdn3d.o
 +OBJS-$(CONFIG_HQX_FILTER)                    += vf_hqx.o
 +OBJS-$(CONFIG_HSTACK_FILTER)                 += vf_stack.o framesync.o
 +OBJS-$(CONFIG_HUE_FILTER)                    += vf_hue.o
  OBJS-$(CONFIG_HWDOWNLOAD_FILTER)             += vf_hwdownload.o
+ OBJS-$(CONFIG_HWMAP_FILTER)                  += vf_hwmap.o
  OBJS-$(CONFIG_HWUPLOAD_CUDA_FILTER)          += vf_hwupload_cuda.o
  OBJS-$(CONFIG_HWUPLOAD_FILTER)               += vf_hwupload.o
 +OBJS-$(CONFIG_HYSTERESIS_FILTER)             += vf_hysteresis.o framesync.o
 +OBJS-$(CONFIG_IDET_FILTER)                   += vf_idet.o
 +OBJS-$(CONFIG_IL_FILTER)                     += vf_il.o
 +OBJS-$(CONFIG_INFLATE_FILTER)                += vf_neighbor.o
  OBJS-$(CONFIG_INTERLACE_FILTER)              += vf_interlace.o
 +OBJS-$(CONFIG_INTERLEAVE_FILTER)             += f_interleave.o
 +OBJS-$(CONFIG_KERNDEINT_FILTER)              += vf_kerndeint.o
 +OBJS-$(CONFIG_LENSCORRECTION_FILTER)         += vf_lenscorrection.o
 +OBJS-$(CONFIG_LOOP_FILTER)                   += f_loop.o
  OBJS-$(CONFIG_LUT_FILTER)                    += vf_lut.o
 +OBJS-$(CONFIG_LUT2_FILTER)                   += vf_lut2.o framesync.o
 +OBJS-$(CONFIG_LUT3D_FILTER)                  += vf_lut3d.o
  OBJS-$(CONFIG_LUTRGB_FILTER)                 += vf_lut.o
  OBJS-$(CONFIG_LUTYUV_FILTER)                 += vf_lut.o
 +OBJS-$(CONFIG_MASKEDCLAMP_FILTER)            += vf_maskedclamp.o framesync.o
 +OBJS-$(CONFIG_MASKEDMERGE_FILTER)            += vf_maskedmerge.o framesync.o
 +OBJS-$(CONFIG_MCDEINT_FILTER)                += vf_mcdeint.o
 +OBJS-$(CONFIG_MERGEPLANES_FILTER)            += vf_mergeplanes.o framesync.o
 +OBJS-$(CONFIG_MESTIMATE_FILTER)              += vf_mestimate.o motion_estimation.o
 +OBJS-$(CONFIG_METADATA_FILTER)               += f_metadata.o
 +OBJS-$(CONFIG_MIDEQUALIZER_FILTER)           += vf_midequalizer.o framesync.o
 +OBJS-$(CONFIG_MINTERPOLATE_FILTER)           += vf_minterpolate.o motion_estimation.o
 +OBJS-$(CONFIG_MPDECIMATE_FILTER)             += vf_mpdecimate.o
  OBJS-$(CONFIG_NEGATE_FILTER)                 += vf_lut.o
 +OBJS-$(CONFIG_NLMEANS_FILTER)                += vf_nlmeans.o
 +OBJS-$(CONFIG_NNEDI_FILTER)                  += vf_nnedi.o
  OBJS-$(CONFIG_NOFORMAT_FILTER)               += vf_format.o
 +OBJS-$(CONFIG_NOISE_FILTER)                  += vf_noise.o
  OBJS-$(CONFIG_NULL_FILTER)                   += vf_null.o
 +OBJS-$(CONFIG_OCR_FILTER)                    += vf_ocr.o
  OBJS-$(CONFIG_OCV_FILTER)                    += vf_libopencv.o
 -OBJS-$(CONFIG_OVERLAY_FILTER)                += vf_overlay.o
 +OBJS-$(CONFIG_OPENCL)                        += deshake_opencl.o unsharp_opencl.o
 +OBJS-$(CONFIG_OVERLAY_FILTER)                += vf_overlay.o dualinput.o framesync.o
 +OBJS-$(CONFIG_OWDENOISE_FILTER)              += vf_owdenoise.o
  OBJS-$(CONFIG_PAD_FILTER)                    += vf_pad.o
 +OBJS-$(CONFIG_PALETTEGEN_FILTER)             += vf_palettegen.o
 +OBJS-$(CONFIG_PALETTEUSE_FILTER)             += vf_paletteuse.o dualinput.o framesync.o
 +OBJS-$(CONFIG_PERMS_FILTER)                  += f_perms.o
 +OBJS-$(CONFIG_PERSPECTIVE_FILTER)            += vf_perspective.o
 +OBJS-$(CONFIG_PHASE_FILTER)                  += vf_phase.o
  OBJS-$(CONFIG_PIXDESCTEST_FILTER)            += vf_pixdesctest.o
 -OBJS-$(CONFIG_SCALE_FILTER)                  += vf_scale.o
 -OBJS-$(CONFIG_SCALE_NPP_FILTER)              += vf_scale_npp.o
 +OBJS-$(CONFIG_PP_FILTER)                     += vf_pp.o
 +OBJS-$(CONFIG_PP7_FILTER)                    += vf_pp7.o
 +OBJS-$(CONFIG_PREMULTIPLY_FILTER)            += vf_premultiply.o framesync.o
 +OBJS-$(CONFIG_PREWITT_FILTER)                += vf_convolution.o
 +OBJS-$(CONFIG_PSNR_FILTER)                   += vf_psnr.o dualinput.o framesync.o
 +OBJS-$(CONFIG_PULLUP_FILTER)                 += vf_pullup.o
 +OBJS-$(CONFIG_QP_FILTER)                     += vf_qp.o
 +OBJS-$(CONFIG_RANDOM_FILTER)                 += vf_random.o
 +OBJS-$(CONFIG_READEIA608_FILTER)             += vf_readeia608.o
 +OBJS-$(CONFIG_READVITC_FILTER)               += vf_readvitc.o
 +OBJS-$(CONFIG_REALTIME_FILTER)               += f_realtime.o
 +OBJS-$(CONFIG_REMAP_FILTER)                  += vf_remap.o framesync.o
 +OBJS-$(CONFIG_REMOVEGRAIN_FILTER)            += vf_removegrain.o
 +OBJS-$(CONFIG_REMOVELOGO_FILTER)             += bbox.o lswsutils.o lavfutils.o vf_removelogo.o
 +OBJS-$(CONFIG_REPEATFIELDS_FILTER)           += vf_repeatfields.o
 +OBJS-$(CONFIG_REVERSE_FILTER)                += f_reverse.o
 +OBJS-$(CONFIG_ROTATE_FILTER)                 += vf_rotate.o
 +OBJS-$(CONFIG_SAB_FILTER)                    += vf_sab.o
 +OBJS-$(CONFIG_SCALE_FILTER)                  += vf_scale.o scale.o
 +OBJS-$(CONFIG_SCALE_NPP_FILTER)              += vf_scale_npp.o scale.o
  OBJS-$(CONFIG_SCALE_QSV_FILTER)              += vf_scale_qsv.o
 -OBJS-$(CONFIG_SCALE_VAAPI_FILTER)            += vf_scale_vaapi.o
 -OBJS-$(CONFIG_SELECT_FILTER)                 += vf_select.o
 +OBJS-$(CONFIG_SCALE_VAAPI_FILTER)            += vf_scale_vaapi.o scale.o
 +OBJS-$(CONFIG_SCALE2REF_FILTER)              += vf_scale.o scale.o
 +OBJS-$(CONFIG_SELECT_FILTER)                 += f_select.o
 +OBJS-$(CONFIG_SELECTIVECOLOR_FILTER)         += vf_selectivecolor.o
 +OBJS-$(CONFIG_SENDCMD_FILTER)                += f_sendcmd.o
 +OBJS-$(CONFIG_SEPARATEFIELDS_FILTER)         += vf_separatefields.o
  OBJS-$(CONFIG_SETDAR_FILTER)                 += vf_aspect.o
 +OBJS-$(CONFIG_SETFIELD_FILTER)               += vf_setfield.o
  OBJS-$(CONFIG_SETPTS_FILTER)                 += setpts.o
  OBJS-$(CONFIG_SETSAR_FILTER)                 += vf_aspect.o
  OBJS-$(CONFIG_SETTB_FILTER)                  += settb.o
  OBJS-$(CONFIG_SHOWINFO_FILTER)               += vf_showinfo.o
 +OBJS-$(CONFIG_SHOWPALETTE_FILTER)            += vf_showpalette.o
 +OBJS-$(CONFIG_SHUFFLEFRAMES_FILTER)          += vf_shuffleframes.o
  OBJS-$(CONFIG_SHUFFLEPLANES_FILTER)          += vf_shuffleplanes.o
 +OBJS-$(CONFIG_SIDEDATA_FILTER)               += f_sidedata.o
 +OBJS-$(CONFIG_SIGNALSTATS_FILTER)            += vf_signalstats.o
 +OBJS-$(CONFIG_SIGNATURE_FILTER)              += vf_signature.o
 +OBJS-$(CONFIG_SMARTBLUR_FILTER)              += vf_smartblur.o
 +OBJS-$(CONFIG_SOBEL_FILTER)                  += vf_convolution.o
  OBJS-$(CONFIG_SPLIT_FILTER)                  += split.o
 +OBJS-$(CONFIG_SPP_FILTER)                    += vf_spp.o
 +OBJS-$(CONFIG_SSIM_FILTER)                   += vf_ssim.o dualinput.o framesync.o
 +OBJS-$(CONFIG_STEREO3D_FILTER)               += vf_stereo3d.o
 +OBJS-$(CONFIG_STREAMSELECT_FILTER)           += f_streamselect.o
 +OBJS-$(CONFIG_SUBTITLES_FILTER)              += vf_subtitles.o
 +OBJS-$(CONFIG_SUPER2XSAI_FILTER)             += vf_super2xsai.o
 +OBJS-$(CONFIG_SWAPRECT_FILTER)               += vf_swaprect.o
 +OBJS-$(CONFIG_SWAPUV_FILTER)                 += vf_swapuv.o
 +OBJS-$(CONFIG_TBLEND_FILTER)                 += vf_blend.o dualinput.o framesync.o
 +OBJS-$(CONFIG_TELECINE_FILTER)               += vf_telecine.o
 +OBJS-$(CONFIG_THRESHOLD_FILTER)              += vf_threshold.o
 +OBJS-$(CONFIG_THUMBNAIL_FILTER)              += vf_thumbnail.o
 +OBJS-$(CONFIG_TILE_FILTER)                   += vf_tile.o
 +OBJS-$(CONFIG_TINTERLACE_FILTER)             += vf_tinterlace.o
  OBJS-$(CONFIG_TRANSPOSE_FILTER)              += vf_transpose.o
  OBJS-$(CONFIG_TRIM_FILTER)                   += trim.o
  OBJS-$(CONFIG_UNSHARP_FILTER)                += vf_unsharp.o
 +OBJS-$(CONFIG_USPP_FILTER)                   += vf_uspp.o
 +OBJS-$(CONFIG_VAGUEDENOISER_FILTER)          += vf_vaguedenoiser.o
 +OBJS-$(CONFIG_VECTORSCOPE_FILTER)            += vf_vectorscope.o
  OBJS-$(CONFIG_VFLIP_FILTER)                  += vf_vflip.o
 +OBJS-$(CONFIG_VIDSTABDETECT_FILTER)          += vidstabutils.o vf_vidstabdetect.o
 +OBJS-$(CONFIG_VIDSTABTRANSFORM_FILTER)       += vidstabutils.o vf_vidstabtransform.o
 +OBJS-$(CONFIG_VIGNETTE_FILTER)               += vf_vignette.o
 +OBJS-$(CONFIG_VSTACK_FILTER)                 += vf_stack.o framesync.o
 +OBJS-$(CONFIG_W3FDIF_FILTER)                 += vf_w3fdif.o
 +OBJS-$(CONFIG_WAVEFORM_FILTER)               += vf_waveform.o
 +OBJS-$(CONFIG_WEAVE_FILTER)                  += vf_weave.o
 +OBJS-$(CONFIG_XBR_FILTER)                    += vf_xbr.o
  OBJS-$(CONFIG_YADIF_FILTER)                  += vf_yadif.o
 +OBJS-$(CONFIG_ZMQ_FILTER)                    += f_zmq.o
 +OBJS-$(CONFIG_ZOOMPAN_FILTER)                += vf_zoompan.o
 +OBJS-$(CONFIG_ZSCALE_FILTER)                 += vf_zscale.o
  
 -OBJS-$(CONFIG_NULLSINK_FILTER)               += vsink_nullsink.o
 -
 -OBJS-$(CONFIG_COLOR_FILTER)                  += vsrc_color.o
 +OBJS-$(CONFIG_ALLRGB_FILTER)                 += vsrc_testsrc.o
 +OBJS-$(CONFIG_ALLYUV_FILTER)                 += vsrc_testsrc.o
 +OBJS-$(CONFIG_CELLAUTO_FILTER)               += vsrc_cellauto.o
 +OBJS-$(CONFIG_COLOR_FILTER)                  += vsrc_testsrc.o
 +OBJS-$(CONFIG_COREIMAGESRC_FILTER)           += vf_coreimage.o
  OBJS-$(CONFIG_FREI0R_SRC_FILTER)             += vf_frei0r.o
 -OBJS-$(CONFIG_MOVIE_FILTER)                  += vsrc_movie.o
 -OBJS-$(CONFIG_NULLSRC_FILTER)                += vsrc_nullsrc.o
 +OBJS-$(CONFIG_HALDCLUTSRC_FILTER)            += vsrc_testsrc.o
 +OBJS-$(CONFIG_LIFE_FILTER)                   += vsrc_life.o
 +OBJS-$(CONFIG_MANDELBROT_FILTER)             += vsrc_mandelbrot.o
 +OBJS-$(CONFIG_MPTESTSRC_FILTER)              += vsrc_mptestsrc.o
 +OBJS-$(CONFIG_NULLSRC_FILTER)                += vsrc_testsrc.o
  OBJS-$(CONFIG_RGBTESTSRC_FILTER)             += vsrc_testsrc.o
 +OBJS-$(CONFIG_SMPTEBARS_FILTER)              += vsrc_testsrc.o
 +OBJS-$(CONFIG_SMPTEHDBARS_FILTER)            += vsrc_testsrc.o
  OBJS-$(CONFIG_TESTSRC_FILTER)                += vsrc_testsrc.o
 +OBJS-$(CONFIG_TESTSRC2_FILTER)               += vsrc_testsrc.o
 +OBJS-$(CONFIG_YUVTESTSRC_FILTER)             += vsrc_testsrc.o
 +
 +OBJS-$(CONFIG_NULLSINK_FILTER)               += vsink_nullsink.o
 +
 +# multimedia filters
 +OBJS-$(CONFIG_ABITSCOPE_FILTER)              += avf_abitscope.o
 +OBJS-$(CONFIG_ADRAWGRAPH_FILTER)             += f_drawgraph.o
 +OBJS-$(CONFIG_AHISTOGRAM_FILTER)             += avf_ahistogram.o
 +OBJS-$(CONFIG_APHASEMETER_FILTER)            += avf_aphasemeter.o
 +OBJS-$(CONFIG_AVECTORSCOPE_FILTER)           += avf_avectorscope.o
 +OBJS-$(CONFIG_CONCAT_FILTER)                 += avf_concat.o
 +OBJS-$(CONFIG_SHOWCQT_FILTER)                += avf_showcqt.o lswsutils.o lavfutils.o
 +OBJS-$(CONFIG_SHOWFREQS_FILTER)              += avf_showfreqs.o window_func.o
 +OBJS-$(CONFIG_SHOWSPECTRUM_FILTER)           += avf_showspectrum.o window_func.o
 +OBJS-$(CONFIG_SHOWSPECTRUMPIC_FILTER)        += avf_showspectrum.o window_func.o
 +OBJS-$(CONFIG_SHOWVOLUME_FILTER)             += avf_showvolume.o
 +OBJS-$(CONFIG_SHOWWAVES_FILTER)              += avf_showwaves.o
 +OBJS-$(CONFIG_SHOWWAVESPIC_FILTER)           += avf_showwaves.o
 +OBJS-$(CONFIG_SPECTRUMSYNTH_FILTER)          += vaf_spectrumsynth.o window_func.o
 +
 +# multimedia sources
 +OBJS-$(CONFIG_AMOVIE_FILTER)                 += src_movie.o
 +OBJS-$(CONFIG_MOVIE_FILTER)                  += src_movie.o
 +
 +# Windows resource file
 +SLIBOBJS-$(HAVE_GNU_WINDRES)                 += avfilterres.o
 +
 +SKIPHEADERS-$(CONFIG_LIBVIDSTAB)             += vidstabutils.h
 +SKIPHEADERS-$(CONFIG_OPENCL)                 += opencl_internal.h deshake_opencl_kernel.h unsharp_opencl_kernel.h
 +
 +OBJS-$(CONFIG_SHARED)                        += log2_tab.o
  
  TOOLS     = graph2dot
 -TESTPROGS = filtfmts
 +TESTPROGS = drawutils filtfmts formats integral
 +
 +TOOLS-$(CONFIG_LIBZMQ) += zmqsend
 +
 +clean::
 +      $(RM) $(CLEANSUFFIXES:%=libavfilter/libmpcodecs/%)
diff --combined libavfilter/allfilters.c
@@@ -2,27 -2,25 +2,27 @@@
   * filter registration
   * Copyright (c) 2008 Vitor Sessak
   *
 - * This file is part of Libav.
 + * This file is part of FFmpeg.
   *
 - * Libav is free software; you can redistribute it and/or
 + * FFmpeg is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 2.1 of the License, or (at your option) any later version.
   *
 - * Libav is distributed in the hope that it will be useful,
 + * FFmpeg is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
 - * License along with Libav; if not, write to the Free Software
 + * License along with FFmpeg; if not, write to the Free Software
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
 +#include "libavutil/thread.h"
  #include "avfilter.h"
  #include "config.h"
 +#include "opencl_allkernels.h"
  
  
  #define REGISTER_FILTER(X, x, y)                                        \
          avfilter_register(&ff_##x);                                     \
      }
  
 -void avfilter_register_all(void)
 +static void register_all(void)
  {
 -    static int initialized;
 -
 -    if (initialized)
 -        return;
 -    initialized = 1;
 -
 +    REGISTER_FILTER(ABENCH,         abench,         af);
 +    REGISTER_FILTER(ACOMPRESSOR,    acompressor,    af);
 +    REGISTER_FILTER(ACROSSFADE,     acrossfade,     af);
 +    REGISTER_FILTER(ACRUSHER,       acrusher,       af);
 +    REGISTER_FILTER(ADELAY,         adelay,         af);
 +    REGISTER_FILTER(AECHO,          aecho,          af);
 +    REGISTER_FILTER(AEMPHASIS,      aemphasis,      af);
 +    REGISTER_FILTER(AEVAL,          aeval,          af);
 +    REGISTER_FILTER(AFADE,          afade,          af);
 +    REGISTER_FILTER(AFFTFILT,       afftfilt,       af);
      REGISTER_FILTER(AFORMAT,        aformat,        af);
 +    REGISTER_FILTER(AGATE,          agate,          af);
 +    REGISTER_FILTER(AINTERLEAVE,    ainterleave,    af);
 +    REGISTER_FILTER(ALIMITER,       alimiter,       af);
 +    REGISTER_FILTER(ALLPASS,        allpass,        af);
 +    REGISTER_FILTER(ALOOP,          aloop,          af);
 +    REGISTER_FILTER(AMERGE,         amerge,         af);
 +    REGISTER_FILTER(AMETADATA,      ametadata,      af);
      REGISTER_FILTER(AMIX,           amix,           af);
 +    REGISTER_FILTER(ANEQUALIZER,    anequalizer,    af);
      REGISTER_FILTER(ANULL,          anull,          af);
 +    REGISTER_FILTER(APAD,           apad,           af);
 +    REGISTER_FILTER(APERMS,         aperms,         af);
 +    REGISTER_FILTER(APHASER,        aphaser,        af);
 +    REGISTER_FILTER(APULSATOR,      apulsator,      af);
 +    REGISTER_FILTER(AREALTIME,      arealtime,      af);
 +    REGISTER_FILTER(ARESAMPLE,      aresample,      af);
 +    REGISTER_FILTER(AREVERSE,       areverse,       af);
 +    REGISTER_FILTER(ASELECT,        aselect,        af);
 +    REGISTER_FILTER(ASENDCMD,       asendcmd,       af);
 +    REGISTER_FILTER(ASETNSAMPLES,   asetnsamples,   af);
      REGISTER_FILTER(ASETPTS,        asetpts,        af);
 +    REGISTER_FILTER(ASETRATE,       asetrate,       af);
      REGISTER_FILTER(ASETTB,         asettb,         af);
      REGISTER_FILTER(ASHOWINFO,      ashowinfo,      af);
 +    REGISTER_FILTER(ASIDEDATA,      asidedata,      af);
      REGISTER_FILTER(ASPLIT,         asplit,         af);
 -    REGISTER_FILTER(ASYNCTS,        asyncts,        af);
 +    REGISTER_FILTER(ASTATS,         astats,         af);
 +    REGISTER_FILTER(ASTREAMSELECT,  astreamselect,  af);
 +    REGISTER_FILTER(ATEMPO,         atempo,         af);
      REGISTER_FILTER(ATRIM,          atrim,          af);
 +    REGISTER_FILTER(AZMQ,           azmq,           af);
 +    REGISTER_FILTER(BANDPASS,       bandpass,       af);
 +    REGISTER_FILTER(BANDREJECT,     bandreject,     af);
 +    REGISTER_FILTER(BASS,           bass,           af);
 +    REGISTER_FILTER(BIQUAD,         biquad,         af);
      REGISTER_FILTER(BS2B,           bs2b,           af);
      REGISTER_FILTER(CHANNELMAP,     channelmap,     af);
      REGISTER_FILTER(CHANNELSPLIT,   channelsplit,   af);
 +    REGISTER_FILTER(CHORUS,         chorus,         af);
      REGISTER_FILTER(COMPAND,        compand,        af);
 +    REGISTER_FILTER(COMPENSATIONDELAY, compensationdelay, af);
 +    REGISTER_FILTER(CRYSTALIZER,    crystalizer,    af);
 +    REGISTER_FILTER(DCSHIFT,        dcshift,        af);
 +    REGISTER_FILTER(DYNAUDNORM,     dynaudnorm,     af);
 +    REGISTER_FILTER(EARWAX,         earwax,         af);
 +    REGISTER_FILTER(EBUR128,        ebur128,        af);
 +    REGISTER_FILTER(EQUALIZER,      equalizer,      af);
 +    REGISTER_FILTER(EXTRASTEREO,    extrastereo,    af);
 +    REGISTER_FILTER(FIREQUALIZER,   firequalizer,   af);
 +    REGISTER_FILTER(FLANGER,        flanger,        af);
      REGISTER_FILTER(HDCD,           hdcd,           af);
 +    REGISTER_FILTER(HIGHPASS,       highpass,       af);
      REGISTER_FILTER(JOIN,           join,           af);
 +    REGISTER_FILTER(LADSPA,         ladspa,         af);
 +    REGISTER_FILTER(LOUDNORM,       loudnorm,       af);
 +    REGISTER_FILTER(LOWPASS,        lowpass,        af);
 +    REGISTER_FILTER(PAN,            pan,            af);
 +    REGISTER_FILTER(REPLAYGAIN,     replaygain,     af);
      REGISTER_FILTER(RESAMPLE,       resample,       af);
 +    REGISTER_FILTER(RUBBERBAND,     rubberband,     af);
 +    REGISTER_FILTER(SIDECHAINCOMPRESS, sidechaincompress, af);
 +    REGISTER_FILTER(SIDECHAINGATE,  sidechaingate,  af);
 +    REGISTER_FILTER(SILENCEDETECT,  silencedetect,  af);
 +    REGISTER_FILTER(SILENCEREMOVE,  silenceremove,  af);
 +    REGISTER_FILTER(SOFALIZER,      sofalizer,      af);
 +    REGISTER_FILTER(STEREOTOOLS,    stereotools,    af);
 +    REGISTER_FILTER(STEREOWIDEN,    stereowiden,    af);
 +    REGISTER_FILTER(TREBLE,         treble,         af);
 +    REGISTER_FILTER(TREMOLO,        tremolo,        af);
 +    REGISTER_FILTER(VIBRATO,        vibrato,        af);
      REGISTER_FILTER(VOLUME,         volume,         af);
 +    REGISTER_FILTER(VOLUMEDETECT,   volumedetect,   af);
  
 +    REGISTER_FILTER(AEVALSRC,       aevalsrc,       asrc);
 +    REGISTER_FILTER(ANOISESRC,      anoisesrc,      asrc);
      REGISTER_FILTER(ANULLSRC,       anullsrc,       asrc);
 +    REGISTER_FILTER(FLITE,          flite,          asrc);
 +    REGISTER_FILTER(SINE,           sine,           asrc);
  
      REGISTER_FILTER(ANULLSINK,      anullsink,      asink);
  
 +    REGISTER_FILTER(ALPHAEXTRACT,   alphaextract,   vf);
 +    REGISTER_FILTER(ALPHAMERGE,     alphamerge,     vf);
 +    REGISTER_FILTER(ASS,            ass,            vf);
 +    REGISTER_FILTER(ATADENOISE,     atadenoise,     vf);
 +    REGISTER_FILTER(AVGBLUR,        avgblur,        vf);
 +    REGISTER_FILTER(BBOX,           bbox,           vf);
 +    REGISTER_FILTER(BENCH,          bench,          vf);
 +    REGISTER_FILTER(BITPLANENOISE,  bitplanenoise,  vf);
 +    REGISTER_FILTER(BLACKDETECT,    blackdetect,    vf);
      REGISTER_FILTER(BLACKFRAME,     blackframe,     vf);
 +    REGISTER_FILTER(BLEND,          blend,          vf);
      REGISTER_FILTER(BOXBLUR,        boxblur,        vf);
 +    REGISTER_FILTER(BWDIF,          bwdif,          vf);
 +    REGISTER_FILTER(CHROMAKEY,      chromakey,      vf);
 +    REGISTER_FILTER(CIESCOPE,       ciescope,       vf);
 +    REGISTER_FILTER(CODECVIEW,      codecview,      vf);
 +    REGISTER_FILTER(COLORBALANCE,   colorbalance,   vf);
 +    REGISTER_FILTER(COLORCHANNELMIXER, colorchannelmixer, vf);
 +    REGISTER_FILTER(COLORKEY,       colorkey,       vf);
 +    REGISTER_FILTER(COLORLEVELS,    colorlevels,    vf);
 +    REGISTER_FILTER(COLORMATRIX,    colormatrix,    vf);
 +    REGISTER_FILTER(COLORSPACE,     colorspace,     vf);
 +    REGISTER_FILTER(CONVOLUTION,    convolution,    vf);
      REGISTER_FILTER(COPY,           copy,           vf);
 +    REGISTER_FILTER(COREIMAGE,      coreimage,      vf);
 +    REGISTER_FILTER(COVER_RECT,     cover_rect,     vf);
      REGISTER_FILTER(CROP,           crop,           vf);
      REGISTER_FILTER(CROPDETECT,     cropdetect,     vf);
 +    REGISTER_FILTER(CURVES,         curves,         vf);
 +    REGISTER_FILTER(DATASCOPE,      datascope,      vf);
 +    REGISTER_FILTER(DCTDNOIZ,       dctdnoiz,       vf);
 +    REGISTER_FILTER(DEBAND,         deband,         vf);
 +    REGISTER_FILTER(DECIMATE,       decimate,       vf);
 +    REGISTER_FILTER(DEFLATE,        deflate,        vf);
      REGISTER_FILTER(DEINTERLACE_QSV,deinterlace_qsv,vf);
 +    REGISTER_FILTER(DEINTERLACE_VAAPI, deinterlace_vaapi, vf);
 +    REGISTER_FILTER(DEJUDDER,       dejudder,       vf);
      REGISTER_FILTER(DELOGO,         delogo,         vf);
 +    REGISTER_FILTER(DESHAKE,        deshake,        vf);
 +    REGISTER_FILTER(DETELECINE,     detelecine,     vf);
 +    REGISTER_FILTER(DILATION,       dilation,       vf);
 +    REGISTER_FILTER(DISPLACE,       displace,       vf);
      REGISTER_FILTER(DRAWBOX,        drawbox,        vf);
 +    REGISTER_FILTER(DRAWGRAPH,      drawgraph,      vf);
 +    REGISTER_FILTER(DRAWGRID,       drawgrid,       vf);
      REGISTER_FILTER(DRAWTEXT,       drawtext,       vf);
 +    REGISTER_FILTER(EDGEDETECT,     edgedetect,     vf);
 +    REGISTER_FILTER(ELBG,           elbg,           vf);
 +    REGISTER_FILTER(EQ,             eq,             vf);
 +    REGISTER_FILTER(EROSION,        erosion,        vf);
 +    REGISTER_FILTER(EXTRACTPLANES,  extractplanes,  vf);
      REGISTER_FILTER(FADE,           fade,           vf);
 +    REGISTER_FILTER(FFTFILT,        fftfilt,        vf);
 +    REGISTER_FILTER(FIELD,          field,          vf);
 +    REGISTER_FILTER(FIELDHINT,      fieldhint,      vf);
 +    REGISTER_FILTER(FIELDMATCH,     fieldmatch,     vf);
      REGISTER_FILTER(FIELDORDER,     fieldorder,     vf);
 +    REGISTER_FILTER(FIND_RECT,      find_rect,      vf);
      REGISTER_FILTER(FORMAT,         format,         vf);
      REGISTER_FILTER(FPS,            fps,            vf);
      REGISTER_FILTER(FRAMEPACK,      framepack,      vf);
 +    REGISTER_FILTER(FRAMERATE,      framerate,      vf);
 +    REGISTER_FILTER(FRAMESTEP,      framestep,      vf);
      REGISTER_FILTER(FREI0R,         frei0r,         vf);
 +    REGISTER_FILTER(FSPP,           fspp,           vf);
 +    REGISTER_FILTER(GBLUR,          gblur,          vf);
 +    REGISTER_FILTER(GEQ,            geq,            vf);
      REGISTER_FILTER(GRADFUN,        gradfun,        vf);
 +    REGISTER_FILTER(HALDCLUT,       haldclut,       vf);
      REGISTER_FILTER(HFLIP,          hflip,          vf);
 +    REGISTER_FILTER(HISTEQ,         histeq,         vf);
 +    REGISTER_FILTER(HISTOGRAM,      histogram,      vf);
      REGISTER_FILTER(HQDN3D,         hqdn3d,         vf);
 +    REGISTER_FILTER(HQX,            hqx,            vf);
 +    REGISTER_FILTER(HSTACK,         hstack,         vf);
 +    REGISTER_FILTER(HUE,            hue,            vf);
      REGISTER_FILTER(HWDOWNLOAD,     hwdownload,     vf);
+     REGISTER_FILTER(HWMAP,          hwmap,          vf);
      REGISTER_FILTER(HWUPLOAD,       hwupload,       vf);
      REGISTER_FILTER(HWUPLOAD_CUDA,  hwupload_cuda,  vf);
 +    REGISTER_FILTER(HYSTERESIS,     hysteresis,     vf);
 +    REGISTER_FILTER(IDET,           idet,           vf);
 +    REGISTER_FILTER(IL,             il,             vf);
 +    REGISTER_FILTER(INFLATE,        inflate,        vf);
      REGISTER_FILTER(INTERLACE,      interlace,      vf);
 +    REGISTER_FILTER(INTERLEAVE,     interleave,     vf);
 +    REGISTER_FILTER(KERNDEINT,      kerndeint,      vf);
 +    REGISTER_FILTER(LENSCORRECTION, lenscorrection, vf);
 +    REGISTER_FILTER(LOOP,           loop,           vf);
      REGISTER_FILTER(LUT,            lut,            vf);
 +    REGISTER_FILTER(LUT2,           lut2,           vf);
 +    REGISTER_FILTER(LUT3D,          lut3d,          vf);
      REGISTER_FILTER(LUTRGB,         lutrgb,         vf);
      REGISTER_FILTER(LUTYUV,         lutyuv,         vf);
 +    REGISTER_FILTER(MASKEDCLAMP,    maskedclamp,    vf);
 +    REGISTER_FILTER(MASKEDMERGE,    maskedmerge,    vf);
 +    REGISTER_FILTER(MCDEINT,        mcdeint,        vf);
 +    REGISTER_FILTER(MERGEPLANES,    mergeplanes,    vf);
 +    REGISTER_FILTER(MESTIMATE,      mestimate,      vf);
 +    REGISTER_FILTER(METADATA,       metadata,       vf);
 +    REGISTER_FILTER(MIDEQUALIZER,   midequalizer,   vf);
 +    REGISTER_FILTER(MINTERPOLATE,   minterpolate,   vf);
 +    REGISTER_FILTER(MPDECIMATE,     mpdecimate,     vf);
      REGISTER_FILTER(NEGATE,         negate,         vf);
 +    REGISTER_FILTER(NLMEANS,        nlmeans,        vf);
 +    REGISTER_FILTER(NNEDI,          nnedi,          vf);
      REGISTER_FILTER(NOFORMAT,       noformat,       vf);
 +    REGISTER_FILTER(NOISE,          noise,          vf);
      REGISTER_FILTER(NULL,           null,           vf);
 +    REGISTER_FILTER(OCR,            ocr,            vf);
      REGISTER_FILTER(OCV,            ocv,            vf);
      REGISTER_FILTER(OVERLAY,        overlay,        vf);
 +    REGISTER_FILTER(OWDENOISE,      owdenoise,      vf);
      REGISTER_FILTER(PAD,            pad,            vf);
 +    REGISTER_FILTER(PALETTEGEN,     palettegen,     vf);
 +    REGISTER_FILTER(PALETTEUSE,     paletteuse,     vf);
 +    REGISTER_FILTER(PERMS,          perms,          vf);
 +    REGISTER_FILTER(PERSPECTIVE,    perspective,    vf);
 +    REGISTER_FILTER(PHASE,          phase,          vf);
      REGISTER_FILTER(PIXDESCTEST,    pixdesctest,    vf);
 +    REGISTER_FILTER(PP,             pp,             vf);
 +    REGISTER_FILTER(PP7,            pp7,            vf);
 +    REGISTER_FILTER(PREMULTIPLY,    premultiply,    vf);
 +    REGISTER_FILTER(PREWITT,        prewitt,        vf);
 +    REGISTER_FILTER(PSNR,           psnr,           vf);
 +    REGISTER_FILTER(PULLUP,         pullup,         vf);
 +    REGISTER_FILTER(QP,             qp,             vf);
 +    REGISTER_FILTER(RANDOM,         random,         vf);
 +    REGISTER_FILTER(READEIA608,     readeia608,     vf);
 +    REGISTER_FILTER(READVITC,       readvitc,       vf);
 +    REGISTER_FILTER(REALTIME,       realtime,       vf);
 +    REGISTER_FILTER(REMAP,          remap,          vf);
 +    REGISTER_FILTER(REMOVEGRAIN,    removegrain,    vf);
 +    REGISTER_FILTER(REMOVELOGO,     removelogo,     vf);
 +    REGISTER_FILTER(REPEATFIELDS,   repeatfields,   vf);
 +    REGISTER_FILTER(REVERSE,        reverse,        vf);
 +    REGISTER_FILTER(ROTATE,         rotate,         vf);
 +    REGISTER_FILTER(SAB,            sab,            vf);
      REGISTER_FILTER(SCALE,          scale,          vf);
      REGISTER_FILTER(SCALE_NPP,      scale_npp,      vf);
      REGISTER_FILTER(SCALE_QSV,      scale_qsv,      vf);
      REGISTER_FILTER(SCALE_VAAPI,    scale_vaapi,    vf);
 +    REGISTER_FILTER(SCALE2REF,      scale2ref,      vf);
      REGISTER_FILTER(SELECT,         select,         vf);
 +    REGISTER_FILTER(SELECTIVECOLOR, selectivecolor, vf);
 +    REGISTER_FILTER(SENDCMD,        sendcmd,        vf);
 +    REGISTER_FILTER(SEPARATEFIELDS, separatefields, vf);
      REGISTER_FILTER(SETDAR,         setdar,         vf);
 +    REGISTER_FILTER(SETFIELD,       setfield,       vf);
      REGISTER_FILTER(SETPTS,         setpts,         vf);
      REGISTER_FILTER(SETSAR,         setsar,         vf);
      REGISTER_FILTER(SETTB,          settb,          vf);
      REGISTER_FILTER(SHOWINFO,       showinfo,       vf);
 +    REGISTER_FILTER(SHOWPALETTE,    showpalette,    vf);
 +    REGISTER_FILTER(SHUFFLEFRAMES,  shuffleframes,  vf);
      REGISTER_FILTER(SHUFFLEPLANES,  shuffleplanes,  vf);
 +    REGISTER_FILTER(SIDEDATA,       sidedata,       vf);
 +    REGISTER_FILTER(SIGNALSTATS,    signalstats,    vf);
 +    REGISTER_FILTER(SIGNATURE,      signature,      vf);
 +    REGISTER_FILTER(SMARTBLUR,      smartblur,      vf);
 +    REGISTER_FILTER(SOBEL,          sobel,          vf);
      REGISTER_FILTER(SPLIT,          split,          vf);
 +    REGISTER_FILTER(SPP,            spp,            vf);
 +    REGISTER_FILTER(SSIM,           ssim,           vf);
 +    REGISTER_FILTER(STEREO3D,       stereo3d,       vf);
 +    REGISTER_FILTER(STREAMSELECT,   streamselect,   vf);
 +    REGISTER_FILTER(SUBTITLES,      subtitles,      vf);
 +    REGISTER_FILTER(SUPER2XSAI,     super2xsai,     vf);
 +    REGISTER_FILTER(SWAPRECT,       swaprect,       vf);
 +    REGISTER_FILTER(SWAPUV,         swapuv,         vf);
 +    REGISTER_FILTER(TBLEND,         tblend,         vf);
 +    REGISTER_FILTER(TELECINE,       telecine,       vf);
 +    REGISTER_FILTER(THRESHOLD,      threshold,      vf);
 +    REGISTER_FILTER(THUMBNAIL,      thumbnail,      vf);
 +    REGISTER_FILTER(TILE,           tile,           vf);
 +    REGISTER_FILTER(TINTERLACE,     tinterlace,     vf);
      REGISTER_FILTER(TRANSPOSE,      transpose,      vf);
      REGISTER_FILTER(TRIM,           trim,           vf);
      REGISTER_FILTER(UNSHARP,        unsharp,        vf);
 +    REGISTER_FILTER(USPP,           uspp,           vf);
 +    REGISTER_FILTER(VAGUEDENOISER,  vaguedenoiser,  vf);
 +    REGISTER_FILTER(VECTORSCOPE,    vectorscope,    vf);
      REGISTER_FILTER(VFLIP,          vflip,          vf);
 +    REGISTER_FILTER(VIDSTABDETECT,  vidstabdetect,  vf);
 +    REGISTER_FILTER(VIDSTABTRANSFORM, vidstabtransform, vf);
 +    REGISTER_FILTER(VIGNETTE,       vignette,       vf);
 +    REGISTER_FILTER(VSTACK,         vstack,         vf);
 +    REGISTER_FILTER(W3FDIF,         w3fdif,         vf);
 +    REGISTER_FILTER(WAVEFORM,       waveform,       vf);
 +    REGISTER_FILTER(WEAVE,          weave,          vf);
 +    REGISTER_FILTER(XBR,            xbr,            vf);
      REGISTER_FILTER(YADIF,          yadif,          vf);
 +    REGISTER_FILTER(ZMQ,            zmq,            vf);
 +    REGISTER_FILTER(ZOOMPAN,        zoompan,        vf);
 +    REGISTER_FILTER(ZSCALE,         zscale,         vf);
  
 +    REGISTER_FILTER(ALLRGB,         allrgb,         vsrc);
 +    REGISTER_FILTER(ALLYUV,         allyuv,         vsrc);
 +    REGISTER_FILTER(CELLAUTO,       cellauto,       vsrc);
      REGISTER_FILTER(COLOR,          color,          vsrc);
 +    REGISTER_FILTER(COREIMAGESRC,   coreimagesrc,   vsrc);
      REGISTER_FILTER(FREI0R,         frei0r_src,     vsrc);
 -    REGISTER_FILTER(MOVIE,          movie,          vsrc);
 +    REGISTER_FILTER(HALDCLUTSRC,    haldclutsrc,    vsrc);
 +    REGISTER_FILTER(LIFE,           life,           vsrc);
 +    REGISTER_FILTER(MANDELBROT,     mandelbrot,     vsrc);
 +    REGISTER_FILTER(MPTESTSRC,      mptestsrc,      vsrc);
      REGISTER_FILTER(NULLSRC,        nullsrc,        vsrc);
      REGISTER_FILTER(RGBTESTSRC,     rgbtestsrc,     vsrc);
 +    REGISTER_FILTER(SMPTEBARS,      smptebars,      vsrc);
 +    REGISTER_FILTER(SMPTEHDBARS,    smptehdbars,    vsrc);
      REGISTER_FILTER(TESTSRC,        testsrc,        vsrc);
 +    REGISTER_FILTER(TESTSRC2,       testsrc2,       vsrc);
 +    REGISTER_FILTER(YUVTESTSRC,     yuvtestsrc,     vsrc);
  
      REGISTER_FILTER(NULLSINK,       nullsink,       vsink);
  
 +    /* multimedia filters */
 +    REGISTER_FILTER(ABITSCOPE,      abitscope,      avf);
 +    REGISTER_FILTER(ADRAWGRAPH,     adrawgraph,     avf);
 +    REGISTER_FILTER(AHISTOGRAM,     ahistogram,     avf);
 +    REGISTER_FILTER(APHASEMETER,    aphasemeter,    avf);
 +    REGISTER_FILTER(AVECTORSCOPE,   avectorscope,   avf);
 +    REGISTER_FILTER(CONCAT,         concat,         avf);
 +    REGISTER_FILTER(SHOWCQT,        showcqt,        avf);
 +    REGISTER_FILTER(SHOWFREQS,      showfreqs,      avf);
 +    REGISTER_FILTER(SHOWSPECTRUM,   showspectrum,   avf);
 +    REGISTER_FILTER(SHOWSPECTRUMPIC, showspectrumpic, avf);
 +    REGISTER_FILTER(SHOWVOLUME,     showvolume,     avf);
 +    REGISTER_FILTER(SHOWWAVES,      showwaves,      avf);
 +    REGISTER_FILTER(SHOWWAVESPIC,   showwavespic,   avf);
 +    REGISTER_FILTER(SPECTRUMSYNTH,  spectrumsynth,  vaf);
 +
 +    /* multimedia sources */
 +    REGISTER_FILTER(AMOVIE,         amovie,         avsrc);
 +    REGISTER_FILTER(MOVIE,          movie,          avsrc);
 +
      /* those filters are part of public or internal API => registered
       * unconditionally */
      REGISTER_FILTER_UNCONDITIONAL(asrc_abuffer);
      REGISTER_FILTER_UNCONDITIONAL(vsink_buffer);
      REGISTER_FILTER_UNCONDITIONAL(af_afifo);
      REGISTER_FILTER_UNCONDITIONAL(vf_fifo);
 +    ff_opencl_register_filter_kernel_code_all();
 +}
 +
 +void avfilter_register_all(void)
 +{
 +    AVOnce control = AV_ONCE_INIT;
 +
 +    ff_thread_once(&control, register_all);
  }
diff --combined libavfilter/version.h
@@@ -1,20 -1,20 +1,20 @@@
  /*
   * Version macros.
   *
 - * This file is part of Libav.
 + * This file is part of FFmpeg.
   *
 - * Libav is free software; you can redistribute it and/or
 + * FFmpeg is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 2.1 of the License, or (at your option) any later version.
   *
 - * Libav is distributed in the hope that it will be useful,
 + * FFmpeg is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   *
   * You should have received a copy of the GNU Lesser General Public
 - * License along with Libav; if not, write to the Free Software
 + * License along with FFmpeg; if not, write to the Free Software
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
@@@ -29,9 -29,9 +29,9 @@@
  
  #include "libavutil/version.h"
  
 -#define LIBAVFILTER_VERSION_MAJOR  6
 -#define LIBAVFILTER_VERSION_MINOR  8
 -#define LIBAVFILTER_VERSION_MICRO  0
 +#define LIBAVFILTER_VERSION_MAJOR   6
- #define LIBAVFILTER_VERSION_MINOR  78
- #define LIBAVFILTER_VERSION_MICRO 101
++#define LIBAVFILTER_VERSION_MINOR  79
++#define LIBAVFILTER_VERSION_MICRO 100
  
  #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
                                                 LIBAVFILTER_VERSION_MINOR, \
@@@ -52,9 -52,6 +52,9 @@@
  #ifndef FF_API_OLD_FILTER_OPTS
  #define FF_API_OLD_FILTER_OPTS              (LIBAVFILTER_VERSION_MAJOR < 7)
  #endif
 +#ifndef FF_API_OLD_FILTER_OPTS_ERROR
 +#define FF_API_OLD_FILTER_OPTS_ERROR        (LIBAVFILTER_VERSION_MAJOR < 7)
 +#endif
  #ifndef FF_API_AVFILTER_OPEN
  #define FF_API_AVFILTER_OPEN                (LIBAVFILTER_VERSION_MAJOR < 7)
  #endif
@@@ -67,8 -64,5 +67,8 @@@
  #ifndef FF_API_NOCONST_GET_NAME
  #define FF_API_NOCONST_GET_NAME             (LIBAVFILTER_VERSION_MAJOR < 7)
  #endif
 +#ifndef FF_API_LAVR_OPTS
 +#define FF_API_LAVR_OPTS                    (LIBAVFILTER_VERSION_MAJOR < 7)
 +#endif
  
  #endif /* AVFILTER_VERSION_H */
diff --combined libavfilter/vf_hwmap.c
index 0000000,11595bd..654477c
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,335 +1,334 @@@
 - * This file is part of Libav.
+ /*
 - * Libav is free software; you can redistribute it and/or
++ * This file is part of FFmpeg.
+  *
 - * Libav is distributed in the hope that it will be useful,
++ * FFmpeg is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+  * License as published by the Free Software Foundation; either
+  * version 2.1 of the License, or (at your option) any later version.
+  *
 - * License along with Libav; if not, write to the Free Software
++ * FFmpeg is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
 -    ff_formats_ref(ff_all_formats(AVMEDIA_TYPE_VIDEO),
 -                   &avctx->inputs[0]->out_formats);
 -    ff_formats_ref(ff_all_formats(AVMEDIA_TYPE_VIDEO),
 -                   &avctx->outputs[0]->in_formats);
++ * License along with FFmpeg; if not, write to the Free Software
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ #include "libavutil/buffer.h"
+ #include "libavutil/hwcontext.h"
+ #include "libavutil/log.h"
+ #include "libavutil/opt.h"
+ #include "libavutil/pixdesc.h"
+ #include "avfilter.h"
+ #include "formats.h"
+ #include "internal.h"
+ #include "video.h"
+ typedef struct HWMapContext {
+     const AVClass *class;
+     AVBufferRef   *hwdevice_ref;
+     AVBufferRef   *hwframes_ref;
+     int            mode;
+     int            map_backwards;
+ } HWMapContext;
+ static int hwmap_query_formats(AVFilterContext *avctx)
+ {
 -#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM)
++    int ret;
++
++    if ((ret = ff_formats_ref(ff_all_formats(AVMEDIA_TYPE_VIDEO),
++                              &avctx->inputs[0]->out_formats)) < 0 ||
++        (ret = ff_formats_ref(ff_all_formats(AVMEDIA_TYPE_VIDEO),
++                              &avctx->outputs[0]->in_formats)) < 0)
++        return ret;
++
+     return 0;
+ }
+ static int hwmap_config_output(AVFilterLink *outlink)
+ {
+     AVFilterContext *avctx = outlink->src;
+     HWMapContext      *ctx = avctx->priv;
+     AVFilterLink   *inlink = avctx->inputs[0];
+     AVHWFramesContext *hwfc;
+     const AVPixFmtDescriptor *desc;
+     int err;
+     av_log(avctx, AV_LOG_DEBUG, "Configure hwmap %s -> %s.\n",
+            av_get_pix_fmt_name(inlink->format),
+            av_get_pix_fmt_name(outlink->format));
+     if (inlink->hw_frames_ctx) {
+         hwfc = (AVHWFramesContext*)inlink->hw_frames_ctx->data;
+         desc = av_pix_fmt_desc_get(outlink->format);
+         if (!desc)
+             return AVERROR(EINVAL);
+         if (inlink->format == hwfc->format &&
+             (desc->flags & AV_PIX_FMT_FLAG_HWACCEL)) {
+             // Map between two hardware formats (including the case of
+             // undoing an existing mapping).
+             ctx->hwdevice_ref = av_buffer_ref(avctx->hw_device_ctx);
+             if (!ctx->hwdevice_ref) {
+                 err = AVERROR(ENOMEM);
+                 goto fail;
+             }
+             err = av_hwframe_ctx_create_derived(&ctx->hwframes_ref,
+                                                 outlink->format,
+                                                 ctx->hwdevice_ref,
+                                                 inlink->hw_frames_ctx, 0);
+             if (err < 0)
+                 goto fail;
+         } else if ((outlink->format == hwfc->format &&
+                     inlink->format  == hwfc->sw_format) ||
+                    inlink->format == hwfc->format) {
+             // Map from a hardware format to a software format, or
+             // undo an existing such mapping.
+             ctx->hwdevice_ref = NULL;
+             ctx->hwframes_ref = av_buffer_ref(inlink->hw_frames_ctx);
+             if (!ctx->hwframes_ref) {
+                 err = AVERROR(ENOMEM);
+                 goto fail;
+             }
+         } else {
+             // Non-matching formats - not supported.
+             av_log(avctx, AV_LOG_ERROR, "Unsupported formats for "
+                    "hwmap: from %s (%s) to %s.\n",
+                    av_get_pix_fmt_name(inlink->format),
+                    av_get_pix_fmt_name(hwfc->format),
+                    av_get_pix_fmt_name(outlink->format));
+             err = AVERROR(EINVAL);
+             goto fail;
+         }
+     } else if (avctx->hw_device_ctx) {
+         // Map from a software format to a hardware format.  This
+         // creates a new hwframe context like hwupload, but then
+         // returns frames mapped from that to the previous link in
+         // order to fill them without an additional copy.
+         ctx->map_backwards = 1;
+         ctx->hwdevice_ref = av_buffer_ref(avctx->hw_device_ctx);
+         if (!ctx->hwdevice_ref) {
+             err = AVERROR(ENOMEM);
+             goto fail;
+         }
+         ctx->hwframes_ref = av_hwframe_ctx_alloc(ctx->hwdevice_ref);
+         if (!ctx->hwframes_ref) {
+             err = AVERROR(ENOMEM);
+             goto fail;
+         }
+         hwfc = (AVHWFramesContext*)ctx->hwframes_ref->data;
+         hwfc->format    = outlink->format;
+         hwfc->sw_format = inlink->format;
+         hwfc->width     = inlink->w;
+         hwfc->height    = inlink->h;
+         err = av_hwframe_ctx_init(ctx->hwframes_ref);
+         if (err < 0) {
+             av_log(avctx, AV_LOG_ERROR, "Failed to create frame "
+                    "context for backward mapping: %d.\n", err);
+             goto fail;
+         }
+     } else {
+         av_log(avctx, AV_LOG_ERROR, "Mapping requires a hardware "
+                "context (a device, or frames on input).\n");
+         return AVERROR(EINVAL);
+     }
+     outlink->hw_frames_ctx = av_buffer_ref(ctx->hwframes_ref);
+     if (!outlink->hw_frames_ctx) {
+         err = AVERROR(ENOMEM);
+         goto fail;
+     }
+     outlink->w = inlink->w;
+     outlink->h = inlink->h;
+     return 0;
+ fail:
+     av_buffer_unref(&ctx->hwframes_ref);
+     av_buffer_unref(&ctx->hwdevice_ref);
+     return err;
+ }
+ static AVFrame *hwmap_get_buffer(AVFilterLink *inlink, int w, int h)
+ {
+     AVFilterContext *avctx = inlink->dst;
+     AVFilterLink  *outlink = avctx->outputs[0];
+     HWMapContext      *ctx = avctx->priv;
+     if (ctx->map_backwards) {
+         AVFrame *src, *dst;
+         int err;
+         src = ff_get_video_buffer(outlink, w, h);
+         if (!src) {
+             av_log(avctx, AV_LOG_ERROR, "Failed to allocate source "
+                    "frame for software mapping.\n");
+             return NULL;
+         }
+         dst = av_frame_alloc();
+         if (!dst) {
+             av_frame_free(&src);
+             return NULL;
+         }
+         err = av_hwframe_map(dst, src, ctx->mode);
+         if (err) {
+             av_log(avctx, AV_LOG_ERROR, "Failed to map frame to "
+                    "software: %d.\n", err);
+             av_frame_free(&src);
+             av_frame_free(&dst);
+             return NULL;
+         }
+         av_frame_free(&src);
+         return dst;
+     } else {
+         return ff_default_get_video_buffer(inlink, w, h);
+     }
+ }
+ static int hwmap_filter_frame(AVFilterLink *link, AVFrame *input)
+ {
+     AVFilterContext *avctx = link->dst;
+     AVFilterLink  *outlink = avctx->outputs[0];
+     HWMapContext      *ctx = avctx->priv;
+     AVFrame *map = NULL;
+     int err;
+     av_log(ctx, AV_LOG_DEBUG, "Filter input: %s, %ux%u (%"PRId64").\n",
+            av_get_pix_fmt_name(input->format),
+            input->width, input->height, input->pts);
+     map = av_frame_alloc();
+     if (!map) {
+         err = AVERROR(ENOMEM);
+         goto fail;
+     }
+     map->format = outlink->format;
+     map->hw_frames_ctx = av_buffer_ref(ctx->hwframes_ref);
+     if (!map->hw_frames_ctx) {
+         err = AVERROR(ENOMEM);
+         goto fail;
+     }
+     if (ctx->map_backwards && !input->hw_frames_ctx) {
+         // If we mapped backwards from hardware to software, we need
+         // to attach the hardware frame context to the input frame to
+         // make the mapping visible to av_hwframe_map().
+         input->hw_frames_ctx = av_buffer_ref(ctx->hwframes_ref);
+         if (!input->hw_frames_ctx) {
+             err = AVERROR(ENOMEM);
+             goto fail;
+         }
+     }
+     err = av_hwframe_map(map, input, ctx->mode);
+     if (err < 0) {
+         av_log(avctx, AV_LOG_ERROR, "Failed to map frame: %d.\n", err);
+         goto fail;
+     }
+     err = av_frame_copy_props(map, input);
+     if (err < 0)
+         goto fail;
+     av_frame_free(&input);
+     av_log(ctx, AV_LOG_DEBUG, "Filter output: %s, %ux%u (%"PRId64").\n",
+            av_get_pix_fmt_name(map->format),
+            map->width, map->height, map->pts);
+     return ff_filter_frame(outlink, map);
+ fail:
+     av_frame_free(&input);
+     av_frame_free(&map);
+     return err;
+ }
+ static av_cold void hwmap_uninit(AVFilterContext *avctx)
+ {
+     HWMapContext *ctx = avctx->priv;
+     av_buffer_unref(&ctx->hwframes_ref);
+     av_buffer_unref(&ctx->hwdevice_ref);
+ }
+ #define OFFSET(x) offsetof(HWMapContext, x)
 -    { NULL },
++#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM)
+ static const AVOption hwmap_options[] = {
+     { "mode", "Frame mapping mode",
+       OFFSET(mode), AV_OPT_TYPE_FLAGS,
+       { .i64 = AV_HWFRAME_MAP_READ | AV_HWFRAME_MAP_WRITE },
+       0, INT_MAX, FLAGS, "mode" },
+     { "read", "Mapping should be readable",
+       0, AV_OPT_TYPE_CONST, { .i64 = AV_HWFRAME_MAP_READ },
+       INT_MIN, INT_MAX, FLAGS, "mode" },
+     { "write", "Mapping should be writeable",
+       0, AV_OPT_TYPE_CONST, { .i64 = AV_HWFRAME_MAP_WRITE },
+       INT_MIN, INT_MAX, FLAGS, "mode" },
+     { "overwrite", "Mapping will always overwrite the entire frame",
+       0, AV_OPT_TYPE_CONST, { .i64 = AV_HWFRAME_MAP_OVERWRITE },
+       INT_MIN, INT_MAX, FLAGS, "mode" },
+     { "direct", "Mapping should not involve any copying",
+       0, AV_OPT_TYPE_CONST, { .i64 = AV_HWFRAME_MAP_DIRECT },
+       INT_MIN, INT_MAX, FLAGS, "mode" },
 -static const AVClass hwmap_class = {
 -    .class_name = "hwmap",
 -    .item_name  = av_default_item_name,
 -    .option     = hwmap_options,
 -    .version    = LIBAVUTIL_VERSION_INT,
 -};
++    { NULL }
+ };
 -        .get_video_buffer = &hwmap_get_buffer,
 -        .filter_frame     = &hwmap_filter_frame,
++AVFILTER_DEFINE_CLASS(hwmap);
+ static const AVFilterPad hwmap_inputs[] = {
+     {
+         .name             = "default",
+         .type             = AVMEDIA_TYPE_VIDEO,
 -        .config_props = &hwmap_config_output,
++        .get_video_buffer = hwmap_get_buffer,
++        .filter_frame     = hwmap_filter_frame,
+     },
+     { NULL }
+ };
+ static const AVFilterPad hwmap_outputs[] = {
+     {
+         .name         = "default",
+         .type         = AVMEDIA_TYPE_VIDEO,
 -    .uninit         = &hwmap_uninit,
++        .config_props = hwmap_config_output,
+     },
+     { NULL }
+ };
+ AVFilter ff_vf_hwmap = {
+     .name           = "hwmap",
+     .description    = NULL_IF_CONFIG_SMALL("Map hardware frames"),
 -    .query_formats  = &hwmap_query_formats,
++    .uninit         = hwmap_uninit,
+     .priv_size      = sizeof(HWMapContext),
+     .priv_class     = &hwmap_class,
++    .query_formats  = hwmap_query_formats,
+     .inputs         = hwmap_inputs,
+     .outputs        = hwmap_outputs,
+     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+ };