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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>