diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-10-27 00:25:04 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-11-05 15:32:30 -0500 |
commit | 799e2324901c2a06e9a60ee281cd283475f1c4fa (patch) | |
tree | 1f5c7c0c6057122ad02968ab54b8a52b1131a997 /libavcodec/flacdsp.c | |
parent | 5ff998a233d759d0de83ea6f95c383d03d25d88e (diff) | |
download | ffmpeg-799e2324901c2a06e9a60ee281cd283475f1c4fa.tar.gz |
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.
Diffstat (limited to 'libavcodec/flacdsp.c')
-rw-r--r-- | libavcodec/flacdsp.c | 9 |
1 files changed, 7 insertions, 2 deletions
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: |