1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

6444 Commits

Author SHA1 Message Date
James Almer
d2ef9e6e7f x86/vf_blend: use ABS2 macro 2017-06-27 20:45:55 -03:00
James Almer
0daa1cf073 x86/vf_blend: optimize difference and negation functions
Process more pixels per loop.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-06-27 13:17:23 -03:00
James Almer
fa50d9360b x86/vf_blend: add sse and ssse3 extremity functions
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-06-27 13:17:23 -03:00
Paul B Mahol
e9510dc032 avfilter: remove usage of empty header
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-26 19:43:41 +02:00
Paul B Mahol
22a03c2900 avfilter/vf_blend: add extremity blend mode
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-25 16:39:10 +02:00
Paul B Mahol
8a14374ab3 avfilter/vf_waveform: allow alpha output for >8 depth planar rgb inputs
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-25 13:14:22 +02:00
Paul B Mahol
f269a1e0b8 avfilter/vf_overlay: separate functions with main alpha
~5-15% faster overall with main input without alpha.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-25 12:32:53 +02:00
Paul B Mahol
5c1f4330d4 avfilter/vf_lut2: add support for gray10 and gray12 pixel formats
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-24 22:40:32 +02:00
Paul B Mahol
c1b43e8452 avfilter/vf_overlay: remove rgb option
Its been deprecated for over 3 years.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-24 19:20:46 +02:00
Paul B Mahol
f483949188 avfilter/af_headphone: do not free frame that's gonna be reused later
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-24 19:15:57 +02:00
Paul B Mahol
c90b88090c avfilter: do not leak AVFrame on failed buffer allocation
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-24 19:15:57 +02:00
Ronald S. Bultje
97f7f83169 vf_spp: only assign function pointers if permutation matches expectations. 2017-06-24 07:53:15 -04:00
Paul B Mahol
565dc0e283 avfilter/vf_overlay: add auto format mode
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-24 10:18:30 +02:00
Paul B Mahol
04aa09c4bc Revert "lavfi/buffersrc: push the frame deeper if requested."
Fixes framesync filters with shortest option enabled.

This reverts commit 0ff5567a30.
2017-06-23 16:18:42 +02:00
Diego Biurrun
fd502f4f5f build: Generalize yasm/nasm-related variable names
None of them are specific to the YASM assembler.

(Cherry-picked from libav commit 39e208f4d4)

Signed-off-by: James Almer <jamrial@gmail.com>
2017-06-21 17:00:29 -03:00
Paul B Mahol
664ac7c5e2 avfilter/af_stereotools: add forgotten break
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-21 19:20:25 +02:00
Kevin Mark
05feeeb813 libavfilter/scale: Populate ow/oh when using 0 as w/h
The input width and height is known at parse time so there's no
reason ow/oh should not be usable when using 0 as the width or
height expression.

Previously in "scale=0:ow" ow would be set to "0" which works,
conveniently, as "scale=0:0" is perfectly valid input but this breaks
down when you do something like "scale=0:ow/4" which one could
reasonably expect to work as well, but does not as ow is 0 not the
real value.

This change handles the 0 case for w/h immediately so the ow/oh
variables work as expected. Consequently, the rest of the code does
not need to handle 0 input. w/h will always be > 0 or < 0.

The second explicit (int) cast ensures that ow/oh appear as integers
as a user might expect when dealing with pixel dimensions.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2017-06-19 14:27:52 -04:00
Paul B Mahol
ef178f630f avfilter/af_stereotools: add 2 more modes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-19 18:59:33 +02:00
Paul B Mahol
1a4236e025 avfilter/af_superequalizer: stop leaking s->out frame
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-19 18:34:04 +02:00
Paul B Mahol
53624d62d9 avfilter/af_superequalizer: improve description
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-19 18:19:16 +02:00
Paul B Mahol
2820c9dfaa avfilter/af_superequalizer: fix out of array access
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-19 18:19:16 +02:00
Paul B Mahol
b9d0a5fc21 avfilter: add roberts cross operator
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-19 14:04:44 +02:00
Paul B Mahol
ca5cf84655 avfilter: add superequalizer filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-19 14:03:54 +02:00
Nicolas George
d790f18ac0 lavfi: print the error message when threading init fails. 2017-06-19 10:29:17 +02:00
Paul B Mahol
478a1949d9 avfilter/af_amix: fix possible hang
Fixes #6424.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-18 21:06:54 +02:00
Mark Thompson
70808859dd vf_hwmap: Properly free a locally derived device
Fixes CID 1412853.

(cherry picked from commit a670eea560)
2017-06-18 17:06:41 +01:00
Mark Thompson
d984b29b21 vf_hwmap: Add missing error code
Fixes CID 1412854.

(cherry picked from commit 5635c80bf5)
2017-06-18 17:05:13 +01:00
Paul B Mahol
a23a56e77c libavfilter/af_biquads: add shorter option for width_type
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-18 17:31:03 +02:00
Paul B Mahol
9b667f609c avfilter/af_headphone: fix possible memory leaks on failure
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-15 11:19:12 +02:00
Mark Thompson
d81be0a60a vf_hwmap: Add reverse mapping for hardware frames
This is something of a hack.  It allocates a new hwframe context for
the target format, then maps it back to the source link and overwrites
the input link hw_frames_ctx so that the previous filter will receive
the frames we want from ff_get_video_buffer().  It may fail if
the previous filter imposes any additional constraints on the frames
it wants to use as output.

(cherry picked from commit 81a4cb8e58)
2017-06-14 22:27:34 +01:00
Mark Thompson
b2ef1f42ba vf_hwmap: Add device derivation
Also refactor a little and improve error messages to make failure
cases easier to understand.

(cherry picked from commit 38cb05f1c8)
2017-06-14 22:27:34 +01:00
Mark Thompson
bff7bec1d7 vf_deinterlace_vaapi: Add support for field rate output
In order to work correctly with the i965 driver, this also fixes the
direction of forward/backward references - forward references are
intended to be those from the past to the current frame, not from the
current frame to the future.

(cherry picked from commit 9aa251c98c)
2017-06-14 22:26:32 +01:00
Timo Rothenpieler
feb13aed79 avfilter/vf_signature: fix memory leaks in error cases
Fixes CIDs 1403234 and 1403235
2017-06-13 19:49:39 +02:00
Timo Rothenpieler
0fbc9bbbbb avfilter/vf_scale_npp: fix out-of-bounds reads
Fixes CIDs 1396414 and 1396415
2017-06-13 19:47:44 +02:00
Timo Rothenpieler
21583e936a avfilter/unsharp: fix uninitialized pointer read
Fixes CID 1396855
2017-06-13 19:47:19 +02:00
Paul B Mahol
f85cad799b avfilter: properly set SAR for A->V filters
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-13 15:10:58 +02:00
Paul B Mahol
d4d1fc823f avfilter: add native headphone spatialization filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-12 18:08:52 +02:00
Vittorio Giovara
c12e8f5f0b vf_colorspace: Add a pixdesc API alias name for bt2020nc color space 2017-06-09 10:44:11 -04:00
Paul B Mahol
2336c76b22 avfilter/af_sofalizer: switch to libmysofa
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-08 22:02:26 +02:00
Vittorio Giovara
f7f60749e0 vf_colorspace: Add support for jedec p22 primaries
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-06-07 23:39:31 -04:00
Vittorio Giovara
35c76f2e13 vf_colorspace: Add support for smpte248 color primaries 2017-06-07 22:56:11 -04:00
Vittorio Giovara
d9909b11d9 vf_colorspace: Add support for gbr color space
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-06-06 11:22:52 -04:00
Paul B Mahol
67162554d4 avfilter/af_afftfilt: fix memory leaks
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-04 22:51:57 +02:00
Paul B Mahol
fab1863917 avfilter/af_surround: add support for some upmixing of 3.0, 2.1 and 5.1 channel layout
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-04 16:37:47 +02:00
Kevin Mark
08213e0b79 libavfilter/scale2ref: Fix out-of-bounds array access
ff_scale_eval_dimensions blindly assumes that two inputs are always
available as of 3385989b98. This is
notably not the case when the function is called for the scale
filter. With the scale filter inputs[1] does not exist.

ff_scale_eval_dimensions now has an updated scale2ref check that
makes certain two inputs are actually available before attempting to
access the second one.

Thanks to James Almer for reporting this bug. This should fix the 820
Valgrind tests I single-handedly managed to break.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-06-03 23:14:04 +02:00
Kevin Mark
3385989b98 libavfilter/scale2ref: Add constants for the primary input
Variables pertaining to the main video are now available when
using the scale2ref filter. This allows, as an example, scaling a
video with another as a reference point while maintaining the
original aspect ratio of the primary/non-reference video.

Consider the following graph: scale2ref=iw/6:-1 [main][ref]
This will scale [main] to 1/6 the width of [ref] while maintaining
the aspect ratio. This works well when the AR of [ref] is equal to
the AR of [main] only. What the above filter really does is
maintain the AR of [ref] when scaling [main]. So in all non-same-AR
situations [main] will appear stretched or compressed to conform to
the same AR of the reference video. Without doing this calculation
externally there is no way to scale in reference to another input
while maintaining AR in libavfilter.

To make this possible, we introduce eight new constants to be used
in the w and h expressions only in the scale2ref filter:

 * main_w/main_h: width/height of the main input video
 * main_a: aspect ratio of the main input video
 * main_sar: sample aspect ratio of the main input video
 * main_dar: display aspect ratio of the main input video
 * main_hsub/main_vsub: horiz/vert chroma subsample vals of main
 * mdar: a shorthand alias of main_dar

Of course, not all of these constants are needed for maintaining the
AR, but adding additional constants in line of what is available for
in/out allows for other scaling possibilities I have not imagined.

So to now scale a video to 1/6 the size of another video using the
width and maintaining its own aspect ratio you can do this:

scale2ref=iw/6:ow/mdar [main][ref]

This is ideal for picture-in-picture configurations where you could
have a square or 4:3 video overlaid on a corner of a larger 16:9
feed all while keeping the scaled video in the corner at its correct
aspect ratio and always the same size relative to the larger video.

I've tried to re-use as much code as possible. I could not find a way
to avoid duplication of the var_names array. It must now be kept in
sync with the other (the normal one and the scale2ref one) for
everything to work which does not seem ideal. For every new variable
introduced/removed into/from the normal scale filter one must be
added/removed to/from the scale2ref version. Suggestions on how to
avoid var_names duplication are welcome.

var_values has been increased to always be large enough for the
additional scale2ref variables. I do not forsee this being a problem
as the names variable will always be the correct size. From my
understanding of av_expr_parse_and_eval it will stop processing
variables when it runs out of names even though there may be
additional (potentially uninitialized) entries in the values array.
The ideal solution here would be using a variable-length array but
that is unsupported in C90.

This patch does not remove any functionality and is strictly a
feature patch. There are no API changes. Behavior does not change for
any previously valid inputs.

The applicable documentation has also been updated.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-06-01 22:56:08 +02:00
Paul B Mahol
dc72d1dde9 avfilter: add audio surround upmixer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-01 21:25:36 +02:00
Vittorio Giovara
1f4454230d zscale: Add range options aliases to match scale ones
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-05-26 10:29:32 -04:00
Vittorio Giovara
6aafe56421 zscale: Add pixdesc-API compatible color names to filter options
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-05-26 10:28:50 -04:00
Hendrik Leppkes
9fb293cfd8 Use AVOnce as a static variable consistently
Using AVOnce as a stack variable makes no sense as the state is lost
when the function exits.

This fixes repeated calls to av(filter/device)_register_all
2017-05-22 12:36:32 +02:00