summaryrefslogtreecommitdiff
path: root/libavfilter/af_hdcd.c
Commit message (Collapse)AuthorAge
* avfilter: don't anonymously typedef structsPaul B Mahol2017-05-13
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* Fix all -Wformat warnings raised by DJGPPClément Bœsch2017-03-29
|
* avfilter/af_hdcd: Fix leak of memory allocated by ff_make_format_list()Michael Niedermayer2017-01-22
| | | | | | Fixes CID1396265 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* doc: fix spelling errorsAndreas Cadhalpun2016-10-21
| | | | | | | | Thanks to Mathieu Malaterre <malat@debian.org> for reporting the Que/Queue typo. (https://bugs.debian.org/839542) Reviewed-by: Lou Logan <lou@lrcd.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* af_hdcd: disable auto-convert by defaultBurt P2016-10-05
| | | | | | | | | | As all known valid HDCD sample formats and sample rates are now handled by the filter, remove the scan that "invades the privacy" of the filter graph and turn off autoconvert by default as requested by Nicolas George. http://ffmpeg.org/pipermail/ffmpeg-devel/2016-August/197571.html Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: add experimental 20 and 24-bit decoding supportBurt P2016-10-05
| | | | | | | | | | I don't have any legitimate 20 or 24-bit HDCD to test. It is known that the PM Model Two would insert packets into 20 and 24-bit output, but I have no idea what differences in behavior existed when decoding 20 or 24-bit. For now, as with 16-bit, PE (if enabled) will expand the top 3dB into 9dB and LLE (gain adjust) will be applied if signaled. Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: hdcd_scan() and hdcd_integrate() handle stereo and single channelBurt P2016-10-05
| | | | | | | | | | | New versions of hdcd_scan() and hdcd_integrate() that also do the work of hdcd_scan_stereo() and hdcd_integrate_stereo(). Some code split into previously separate functions to remove duplication is now merged back into each function in the single place where it is used. Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: support s16p (WavPack) directlyBurt P2016-10-05
| | | | | | | The buffer is already being copied anyway, so interlace the planar format during the copy and remove one use of auto-convert. Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: allow all HDCD sample ratesBurt P2016-10-05
| | | | | | | | The PM Model Two could output HDCD-encoded audio in CD and all DVD-Audio sample rates. (44100, 48000, 88200, 96000, 176400, and 192000 Hz) Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: add mono as a supported channel layoutBurt P2016-10-05
| | | | Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: fix bounds check in hdcd_envelope()Burt P2016-09-08
| | | | | | | From Sebastian Ramacher. https://github.com/bp0/libhdcd/pull/11 Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: hdcd_analyze_gen() using int instead of floatBurt P2016-09-07
| | | | Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: tweak hdcd_analyze_prepare() a bitBurt P2016-09-07
| | | | | | | | * use the actual sample rate * use a more sensible frequency for the tone * update fate test result Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: move decoding setup from init to config_inputBurt P2016-09-07
| | | | Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: fix possible integer overflowBurt P2016-09-07
| | | | Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: some types renamed to remove _tBurt P2016-09-07
| | | | | | | Following a suggestion by Diego Biurrun. _t is reserved for POSIX, apparently. Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: av_frame_free(out) if av_frame_copy_props() failsBurt P2016-08-25
| | | | Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: for easier maintenance alongside libhdcdBurt P2016-08-25
| | | | | | | | | | | | | | Mostly just re-arranges some code to make it easier to update this filter and libhdcd together. filter_frame() is much simpler as a result. * use the HDCD detection data structure and functions from libhdcd, moved detection code out of filter_frame() * moved analyze_mode preparation out of filter_frame() into hdcd_analyze_prepare(), from libhdcd * moved some macro definitions to the top so they are all together Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: check return value of av_frame_copy_props()Burt P2016-08-24
| | | | | | | | Anton Khirnov: "[av_frame_copy_props()] potentially contains memory allocation, so the return value needs to be checked." Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: PE table limitsBurt P2016-08-21
| | | | Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: add AVOption to disable autoconversion in the filter graphBurt P2016-08-21
| | | | Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: add AVOption to set the CDT periodBurt P2016-08-21
| | | | Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: Code comments updateBurt P2016-08-21
| | | | Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: Don't warn if converting from AV_SAMPLE_FMT_S16PBurt P2016-08-08
| | | | | | | Also checking AVFilterLink->type is AVMEDIA_TYPE_AUDIO before calling av_get_sample_fmt_name() on AVFilterLink->format. Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: Add analyze modeBurt P2016-08-08
| | | | | | | | | | A new mode, selected by filter option, to aid in analysis of HDCD encoded audio. In this mode the audio is replaced by a solid tone and the amplitude is adjusted to signal some specified aspect of the process. The output file can be loaded in an audio editor alongside the original, where the user can see where different features or states are present. Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: convert AVOptions from INT to BOOLBurt P2016-08-06
| | | | | | As suggested by Timothy Gu. Signed-off-by: Burt P <pburt0@gmail.com>
* af_hdcd: add flags to AVOption defsBurt P2016-08-02
| | | | | Signed-off-by: Burt P <pburt0@gmail.com> Signed-off-by: Timothy Gu <timothygu99@gmail.com>
* af_hdcd: Warn if there is any resampling or format conversion in the link chainBurt P2016-08-01
| | | | | | | | | 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>
* af_hdcd: Process stereo channels together, fix #5727Burt P2016-08-01
| | | | | | | | | | | | | | | 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>
* af_hdcd: Move code detect/check into own functionBurt P2016-08-01
| | | | | Signed-off-by: Burt P <pburt0@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* af_hdcd: add force_pe filter optionBurt P2016-08-01
| | | | | | | | | 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>
* af_hdcd: Improve error detection loggingBurt P2016-08-01
| | | | | | | | | * 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>
* af_hdcd: give cdt expired counter a value for never setBurt P2016-07-31
| | | | | | | | 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>
* af_hdcd: fix a minor cosmetic annoyanceBurt P2016-07-31
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavfi/hdcd: fix styleClément Bœsch2016-07-28
|
* lavfi/hdcd: mark pe_str as static and constClément Bœsch2016-07-28
|
* af_hdcd: Report PE as being intermittent or permanentBurt P2016-07-28
| | | | | | | | 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>
* af_hdcd: Add counter for cdt expirationsBurt P2016-07-27
| | | | | | | | 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>
* af_hdcd: more comments in state structBurt P2016-07-27
| | | | | | | 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>
* af_hdcd: Improve HDCD detectionBurt P2016-07-27
| | | | | | | | 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>
* af_hdcd: detect and report encoding errors and odditiesBurt P2016-07-14
| | | | | | | | 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>
* af_hdcd: only hdcd_update_info() when something changesBurt P2016-07-14
| | | | | | | | 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>
* af_hdcd: fewer false positives by ignoring code_counterC in HDCD detectionBurt P2016-07-14
| | | | | Signed-off-by: Burt P <pburt0@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* af_hdcd: don't log full HDCD stats if HDCD was not detectedBurt P2016-07-12
| | | | | Signed-off-by: Burt P <pburt0@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* af_hdcd: integrate() renamed hdcd_integrate() to be consistent with the ↵Burt P2016-07-12
| | | | | | | other function names Signed-off-by: Burt P <pburt0@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavfilter/af_hdcd.c: Collect HDCD stats and reportBurt P2016-07-06
| | | | | | | | | | | | | | | 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>
* avfilter/af_hdcd: Use int32_t instead of int for gaintable in hdcd filter.Benjamin Steffes2016-06-15
| | | | | | | | | | Signed-off-by: Benjamin Steffes <benjaminst123@gmail.com> (comment by ronald) prevent the theoretical case where the container type (int) would be 64 bit on some platforms, which would waste some space Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/af_hdcd: Replace complexer expression by litteral constantMichael Niedermayer2016-05-24
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavfilter/af_hdcd: fixed negative signed value shiftdsmudhar2016-05-23
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/af_hdcd: Fix informations typoMichael Niedermayer2016-04-16
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>