ffmpeg/libavfilter
Lars Kiesow 74d4bc0fa0 libavfilter/vf_scale: Ensure scaled video is divisible by n
This patch adds a new option to the scale filter which ensures that the
output resolution is divisible by the given integer when used together
with `force_original_aspect_ratio`. This works similar to using `-n` in
the `w` and `h` options.

This option respects the value set for `force_original_aspect_ratio`,
increasing or decreasing the resolution accordingly.

The use case for this is to set a fixed target resolution using `w` and
`h`, to use the `force_original_aspect_ratio` option to make sure that
the video always fits in the defined bounding box regardless of aspect
ratio, but to also make sure that the calculated output resolution is
divisible by n so in can be encoded with certain encoders/options if
that is required.

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-13 16:48:38 +02:00
..
aarch64
dnn dnn: convert tf.pad to native model in python script, and load/execute it in the c code. 2019-07-29 12:34:19 -03:00
opencl lavfi/opencl: add nlmeans_opencl filter 2019-05-24 15:09:22 +08:00
tests avfilter/tests/integral: Correct the comment 2019-02-13 19:59:39 +08:00
x86 avfilter/vf_convolution: add x86 SIMD for filter_3x3() 2019-08-07 14:31:28 +08:00
.gitignore
Makefile lavfi: addroi filter 2019-07-28 22:34:33 +01:00
aeval.c
af_acontrast.c
af_acopy.c
af_acrossover.c
af_acrusher.c
af_adeclick.c avfilter/af_adeclick: switch to activate 2019-04-29 22:19:15 +02:00
af_adelay.c avfilter/af_adelay: allow setting delays in seconds 2019-01-01 13:33:16 +01:00
af_aderivative.c
af_aecho.c
af_aemphasis.c
af_afade.c avfilter/afade+acrossfade: allow skipping fade on inputs 2019-01-24 22:08:34 +05:30
af_afftdn.c
af_afftfilt.c avfilter/af_afftfilt: make selecting window size simpler 2019-07-10 15:57:38 +02:00
af_afir.c avfilter/af_afir: adjust min partition size 2019-01-05 09:40:41 +01:00
af_afir.h avfilter/af_afir: split off fcmul_add into a DSP context 2019-01-03 10:12:18 -03:00
af_aformat.c
af_agate.c avfilter/af_agate: implement mode option 2019-04-17 23:36:39 +02:00
af_aiir.c avfilter/af_aiir: calculate group delay too 2019-07-13 15:45:06 +02:00
af_alimiter.c
af_amerge.c
af_amix.c
af_amultiply.c avfilter/af_amultiply: use pts from frame from first input 2019-05-04 11:28:14 +02:00
af_anequalizer.c
af_anlmdn.c avfilter/af_anlmdn: add support for commands 2019-06-03 14:20:19 +02:00
af_anlmdndsp.h avfilter: add anlmdn filter x86 SIMD optimizations 2019-01-10 21:49:47 +01:00
af_anull.c
af_apad.c
af_aphaser.c
af_apulsator.c
af_aresample.c
af_asetnsamples.c lavfi/af_asetnsamples: Remove the redundant condition check 2019-06-18 23:27:07 +08:00
af_asetrate.c
af_ashowinfo.c
af_asoftclip.c avfilter/af_asoftclip: add timeline support 2019-04-30 11:02:36 +02:00
af_asr.c avfilter: add asr filter 2019-05-14 15:17:14 +02:00
af_astats.c avfilter/af_astats: fix calculations involving last sample 2019-05-12 17:12:06 +02:00
af_atempo.c avfilter/af_atempo: Make ffplay display correct timestamps when seeking 2019-05-08 23:38:10 -06:00
af_biquads.c avfilter/af_biquads: clip gain picked from command to sane values 2019-07-08 16:29:15 +02:00
af_bs2b.c
af_channelmap.c
af_channelsplit.c
af_chorus.c
af_compand.c
af_compensationdelay.c
af_crossfeed.c avfilter/af_crossfeed: add timeline support 2019-05-01 12:31:52 +02:00
af_crystalizer.c
af_dcshift.c
af_deesser.c avfilter/af_deesser: remove extra ; 2019-07-03 08:53:35 +02:00
af_drmeter.c
af_dynaudnorm.c avfilter/af_dynaudnorm: add more descriptive aliases for options 2019-07-24 15:20:47 +01:00
af_earwax.c
af_extrastereo.c avfilter/af_extrastereo: add timeline support 2019-05-01 12:33:56 +02:00
af_firequalizer.c
af_flanger.c
af_haas.c
af_hdcd.c
af_headphone.c avfilter/af_headphone: use av_log2() 2018-12-27 12:30:04 +01:00
af_join.c
af_ladspa.c
af_loudnorm.c
af_lv2.c
af_mcompand.c
af_pan.c
af_replaygain.c
af_resample.c
af_rubberband.c avfilter/af_rubberband: also do not ignore failures 2019-05-06 21:09:43 +02:00
af_sidechaincompress.c avfilter/af_sidechaincompress: implement mode option 2019-04-17 16:34:17 +02:00
af_silencedetect.c
af_silenceremove.c avfilter/af_silenceremove: use input timestamp for timestamp recalculation 2019-07-02 19:01:42 +02:00
af_sofalizer.c avfilter/af_sofalizer: switch to activate 2019-04-29 13:35:04 +02:00
af_stereotools.c
af_stereowiden.c avfilter/af_stereowiden: add timeline support 2019-05-01 12:40:25 +02:00
af_superequalizer.c avfilter/af_superequalizer: switch to activate 2019-05-27 17:36:30 +02:00
af_surround.c avfilter/af_surround: improve rear channels separation 2019-04-24 22:31:02 +02:00
af_tremolo.c
af_vibrato.c
af_volume.c
af_volume.h
af_volumedetect.c
all_channel_layouts.inc
allfilters.c lavfi: addroi filter 2019-07-28 22:34:33 +01:00
asink_anullsink.c
asrc_anoisesrc.c
asrc_anullsrc.c
asrc_flite.c
asrc_hilbert.c
asrc_sinc.c
asrc_sine.c
audio.c
audio.h
avf_abitscope.c avfilter/avf_abitscope: make use of av_rescale 2019-05-28 10:46:38 +02:00
avf_ahistogram.c avfilter/avf_ahistogram: make use of av_rescale 2019-05-28 10:51:57 +02:00
avf_aphasemeter.c avfilter/avf_aphasemeter: make use of av_rescale 2019-05-28 11:10:51 +02:00
avf_avectorscope.c avfilter/avf_avectorscope: make use of av_rescale 2019-05-28 10:43:25 +02:00
avf_concat.c
avf_showcqt.c
avf_showcqt.h
avf_showfreqs.c avfilter/avf_showfreqs: make selecting window size simpler 2019-07-10 16:03:34 +02:00
avf_showspatial.c lavfi/showspatial: Remove two write-only variables. 2019-05-31 22:30:46 +02:00
avf_showspectrum.c avfilter/avf_showspectrum: convert some doubles to floats 2019-04-30 20:36:33 +02:00
avf_showvolume.c avfilter/avf_showvolume: make use of av_rescale 2019-05-28 10:49:09 +02:00
avf_showwaves.c avilter/avf_showwaves: switch to activate in showwaves filter 2019-06-04 09:28:07 +02:00
avfilter.c
avfilter.h
avfiltergraph.c
avfilterres.rc
bbox.c
bbox.h
blend.h
boxblur.c
boxblur.h
bufferqueue.h
buffersink.c
buffersink.h
buffersrc.c avfilter/buffersrc: print relevant info when skipping filter reinit 2019-01-27 18:48:36 +05:30
buffersrc.h
bwdif.h
colorspace.c lavfi/colorspace: move some functions to common file 2019-03-22 09:33:28 +08:00
colorspace.h lavfi/colorspace: move some functions to common file 2019-03-22 09:33:28 +08:00
colorspacedsp.c
colorspacedsp.h
colorspacedsp_template.c
colorspacedsp_yuv2yuv_template.c
convolution.h avfilter/vf_convolution: add x86 SIMD for filter_3x3() 2019-08-07 14:31:28 +08:00
deshake.h
dnn_interface.h libavfilter/dnn: add more data type support for dnn model input 2019-05-08 12:33:00 -03:00
drawutils.c
drawutils.h
ebur128.c avfilter/ebur128: Simplify by using log10() 2019-01-01 21:11:47 +01:00
ebur128.h
f_bench.c
f_cue.c
f_drawgraph.c
f_ebur128.c avfilter/f_ebur128: use correct type for chl 2019-04-29 16:46:42 +02:00
f_graphmonitor.c
f_interleave.c avfilter/f_interleave: switch to activate 2019-05-05 19:51:44 +02:00
f_loop.c avfilter/f_loop: warn about unset loop sizes 2019-05-24 21:39:07 +02:00
f_metadata.c
f_perms.c
f_realtime.c avfilter/f_realtime: add option to scale speed 2019-05-04 19:39:38 +02:00
f_reverse.c
f_select.c avformat/f_select: add support for more pixel formats for scene change score calculations 2019-07-22 22:54:51 +02:00
f_sendcmd.c
f_sidedata.c lavfi/sidedata: add missed frame side data type 2019-03-23 11:25:06 +08:00
f_streamselect.c
f_zmq.c lavfi/zmq: Avoid mem copy past the end of input buffer 2019-08-01 19:10:05 +02:00
fifo.c
filters.h
formats.c
formats.h
framepool.c
framepool.h
framequeue.c
framequeue.h
framerate.h
framesync.c avfilter/framesync: fix shortest with eof_action=pass 2019-06-06 10:19:14 +05:30
framesync.h
gblur.h avfilter/vf_gblur: add x86 SIMD optimizations 2019-06-12 08:53:11 +08:00
generate_wave_table.c
generate_wave_table.h
gradfun.h
graphdump.c
graphparser.c
hermite.h
hflip.h
internal.h
lavfutils.c
lavfutils.h
libavfilter.v
limiter.h
log2_tab.c
lswsutils.c
lswsutils.h
maskedmerge.h
motion_estimation.c
motion_estimation.h
opencl.c lavfi/opencl: add ff_opencl_print_const_matrix_3x3() 2019-03-22 09:33:28 +08:00
opencl.h lavfi/opencl: add more opencl helper macro 2019-04-26 10:08:05 +08:00
opencl_source.h lavfi/opencl: add nlmeans_opencl filter 2019-05-24 15:09:22 +08:00
psnr.h
pthread.c
qsvvpp.c lavf/qsvvpp: add P010 output format support 2019-06-10 13:48:41 +08:00
qsvvpp.h qsv: fix the dangerous macro definitions 2019-03-28 21:49:04 +08:00
removegrain.h
scale.c
scale.h
scene_sad.c
scene_sad.h
setpts.c
settb.c
signature.h
signature_lookup.c
split.c
src_movie.c
ssim.h
stereo3d.h
thread.h
threshold.h
tinterlace.h
transform.c
transform.h
transpose.h libavfilter: add transpose_vaapi filter 2019-01-23 23:29:40 +00:00
trim.c
unsharp.h avfilter/vf_unsharp: enable slice threading 2019-06-03 10:49:57 +08:00
vaapi_vpp.c lavfi/vaapi: Fix build with libva 2.1 and 2.2 2019-06-07 21:15:29 +01:00
vaapi_vpp.h lavfi/vaapi: Improve support for colour properties 2019-06-02 17:30:41 +01:00
vaf_spectrumsynth.c
version.h Bump minor versions again on master to keep 4.2 versions separate from master 2019-07-21 18:36:31 +02:00
vf_addroi.c lavfi: addroi filter 2019-07-28 22:34:33 +01:00
vf_alphamerge.c
vf_amplify.c avfilter/vf_amplify: add tolerance option 2019-02-22 23:32:27 +01:00
vf_aspect.c
vf_atadenoise.c
vf_avgblur.c
vf_avgblur_opencl.c
vf_bbox.c
vf_bitplanenoise.c
vf_blackdetect.c
vf_blackframe.c
vf_blend.c avfilter/vf_blend: add 9bit support 2019-07-14 17:00:58 +02:00
vf_bm3d.c
vf_boxblur.c
vf_bwdif.c
vf_chromakey.c avfilter/vf_chromahold: implement blend option 2019-05-13 12:15:32 +02:00
vf_chromashift.c avfilter/vf_chromashift: remove invalid offset 2018-12-30 22:31:52 +01:00
vf_ciescope.c avfilter/vf_ciescope: add DCI-P3 2019-07-22 22:56:21 +01:00
vf_codecview.c
vf_colorbalance.c
vf_colorchannelmixer.c
vf_colorconstancy.c
vf_colorkey.c avfilter: add colorhold filter 2019-05-11 20:16:45 +02:00
vf_colorkey_opencl.c lavfi: add colorkey_opencl filter 2019-04-20 16:32:34 +01:00
vf_colorlevels.c lavfi/colorlevels: Add slice threading support 2019-06-03 09:36:14 +08:00
vf_colormatrix.c
vf_colorspace.c libavfilter/vf_colorspace.c: fix demarcation point of gamma linearize function 2019-07-03 13:57:11 -04:00
vf_convolution.c avfilter/vf_convolution: add x86 SIMD for filter_3x3() 2019-08-07 14:31:28 +08:00
vf_convolution_opencl.c
vf_convolve.c
vf_copy.c
vf_coreimage.m
vf_cover_rect.c libavfilter/vf_cover_rect.c: free the allocated frame 2019-06-11 23:53:26 +02:00
vf_crop.c vf_crop: Add support for cropping hardware frames 2019-06-02 17:30:41 +01:00
vf_cropdetect.c
vf_curves.c
vf_datascope.c
vf_dctdnoiz.c
vf_deband.c
vf_deblock.c
vf_decimate.c
vf_dedot.c
vf_deflicker.c
vf_deinterlace_qsv.c lavf/qsv: use av_cold for init/uninit 2019-06-03 05:39:06 +08:00
vf_deinterlace_vaapi.c lavfi/vaapi: Improve support for colour properties 2019-06-02 17:30:41 +01:00
vf_dejudder.c
vf_delogo.c
vf_derain.c libavfilter: Add derain filter 2019-06-06 13:59:43 +08:00
vf_deshake.c
vf_despill.c
vf_detelecine.c avfilter/vf_detelecine: fix obvious frame memory leaks 2019-01-02 15:34:41 +01:00
vf_displace.c avfilter/vf_displace: use time_base from framesync 2019-07-14 18:20:18 +02:00
vf_drawbox.c
vf_drawtext.c vf_drawtext: Add pkt_pos, pkt_duration, pkt_size as variables 2019-07-07 11:12:07 +05:30
vf_edgedetect.c
vf_elbg.c
vf_entropy.c
vf_eq.c
vf_eq.h
vf_extractplanes.c avfilter/extractplanes: add support for 12-bit YUVA formats 2019-01-17 11:41:18 +01:00
vf_fade.c avfilter/fade: don't allow nb_frames == 0 2019-07-29 12:46:59 +05:30
vf_fftdnoiz.c
vf_fftfilt.c
vf_field.c
vf_fieldhint.c
vf_fieldmatch.c
vf_fieldorder.c
vf_fillborders.c
vf_find_rect.c
vf_floodfill.c
vf_format.c
vf_fps.c
vf_framepack.c
vf_framerate.c
vf_framestep.c
vf_freezedetect.c avfilter/vf_freezedetect: fix missing freeze_start when the freeze length is around the detection duration 2019-05-05 20:07:35 +02:00
vf_frei0r.c lavfi/frei0r: Fix a union member type and remove an unneeded cast. 2019-04-25 00:29:09 +02:00
vf_fspp.c
vf_fspp.h lavfi/fspp: Simplify a macro. 2019-04-20 00:20:07 +02:00
vf_gblur.c avfilter/vf_gblur: add x86 SIMD optimizations 2019-06-12 08:53:11 +08:00
vf_geq.c
vf_gradfun.c
vf_hflip.c
vf_histeq.c
vf_histogram.c
vf_hqdn3d.c
vf_hqdn3d.h
vf_hqx.c
vf_hue.c
vf_hwdownload.c
vf_hwmap.c
vf_hwupload.c
vf_hwupload_cuda.c
vf_hysteresis.c avfilter/vf_hysteresis: use time_base from framesync 2019-07-14 19:14:10 +02:00
vf_idet.c
vf_idet.h
vf_il.c
vf_kerndeint.c
vf_lagfun.c avfilter: add lagfun filter 2019-04-20 14:20:07 +02:00
vf_lenscorrection.c
vf_lensfun.c lavfi/lensfun: Use ff_filter_get_nb_threads() get number of threads 2019-05-22 17:34:18 +08:00
vf_libopencv.c
vf_libvmaf.c
vf_limiter.c
vf_lumakey.c
vf_lut.c avfilter/vf_lut: fix regression with >8bit planar filtering 2019-07-05 12:55:02 +02:00
vf_lut2.c avfilter/vf_lut2: use time_base from framesync 2019-07-03 14:54:05 +02:00
vf_lut3d.c avfilter/vf_lut3d: increase MAX_LEVEL 2019-04-28 10:52:21 +02:00
vf_maskedclamp.c avfilter/vf_maskedclamp: use time_base from framesync 2019-07-03 14:54:05 +02:00
vf_maskedmerge.c avfilter/vf_maskedmerge: always use framesync timestamps 2019-07-14 17:38:26 +02:00
vf_maskfun.c avfilter: add maskfun filter 2019-01-12 19:49:15 +01:00
vf_mcdeint.c
vf_mergeplanes.c
vf_mestimate.c
vf_midequalizer.c avfilter/vf_midequalizer: always use framesync timestamps 2019-07-14 17:45:42 +02:00
vf_minterpolate.c
vf_misc_vaapi.c lavfi/vaapi: Improve support for colour properties 2019-06-02 17:30:41 +01:00
vf_mix.c avfilter/vf_mix: set sar to outlink 2019-05-24 18:37:41 +02:00
vf_mpdecimate.c
vf_neighbor.c
vf_neighbor_opencl.c
vf_nlmeans.c lavfi/nlmeans: use a dynamic size for the weight LUT 2019-02-01 20:58:47 +01:00
vf_nlmeans.h
vf_nlmeans_opencl.c lavfi/opencl: add nlmeans_opencl filter 2019-05-24 15:09:22 +08:00
vf_nnedi.c
vf_noise.c
vf_noise.h
vf_normalize.c avfilter/vf_normalize: fix filtering of RGB0 formats 2019-06-10 23:11:57 +02:00
vf_null.c
vf_ocr.c avfilter/vf_ocr: also export confidence of result 2019-05-17 19:10:12 +02:00
vf_overlay.c
vf_overlay.h
vf_overlay_opencl.c
vf_overlay_qsv.c lavf/qsv: use av_cold for init/uninit 2019-06-03 05:39:06 +08:00
vf_owdenoise.c
vf_pad.c
vf_palettegen.c palettegen: Fill with last color, not black 2019-02-19 21:29:03 +01:00
vf_paletteuse.c avfilter/vf_paletteuse: don't constantly free and realloc internal frames 2019-01-17 13:24:14 -03:00
vf_perspective.c
vf_phase.c
vf_pixdesctest.c
vf_pp.c
vf_pp7.c
vf_pp7.h
vf_premultiply.c
vf_procamp_vaapi.c lavfi/vaapi: Improve support for colour properties 2019-06-02 17:30:41 +01:00
vf_program_opencl.c
vf_pseudocolor.c
vf_psnr.c
vf_pullup.c
vf_pullup.h
vf_qp.c
vf_random.c
vf_readeia608.c avfilter/vf_readeia608: implement lowpass operation prior to processing lines 2019-07-08 19:21:59 +02:00
vf_readvitc.c
vf_remap.c avfilter/vf_remap: add option to control output format 2019-07-14 18:20:18 +02:00
vf_removegrain.c
vf_removelogo.c
vf_repeatfields.c
vf_rotate.c
vf_sab.c
vf_scale.c libavfilter/vf_scale: Ensure scaled video is divisible by n 2019-08-13 16:48:38 +02:00
vf_scale_cuda.c avfilter/vf_scale_cuda: reset frame size after acquiring from hwframe 2019-05-24 19:03:34 +02:00
vf_scale_cuda.cu avfilter/vf_scale_cuda: Switch to using ffnvcodec 2019-02-27 18:03:17 +01:00
vf_scale_npp.c
vf_scale_qsv.c lavf/qsv_scale: add scaling modes support 2019-06-25 11:33:12 +08:00
vf_scale_vaapi.c vf_scale_vaapi: Add options to configure output colour properties 2019-06-02 17:30:41 +01:00
vf_selectivecolor.c
vf_separatefields.c avfilter/vf_separatefields: switch to activate 2019-05-16 12:31:57 +02:00
vf_setparams.c
vf_showinfo.c lavf/showinfo: use error level when get invalid sidedata 2019-08-08 17:57:25 +08:00
vf_showpalette.c
vf_shuffleframes.c
vf_shuffleplanes.c
vf_signalstats.c
vf_signature.c
vf_smartblur.c
vf_spp.c
vf_spp.h
vf_sr.c lavf/sr: Refine the coding style for init 2019-06-03 13:04:23 +08:00
vf_ssim.c
vf_stack.c avfilter/vf_stack: Don't modify const strings 2019-05-14 14:47:51 +02:00
vf_stereo3d.c
vf_subtitles.c
vf_super2xsai.c
vf_swaprect.c
vf_swapuv.c
vf_telecine.c
vf_threshold.c avfilter/vf_threshold: use time_base from framesync 2019-07-14 17:28:04 +02:00
vf_thumbnail.c
vf_thumbnail_cuda.c avfilter/vf_thumbnail_cuda: Switch to using ffnvcodec 2019-02-27 18:03:17 +01:00
vf_thumbnail_cuda.cu lavfi/vf_thumbnail_cuda: fix operator precedence bug 2019-07-30 15:17:22 +02:00
vf_tile.c
vf_tinterlace.c avfilter/vf_tinterlace: re-enable lowpass option 2019-07-08 17:57:31 +02:00
vf_tonemap.c avfilter/vf_tonemap: add slice threading 2019-05-01 21:19:58 +02:00
vf_tonemap_opencl.c lavfi/tonemap_opencl: reuse color matrix calculation from colorspace.c 2019-03-22 09:33:28 +08:00
vf_tpad.c
vf_transpose.c
vf_transpose_npp.c
vf_transpose_opencl.c
vf_transpose_vaapi.c lavfi/vaapi: Improve support for colour properties 2019-06-02 17:30:41 +01:00
vf_unsharp.c avfilter/vf_unsharp: enable slice threading 2019-06-03 10:49:57 +08:00
vf_unsharp_opencl.c
vf_uspp.c
vf_vaguedenoiser.c
vf_vectorscope.c
vf_vflip.c
vf_vfrdet.c
vf_vibrance.c avfilter/vf_vibrance: add alternate option 2019-05-05 13:29:34 +02:00
vf_vidstabdetect.c
vf_vidstabtransform.c
vf_vignette.c
vf_vmafmotion.c avfilter/vf_vmafmotion: remove unused header 2019-05-04 11:09:47 +02:00
vf_vpp_qsv.c lavf/vf_vpp_qsv: add support for QSV transpose filter 2019-08-07 20:58:49 +08:00
vf_w3fdif.c
vf_waveform.c
vf_weave.c
vf_xbr.c
vf_xmedian.c avfilter/vf_xmedian: remove limitation of only odd number of inputs 2019-06-02 11:07:46 +02:00
vf_yadif.c
vf_yadif_cuda.c avfilter/vf_yadif_cuda: Remove unnecessary stream synchronisation 2019-03-30 08:55:15 -07:00
vf_yadif_cuda.cu
vf_zoompan.c
vf_zscale.c lavfi/zscale: make use of AVFILTER_DEFINE_CLASS 2019-03-08 09:38:09 +08:00
video.c
video.h
vidstabutils.c
vidstabutils.h
vmaf_motion.h
vsink_nullsink.c
vsrc_cellauto.c
vsrc_life.c
vsrc_mandelbrot.c
vsrc_mptestsrc.c
vsrc_testsrc.c
w3fdif.h
window_func.h
yadif.h
yadif_common.c