Commit Graph

5979 Commits

Author SHA1 Message Date
Burt P
e0b8cba058 af_hdcd: add flags to AVOption defs
Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2016-08-02 22:40:23 -07:00
Timothy Gu
58c7bf789f doxygen: Standardize root-level modules 2016-08-02 22:15:25 -07:00
LoRd_MuldeR
8ab200fb8a avfilter/af_dynaudnorm: improve pre-filling code
In order to avoid possible clipping at the very
beginning. Especially apparent when "alternative"
boundary mode is used.

Adopted from original commit by committer.
2016-08-02 20:00:44 +02:00
Burt P
bea17a3d57 af_hdcd: Warn if there is any resampling or format conversion in the link chain
HDCD is only encoded in s16@44100Hz. Scan the chain of AVFilterLinks
for any resampling or format conversion/truncation that might cause
problems for the filter and issue warnings.

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-01 23:57:55 +02:00
Burt P
d574e22659 af_hdcd: Process stereo channels together, fix #5727
Issue #5727: gain adjustment should only be applied if matching
gain value from a valid packet in both channels. The existing functions process
each channel separately, so it was not possible.

* New versions of hdcd_process(), hdcd_scan(), hdcd_integrate() named
  hdcd_*_stereo() that process both channels together.
* target_gain applied will be the last matching target_gain.
* The old single channel functions remain as an option. They can be
  used by: -af hdcd=process_stereo=0.

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-01 23:57:55 +02:00
Burt P
12759cc034 af_hdcd: Move code detect/check into own function
Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-01 19:48:32 +02:00
Burt P
b90d0ab4be af_hdcd: add force_pe filter option
Used to attempt replication of some results from
http://www.audiomisc.co.uk/HFN/HDCD/Examined.html
May not be generally useful, defaults to off.

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-01 19:48:28 +02:00
Burt P
6517177d97 af_hdcd: Improve error detection logging
* Moves the filter context member out of state and into HDCDContext
* More useful information when an error is detected
* Gives a location near where the error was detected

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-01 19:48:24 +02:00
Burt P
390eea61be af_hdcd: give cdt expired counter a value for never set
The counter is now -1 if the code detect timer was never set,
and 0 if it was set but never expired.

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-31 16:36:22 +02:00
Burt P
999c6b1da8 af_hdcd: fix a minor cosmetic annoyance
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-31 16:36:08 +02:00
Alexey Tourbin
906ee41141 avfilter/af_stereowiden: fix read/write past the end of buffer
The stereowiden filter uses a buffer, s->buffer[], and a pointer
within the buffer, s->write, to implement inter-channel delays.
The loop which applies the delayed samples turns out to be faulty.

   109      for (n = 0; n < in->nb_samples; n++, src += 2, dst += 2) {
   110          const float left = src[0], right = src[1];
   111          float *read = s->write + 2;
   112
   113          if (read > s->buffer + s->length)
   114              read = s->buffer;
   115
   116          dst[0] = drymix * left - crossfeed * right - feedback * read[1];
   117          dst[1] = drymix * right - crossfeed * left - feedback * read[0];
   118
   119          s->write[0] = left;
   120          s->write[1] = right;
   121
   122          if (s->write == s->buffer + s->length)
   123              s->write = s->buffer;
   124          else
   125              s->write += 2;
   126      }

For one, the buffer gets written past its end in lines 119-120, before
the bound check is done in lines 122-123.  This can be easily confirmed
by valgrind.

==3544== Invalid read of size 4
==3544==    at 0x593B41: filter_frame (af_stereowiden.c:116)
==3544==  Address 0xb1b03c4 is 4 bytes after a block of size 7,680 alloc'd
==3544==
==3544== Invalid read of size 4
==3544==    at 0x593B66: filter_frame (af_stereowiden.c:117)
==3544==  Address 0xb1b03c0 is 0 bytes after a block of size 7,680 alloc'd
==3544==
==3544== Invalid write of size 4
==3544==    at 0x593B79: filter_frame (af_stereowiden.c:119)
==3544==  Address 0xb1b03c0 is 0 bytes after a block of size 7,680 alloc'd
==3544==
==3544== Invalid write of size 4
==3544==    at 0x593B7D: filter_frame (af_stereowiden.c:120)
==3544==  Address 0xb1b03c4 is 4 bytes after a block of size 7,680 alloc'd

Also, using two separate pointers, s->write and read = s->write + 2,
does not seem to be well thought out.  To apply the delay of s->buffer[],
it is enough to read the delayed samples at the current position within
the buffer, and then to store new samples at the same current position.
Thus the application of delayed samples can probably be best described
with a single pointer s->cur.

I also introduce a minor change to ensure that the size of s->buffer[]
is always a multiple of 2.  Since the delay parameter is a float, it is
otherwise possible to trick the code into allocating off-by-one buffer.
2016-07-30 21:53:25 +02:00
Lucas Cooper
bc9ce5f6be avfilter: Add new format for PSNR stats log
Add an AVOption stats_version with a new header for V2 stats, which
specifies the stats log version and lists the fields that will be
present in the log (to ease parsing).

The primary motivation is to facilitate the addition of optional fields
to the log without breaking backwards compatibility, while making the
logs easier to parse.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-29 20:49:53 +02:00
Paul B Mahol
d7ae4f79d3 avfilter/f_drawgraph: add another slide mode 2016-07-28 10:30:06 +02:00
Clément Bœsch
37abc8cca2 lavfi/hdcd: fix style 2016-07-28 09:30:10 +02:00
Clément Bœsch
4791716c1d lavfi/hdcd: mark pe_str as static and const 2016-07-28 09:29:20 +02:00
Burt P
fb91143ef1 af_hdcd: Report PE as being intermittent or permanent
The Peak Extend feature could be enabled permanently or only
when needed. This is now reported.

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-28 02:26:57 +02:00
Burt P
c26305f6ae af_hdcd: Add counter for cdt expirations
Adds a counter for when the "code detect timer" expired without
finding a valid packet.

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-27 23:09:45 +02:00
Burt P
c7ba34b6ea af_hdcd: more comments in state struct
Add some comments describing the fields in hdcd_state_t.

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-27 23:09:26 +02:00
Burt P
91854b8ef6 af_hdcd: Improve HDCD detection
HDCD is now only considered detected if a valid packet
is active in both channels simultaneously.

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-27 22:21:43 +02:00
Clément Bœsch
c6e900e925 lavfi/curves: fix meaningless const int returned value
Spotted-by: James Almer <jamrial@gmail.com>
2016-07-26 21:22:27 +02:00
Clément Bœsch
308f9b1c49 lavfi/selectivecolor: add 16-bit support 2016-07-24 15:29:37 +02:00
Clément Bœsch
b8aaedcd01 lavfi/selectivecolor: fix picking black as neutral when alpha is present 2016-07-24 14:21:50 +02:00
Clément Bœsch
6e971f7d66 lavfi: bump minor after recent curves filter additions 2016-07-24 12:22:41 +02:00
Clément Bœsch
b470d81f4e lavfi/curves: prefix init and uninit function names 2016-07-24 12:18:30 +02:00
Clément Bœsch
62a31aecf6 lavfi/curves: pass log ctx as void* instead of AVFilterContext* 2016-07-24 12:18:30 +02:00
Clément Bœsch
39c6d4a8c5 lavfi/curves: reindent after previous commit 2016-07-24 12:18:30 +02:00
Clément Bœsch
e30cdac14b lavfi/curves: add 16-bit support 2016-07-24 12:18:30 +02:00
Clément Bœsch
f19f5b906d lavfi/curves: move alloc and init of LUTs inside config_input()
This is needed in order to have different sizes of LUTs according to the
input.
2016-07-24 12:18:30 +02:00
Clément Bœsch
050f790594 lavfi/curves: dynamically allocate LUTs
This simplifies following commits.
2016-07-24 12:18:30 +02:00
Clément Bœsch
4eee06ae87 lavfi/curves: add various const where it makes sense 2016-07-24 12:18:30 +02:00
Clément Bœsch
51a873d441 lavfi/curves: remove pointless logging since the addition of plot option 2016-07-24 12:18:30 +02:00
Clément Bœsch
4a8f5f1fd8 lavfi/curves: add plot option 2016-07-24 12:18:30 +02:00
Clément Bœsch
5c14018fc4 lavfi/curves: do not automatically insert points at x=0 and x=1
There is actually a need for the origin and end point not to be defined.
We can not automatically insert them with the y value of the first and
last point as it will influence the curves in a wrong way.

Fixes #5397
2016-07-24 12:18:30 +02:00
Michael Niedermayer
9264bb7e79 avfilter/vf_psnr: Fix rounding error in average_max
The intermediate was rounded to an integer

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-21 11:26:28 +02:00
Burt P
c41718c0d0 af_hdcd: detect and report encoding errors and oddities
Count and report when a code is signaled but fails to match a known pattern.
For example try Līve - Secret Samadhi.

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-14 22:09:00 +02:00
Burt P
5c7457c028 af_hdcd: only hdcd_update_info() when something changes
Only call hdcd_update_info() when the control code changes
instead of every frame, so the counters are more meaningful.

Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-14 22:09:00 +02:00
Burt P
33fc4cc7c6 af_hdcd: fewer false positives by ignoring code_counterC in HDCD detection
Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-14 22:09:00 +02:00
Michael Niedermayer
e879819e7b avfilter/vf_uspp: Check for encoding failure
Fixes CID1363015

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-13 20:16:27 +02:00
Burt P
7af44ce2f7 af_hdcd: don't log full HDCD stats if HDCD was not detected
Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-12 22:55:04 +02:00
Burt P
0d8caeb41e af_hdcd: integrate() renamed hdcd_integrate() to be consistent with the other function names
Signed-off-by: Burt P <pburt0@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-12 21:39:01 +02:00
Sami Hult
d4c8e93190 Changed metadata print option to accept general urls
This is an - once again - updated patch, that uses avio_write instead
of avio_puts to stream clean text output without null characters. Works
now for me as intended.

Changes metadata filter to accept general urls as file argument without
breaking former behaviour. As a byproduct, it also allows for writing to
file "-" if specified as "file:-".

Example:

ffmpeg -i test.wav -filter_complex "silencedetect=n=-40dB:d=0.1,ametadata=mode=print:file='pipe\:4'" -f null

Signed-off-by: Sami Hult <sami.hult@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-10 00:36:49 +02:00
Burt P
ba69a81019 libavfilter/af_hdcd.c: Collect HDCD stats and report
The new HDCD filter really does nothing to show that it is working or
that HDCD control information was even detected in the stream. This
patch collects information about the decode, like which features were
used, and reports it to the user at the end.

Also,
* Fixes low-level gain adjustment
* Updates the documentation

Signed-off-by: Burt P <pburt0@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-06 22:54:47 +02:00
Paul B Mahol
de30863fff avfilter/vf_rotate: add >8 bit depth support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-07-04 20:39:16 +02:00
Timo Rothenpieler
1a75145559 lavfi: Move new field to the end of AVFilterContext
This fixes an accidental ABI break introduced at 8688d3a.
2016-06-29 18:23:28 +02:00
Timo Rothenpieler
1eb43af1a0 lavfi: Move new field to the end of AVFilterLink
Even though this is not part of the public API, some external
applications access fields after it, thus breaking after updating from
ffmpeg 3.0 or earlier.
Since it is not public, it can be freely moved to the end to avoid
that problem in the future.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-29 12:53:07 +02:00
Matthieu Bouron
0acc170aad Merge commit '535a742c2695a9e0c586b50d7fa76e318232ff24'
* commit '535a742c2695a9e0c586b50d7fa76e318232ff24':
  build: Change structure of the linker version script templates

Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
2016-06-27 17:56:47 +02:00
Matthieu Bouron
9eb3da2f99 asm: FF_-prefix internal macros used in inline assembly
See merge commit '39d6d3618d48625decaff7d9bdbb45b44ef2a805'.
2016-06-27 17:21:18 +02:00
Hendrik Leppkes
c142dc203e Merge commit 'dc40a70c5755bccfb1a1349639943e1f408bea50'
* commit 'dc40a70c5755bccfb1a1349639943e1f408bea50':
  Drop unnecessary libavutil/x86/asm.h #includes

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-06-26 15:53:00 +02:00
Michael Niedermayer
8baa1d2209 avfilter/vf_paletteuse: enable skip_initial_unpaired
Fixes crash due to unprocessed input being passed through

This fixes the last segfault caused by mixing 3.0 and 3.1 libs and
applications

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-26 01:08:28 +02:00
Michael Niedermayer
f1dabc958e avfilter/dualinput: Add support to skip initial unpaired frames
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-26 01:01:28 +02:00