From 799e2324901c2a06e9a60ee281cd283475f1c4fa Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sat, 27 Oct 2012 00:25:04 -0400 Subject: flacdsp: move lpc encoding from FLAC encoder to FLACDSPContext Also, templatize the functions for 16-bit and 32-bit sample range. This will be used for 24-bit FLAC encoding. --- libavcodec/flacdsp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libavcodec/flacdsp.c') diff --git a/libavcodec/flacdsp.c b/libavcodec/flacdsp.c index 3f4f71076c..b916869321 100644 --- a/libavcodec/flacdsp.c +++ b/libavcodec/flacdsp.c @@ -26,6 +26,7 @@ #define SAMPLE_SIZE 16 #define PLANAR 0 #include "flacdsp_template.c" +#include "flacdsp_lpc_template.c" #undef PLANAR #define PLANAR 1 @@ -36,6 +37,7 @@ #define SAMPLE_SIZE 32 #define PLANAR 0 #include "flacdsp_template.c" +#include "flacdsp_lpc_template.c" #undef PLANAR #define PLANAR 1 @@ -86,10 +88,13 @@ static void flac_lpc_32_c(int32_t *decoded, const int coeffs[32], av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int bps) { - if (bps > 16) + if (bps > 16) { c->lpc = flac_lpc_32_c; - else + c->lpc_encode = flac_lpc_encode_c_32; + } else { c->lpc = flac_lpc_16_c; + c->lpc_encode = flac_lpc_encode_c_16; + } switch (fmt) { case AV_SAMPLE_FMT_S32: -- cgit v1.2.3