[FFmpeg-devel] [PATCH] Implement hdcd filtering
Michael Niedermayer
michael at niedermayer.cc
Thu Apr 7 22:52:48 CEST 2016
On Tue, Mar 29, 2016 at 11:30:28AM +0200, Benjamin St wrote:
> > Not all of the comments on top of the filter file look
> > very useful to me, what do you think?
> > In any case, I'd say a link to these should be useful:
> > http://www.audiomisc.co.uk/HFN/HDCD/Enigma.html
> > http://www.audiomisc.co.uk/HFN/HDCD/Examined.html
> > (Or only the second one.)
> >
> I removed the rather useless comment and added both links.
>
> Please also add a fate test, since this is using floats,
> > I would suggest to only compare pcm_s16 (instead of 24).
>
> Floats are no longer needed. This version uses only integer.
> Makefile | 1
> af_hdcd.c | 1138 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> allfilters.c | 1
> 3 files changed, 1140 insertions(+)
> 4e25a0315a659eb9e71adfacb9f9b2e78c5e1f33 0001-Implement-high-definition-audio-cd-filtering.patch
> From f3053beac96884123e1c9d50b46876e6f69ae0d1 Mon Sep 17 00:00:00 2001
> From: Benjamin Steffes <benjaminst123 at gmail.com>
> Date: Mon, 21 Mar 2016 23:52:48 +0100
> Subject: [PATCH] Implement high definition audio cd filtering.
>
> Signed-off-by: Benjamin Steffes <benjaminst123 at gmail.com>
> ---
> libavfilter/Makefile | 1 +
> libavfilter/af_hdcd.c | 1138 ++++++++++++++++++++++++++++++++++++++++++++++
> libavfilter/allfilters.c | 1 +
> 3 files changed, 1140 insertions(+)
> create mode 100644 libavfilter/af_hdcd.c
Changelog entry and docs update missing
a fate test would still be interresting i think
has this been tested against some reference / known to be correct
output for some stream ?
[...]
> +static int integrate(hdcd_state_t *state, int *flag, int const *samples, int count, int stride)
> +{
> + uint32_t bits = 0;
> + int result = FFMIN(state->readahead, count);
> + int i;
> + *flag = 0;
> +
> + for (i = result - 1; i >= 0; i--) {
> + bits |= (*samples & 1) << i; /* might be better as a conditional? */
> + samples += stride;
> + }
> +
> + state->window = (state->window << result) | bits;
> + state->readahead -= result;
> + if (state->readahead > 0)
> + return result;
> +
> + bits = (state->window ^ state->window >> 5 ^ state->window >> 23) & 0xffffffffu;
the & 0xffffffffu; seems redundant
[...]
> +static int filter_frame(AVFilterLink *inlink, AVFrame *in)
> +{
> + AVFilterContext *ctx = inlink->dst;
> + HDCDContext *s = ctx->priv;
> + AVFilterLink *outlink = ctx->outputs[0];
> + AVFrame *out;
> + int16_t *in_data;
const
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160407/bcbe0cff/attachment.sig>
More information about the ffmpeg-devel
mailing list