summaryrefslogtreecommitdiffstats
path: root/libavcodec/lpc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-30 14:40:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-10-30 14:40:22 +0100
commite79c3858b35fcc77c68c33b627958e736686957e (patch)
tree5f933517c2909def4e2930a409b0a460eb4f41fd /libavcodec/lpc.c
parentcd37963684d8ee9819af15ccebe09d84839101dd (diff)
parent14f031d7ecfabba0ef02776d4516aa3dcb7c40d8 (diff)
downloadffmpeg-streaming-e79c3858b35fcc77c68c33b627958e736686957e.zip
ffmpeg-streaming-e79c3858b35fcc77c68c33b627958e736686957e.tar.gz
Merge commit '14f031d7ecfabba0ef02776d4516aa3dcb7c40d8'
* commit '14f031d7ecfabba0ef02776d4516aa3dcb7c40d8': dv: use AVStream.index instead of abusing AVStream.id lavfi: add ashowinfo filter avcodec: Add a RFC 3389 comfort noise codec lpc: Add a function for calculating reflection coefficients from samples lpc: Add a function for calculating reflection coefficients from autocorrelation coefficients lavr: document upper bound on number of output samples. lavr: add general API usage doxy indeo3: remove duplicate capabilities line. fate: ac3: Add dependencies Conflicts: Changelog doc/filters.texi libavcodec/Makefile libavcodec/allcodecs.c libavcodec/avcodec.h libavcodec/codec_desc.c libavcodec/version.h libavfilter/Makefile libavfilter/af_ashowinfo.c libavfilter/allfilters.c libavfilter/version.h libavutil/avutil.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/lpc.c')
-rw-r--r--libavcodec/lpc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/lpc.c b/libavcodec/lpc.c
index 5ccd5a8..019689a 100644
--- a/libavcodec/lpc.c
+++ b/libavcodec/lpc.c
@@ -149,6 +149,18 @@ static int estimate_best_order(double *ref, int min_order, int max_order)
return est;
}
+int ff_lpc_calc_ref_coefs(LPCContext *s,
+ const int32_t *samples, int order, double *ref)
+{
+ double autoc[MAX_LPC_ORDER + 1];
+
+ s->lpc_apply_welch_window(samples, s->blocksize, s->windowed_samples);
+ s->lpc_compute_autocorr(s->windowed_samples, s->blocksize, order, autoc);
+ compute_ref_coefs(autoc, order, ref, NULL);
+
+ return order;
+}
+
/**
* Calculate LPC coefficients for multiple orders
*
OpenPOWER on IntegriCloud