diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-07 02:17:30 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-07 02:17:30 +0200 |
commit | 46a47077eee2d7755e17f6557903f383cdfe1b8b (patch) | |
tree | 2f42fe2b5bcd4f3e71a24bc9126ce73ecc665a74 /libavcodec/flacdsp.c | |
parent | a6da14ec3cbe009b2f6fe3eaaa4865e8c8f5ef1a (diff) | |
parent | 5adc829eb0787682111ca063bfc2b31558999dff (diff) | |
download | ffmpeg-46a47077eee2d7755e17f6557903f383cdfe1b8b.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
configure: add functions for testing code fragments
af_amix: avoid spurious EAGAIN.
af_amix: return AVERROR(EAGAIN) when request_frame didn't produce output.
af_amix: only consider negative return codes as errors.
avconv: use only meaningful timestamps in start time check.
avconv: fix the check for -ss as an output option.
mss3: add forgotten 'static' qualifier for private table
lavc: options: add planar names for request_sample_fmt
flacdec: add planar output support
flvdec: Treat all nellymoser versions as the same codec
Conflicts:
ffmpeg.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/flacdsp.c')
-rw-r--r-- | libavcodec/flacdsp.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/libavcodec/flacdsp.c b/libavcodec/flacdsp.c index 6c90e89d9b..bb2a920a72 100644 --- a/libavcodec/flacdsp.c +++ b/libavcodec/flacdsp.c @@ -23,10 +23,21 @@ #include "flacdsp.h" #define SAMPLE_SIZE 16 +#define PLANAR 0 +#include "flacdsp_template.c" + +#undef PLANAR +#define PLANAR 1 #include "flacdsp_template.c" #undef SAMPLE_SIZE +#undef PLANAR #define SAMPLE_SIZE 32 +#define PLANAR 0 +#include "flacdsp_template.c" + +#undef PLANAR +#define PLANAR 1 #include "flacdsp_template.c" static void flac_lpc_16_c(int32_t *decoded, const int coeffs[32], @@ -72,15 +83,27 @@ static void flac_lpc_32_c(int32_t *decoded, const int coeffs[32], } -av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt) +av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, + int bps) { + if (bps > 16) + c->lpc = flac_lpc_32_c; + else + c->lpc = flac_lpc_16_c; + switch (fmt) { case AV_SAMPLE_FMT_S32: c->decorrelate[0] = flac_decorrelate_indep_c_32; c->decorrelate[1] = flac_decorrelate_ls_c_32; c->decorrelate[2] = flac_decorrelate_rs_c_32; c->decorrelate[3] = flac_decorrelate_ms_c_32; - c->lpc = flac_lpc_32_c; + break; + + case AV_SAMPLE_FMT_S32P: + c->decorrelate[0] = flac_decorrelate_indep_c_32p; + c->decorrelate[1] = flac_decorrelate_ls_c_32p; + c->decorrelate[2] = flac_decorrelate_rs_c_32p; + c->decorrelate[3] = flac_decorrelate_ms_c_32p; break; case AV_SAMPLE_FMT_S16: @@ -88,7 +111,13 @@ av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt) c->decorrelate[1] = flac_decorrelate_ls_c_16; c->decorrelate[2] = flac_decorrelate_rs_c_16; c->decorrelate[3] = flac_decorrelate_ms_c_16; - c->lpc = flac_lpc_16_c; + break; + + case AV_SAMPLE_FMT_S16P: + c->decorrelate[0] = flac_decorrelate_indep_c_16p; + c->decorrelate[1] = flac_decorrelate_ls_c_16p; + c->decorrelate[2] = flac_decorrelate_rs_c_16p; + c->decorrelate[3] = flac_decorrelate_ms_c_16p; break; } } |