Commit Graph

8358 Commits

Author SHA1 Message Date
Marton Balint b4bcae4e0e Revert "avfilter/vf_framerate: if metadata lavfi.scd.mafd exists, we'll use it first"
This reverts commit 339593ca90.

Fixes null pointer dereference.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-05-15 18:35:51 +02:00
Marton Balint 7f3a946216 Revert "avfilter/vf_minterpolate: if metadata lavfi.scd.mafd exists, we'll use it first"
This reverts commit d88e1c9838.

Fixes null pointer dereference.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-05-15 18:35:51 +02:00
Limin Wang 815a3b393c avfilter/vf_minterpolate: change the default threshold to get better scene change detect result
./ffmpeg -loglevel debug -i ../fate-suite/svq3/Vertical400kbit.sorenson3.mov -vf
 minterpolate=fps=60:mi_mode=blend -an -f null -
 [Parsed_minterpolate_0 @ 0x7fe7f3e193c0] scene changed, input pts 1600
 [Parsed_minterpolate_0 @ 0x7fe7f3e193c0] scene changed, input pts 4120
 [Parsed_minterpolate_0 @ 0x7fe7f3e193c0] scene changed, input pts 5780
 [Parsed_minterpolate_0 @ 0x7fe7f3e193c0] scene changed, input pts 6700
 [Parsed_minterpolate_0 @ 0x7fe7f3e193c0] scene changed, input pts 8140
 [Parsed_minterpolate_0 @ 0x7fe7f3e193c0] scene changed, input pts 9740
 [Parsed_minterpolate_0 @ 0x7fe7f3e193c0] scene changed, input pts 14060
 [Parsed_minterpolate_0 @ 0x7fe7f3e193c0] scene changed, input pts 15680
 [Parsed_minterpolate_0 @ 0x7fe7f3e193c0] scene changed, input pts 18480
 [Parsed_minterpolate_0 @ 0x7fe7f3e193c0] scene changed, input pts 20020
 [Parsed_minterpolate_0 @ 0x7fe7f3e193c0] scene changed, input pts 21740

 The results are consistent with tests/ref/fate/filter-metadata-scenedetect

 For the master, it'll detect more than 20 scene change for the same source.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-14 23:03:07 +08:00
Limin Wang 61cc009d53 avfilter/vf_minterpolate: correct the mafd calculation
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-14 23:03:07 +08:00
Limin Wang d88e1c9838 avfilter/vf_minterpolate: if metadata lavfi.scd.mafd exists, we'll use it first
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-14 23:03:07 +08:00
Limin Wang 339593ca90 avfilter/vf_framerate: if metadata lavfi.scd.mafd exists, we'll use it first
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-14 23:03:06 +08:00
Limin Wang d62d4e05e8 avfilter/vf_scdet: add filter to detect scene change
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-14 23:03:06 +08:00
lance.lmwang@gmail.com 5ed20a74b7 avfilter/vf_colorbalance:: Fix for framecrc bitexact for 32bit and 64bit system
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-14 09:15:46 +08:00
Martin Storsjö 353aecbb28 pixblockdsp, avdct: Add get_pixels_unaligned
Use this in vf_spp.c, where the get_pixels operation is done on
unaligned source addresses.

Hook up the x86 (mmx and sse) versions of get_pixels to this
function pointer, as those implementations seem to support unaligned
use.

This fixes fate-filter-spp on armv7.

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-05-13 13:20:08 +03:00
Anton Khirnov b84a2b91fd vf_showinfo: support AV_FRAME_DATA_VIDEO_ENC_PARAMS 2020-05-12 09:37:47 +02:00
Michael Niedermayer 52cc86cae1 avfilter/vf_spp: Fix endian-dependance in add_block()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 01:00:28 +02:00
Michael Niedermayer dde86d0ddf avfilter/vf_spp: Remove unused AVCodecContext
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-05-12 01:00:28 +02:00
Lynne 70d396c8af Revert "hwcontext_vulkan: only use one semaphore per image"
This reverts commit 97b526c192.
It broke the API, and assumed no other APIs used multiple semaphores.
This also disallowed certain optimizations to happen.

Dealing with APIs that give or expect single semaphores is easier when
we use per-image semaphores.
2020-05-11 23:48:26 +01:00
Limin Wang a058d81570 avfilter/vf_signalstats: reindent after last commit
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-10 22:32:34 +08:00
Limin Wang 25bb72af62 avfilter/vf_signalstats: make the alloc array used for any bit depth
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-10 22:32:34 +08:00
Limin Wang 764efda192 avfilter/vf_signalstats: add SignalstatsContext.maxsize variable
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-10 22:32:34 +08:00
Limin Wang a8c762a17d avfilter/vf_signalstats: rename config_props -> config_output
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-10 22:32:34 +08:00
Guo, Yejun 71e28c5422 dnn/native: add native support for minimum
it can be tested with model file generated with below python script:
import tensorflow as tf
import numpy as np
import imageio

in_img = imageio.imread('input.jpg')
in_img = in_img.astype(np.float32)/255.0
in_data = in_img[np.newaxis, :]

x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')
x1 = tf.minimum(0.7, x)
x2 = tf.maximum(x1, 0.4)
y = tf.identity(x2, name='dnn_out')

sess=tf.Session()
sess.run(tf.global_variables_initializer())

graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out'])
tf.train.write_graph(graph_def, '.', 'image_process.pb', as_text=False)

print("image_process.pb generated, please use \
path_to_ffmpeg/tools/python/convert.py to generate image_process.model\n")

output = sess.run(y, feed_dict={x: in_data})
imageio.imsave("out.jpg", np.squeeze(output))

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2020-05-08 15:22:27 +08:00
Sebastian Dröge ed3da72583 s->target_i and global are in dB but s->target_tp and true_peak are
linear. Instead of mixing these in the calculations, convert the former
first to have all following calculations in the same unit.

Signed-off-by: Kyle Swanson <k@ylo.ph>
2020-05-01 21:36:07 -07:00
Limin Wang f441fadbcf avfilter/af_adelay: Check sscanf() return value
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-01 06:36:36 +08:00
Limin Wang ee5d6d2ef8 avfilter/vf_mix: Check sscanf() return value
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-05-01 06:36:36 +08:00
Paul B Mahol 0a181c2cb1 avfilter/af_crossfeed: make options runtime configurable 2020-04-30 12:18:36 +02:00
Paul B Mahol 35d6001815 avfilter/af_crossfeed: make slope configurable 2020-04-30 12:18:36 +02:00
Paul B Mahol 0ec61fcff7 avfilter/af_crossfeed: fix calculation of alpha parameter
Use A in calculation.
2020-04-30 12:18:36 +02:00
Paul B Mahol c7d8082357 avfilter: add asubboost filter 2020-04-30 12:18:36 +02:00
Paul B Mahol 2970846fc1 avfilter/vf_v360: make FOV adjusted for dual fisheye too
Remove any usage of padding for this format.
2020-04-29 19:18:25 +02:00
Paul B Mahol d8147c4e2d avfilter/af_amix: make weights option runtime configured 2020-04-29 19:18:25 +02:00
Steven Liu d813e43b3d avfilter/vf_v360: adjustment out_pad and in_pad maximum value to 1/10
Because not every user know about in_pad and out_pad reasonable value range
so maybe try to set 1.0, but setting 1.0 is so hugh to get an fatal error.

Suggested-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2020-04-29 13:48:02 +01:00
Paul B Mahol f53fc935b8 avfilter/vf_pixscope: also show standard deviation of zoomed area 2020-04-26 12:27:36 +02:00
Paul B Mahol 35bcbfd6da avfilter/f_interleave: no need to check for inlink eof if non-empty queue
Also set state to ready if there is any inlink with queued frame.
2020-04-25 13:35:22 +02:00
Paul B Mahol ec3b5deab4 avfilter/f_interleave: make sure that all frames in inlink queue are used 2020-04-25 13:07:13 +02:00
Paul B Mahol b29b934e4f avfilter/f_interleave: add duration option 2020-04-25 12:35:22 +02:00
Lynne b136a98303 scale_vulkan: take frame cropping parameters in account when scaling
Then sample_aspect_ratio line at the bottom was cargo-culted from the vaapi
scaling filter, but its unnecesary.
2020-04-23 18:23:45 +01:00
Lynne f66ac83c22 overlay_vulkan: add support for overlaying images with an alpha channel 2020-04-23 18:23:45 +01:00
Guo, Yejun 8ce9d88f93 dnn/native: add native support for divide
it can be tested with model file generated with below python script:
import tensorflow as tf
import numpy as np
import imageio

in_img = imageio.imread('input.jpg')
in_img = in_img.astype(np.float32)/255.0
in_data = in_img[np.newaxis, :]

x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')
z1 = 2 / x
z2 = 1 / z1
z3 = z2 / 0.25 + 0.3
z4 = z3 - x * 1.5 - 0.3
y = tf.identity(z4, name='dnn_out')

sess=tf.Session()
sess.run(tf.global_variables_initializer())

graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out'])
tf.train.write_graph(graph_def, '.', 'image_process.pb', as_text=False)

print("image_process.pb generated, please use \
path_to_ffmpeg/tools/python/convert.py to generate image_process.model\n")

output = sess.run(y, feed_dict={x: in_data})
imageio.imsave("out.jpg", np.squeeze(output))

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2020-04-22 13:15:00 +08:00
Guo, Yejun ef79408e97 dnn/native: add native support for 'mul'
it can be tested with model file generated from above python script:

import tensorflow as tf
import numpy as np
import imageio

in_img = imageio.imread('input.jpg')
in_img = in_img.astype(np.float32)/255.0
in_data = in_img[np.newaxis, :]

x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')
z1 = 0.5 + 0.3 * x
z2 = z1 * 4
z3 = z2 - x - 2.0
y = tf.identity(z3, name='dnn_out')

sess=tf.Session()
sess.run(tf.global_variables_initializer())

graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out'])
tf.train.write_graph(graph_def, '.', 'image_process.pb', as_text=False)

print("image_process.pb generated, please use \
path_to_ffmpeg/tools/python/convert.py to generate image_process.model\n")

output = sess.run(y, feed_dict={x: in_data})
imageio.imsave("out.jpg", np.squeeze(output))

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2020-04-22 13:14:47 +08:00
Guo, Yejun 6aa7e07e7c dnn/native: add native support for 'add'
It can be tested with the model file generated with below python script:

import tensorflow as tf
import numpy as np
import imageio

in_img = imageio.imread('input.jpg')
in_img = in_img.astype(np.float32)/255.0
in_data = in_img[np.newaxis, :]

x = tf.placeholder(tf.float32, shape=[1, None, None, 3], name='dnn_in')
z1 = 0.039 + x
z2 = x + 0.042
z3 = z1 + z2
z4 = z3 - 0.381
z5 = z4 - x
y = tf.math.maximum(z5, 0.0, name='dnn_out')

sess=tf.Session()
sess.run(tf.global_variables_initializer())

graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out'])
tf.train.write_graph(graph_def, '.', 'image_process.pb', as_text=False)

print("image_process.pb generated, please use \
path_to_ffmpeg/tools/python/convert.py to generate image_process.model\n")

output = sess.run(y, feed_dict={x: in_data})
imageio.imsave("out.jpg", np.squeeze(output))

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2020-04-22 13:14:30 +08:00
Paul B Mahol 4457f75c65 avfilter: add maskedthreshold filter 2020-04-18 12:34:49 +02:00
Paul B Mahol 9987f6d01e avfilter: add tmedian filter 2020-04-18 12:34:49 +02:00
Limin Wang 403bee30a5 avfilter/af_acrossover: Check sscanf() return value
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-04-17 16:56:13 +02:00
Paul B Mahol 24db9372eb avfilter/af_astats: add noise floor count stat 2020-04-17 13:28:01 +02:00
Paul B Mahol 715da29501 avfilter/af_astats: add slice threading support 2020-04-17 13:26:44 +02:00
Paul B Mahol 87b4fb65a8 avfilter/af_astats: measure noise floor 2020-04-17 13:26:30 +02:00
Paul B Mahol 0607f1bcb0 avfilter/af_amix: unbreak FATE, increase iterator when breaking from loop 2020-04-14 19:21:23 +02:00
Paul B Mahol 10a68ccd58 avfilter/af_amix: use av_strtod() for weights 2020-04-14 12:38:47 +02:00
Paul B Mahol ce24b1def0 avfilter/vf_telecine: avoid possible null-pointer dereference 2020-04-14 12:12:42 +02:00
Paul B Mahol 70f866ad1b avfilter/vf_mix: check if array is available 2020-04-13 16:44:01 +02:00
Gyan Doshi 2e2fa2d6e6 doc/filters: clarify metadata and logging for blackdetect 2020-04-13 11:23:24 +05:30
Carl Eugen Hoyos dbc5c0c1c8 lavfi/telecine: Mark telecined frames as interlaced. 2020-04-11 13:48:52 +02:00
Gyan Doshi 49a32fa45c avfilter/delogo: correct indentation for option show. 2020-04-11 11:46:48 +05:30