diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-05-17 04:47:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-17 04:51:33 +0200 |
commit | f8ae3a2108b612776e886d927b4a7289dde619f1 (patch) | |
tree | c10fc78e3c6340c9513f99faadf077ee6c7d2986 /libavcodec/dct.c | |
parent | e6e7ba0ce3aadef32f7f16f706c4a0406b5bd70f (diff) | |
parent | 901ff51116f831c9082e14c80c7481dd3999aa30 (diff) | |
download | ffmpeg-f8ae3a2108b612776e886d927b4a7289dde619f1.tar.gz |
Merge remote branch 'qatar/master'
12 files changed, 36 insertions(+), 81 deletions(-)
yes thats 36 new lines in 14 commits
* qatar/master:
ffmpeg: fix -aspect cli option
Restructure video filter implementation in ffmpeg.c.
ffplay: remove audio_write_get_buf_size() forward declaration
lavfi: print key-frame and picture type information in ff_dlog_ref()
mathops: remove ancient confusing comment
cws2fws: Improve error message wording.
tools: Check the return value of write().
mpegaudio: move OUT_FMT macro to mpegaudiodec.c
mpegaudio: remove OUT_MIN/MAX macros
Add missing #includes to mp3_header_(de)compress bsf
dct: fix indentation
dct: bypass table allocation for DCT_II of size 32
h264dsp_mmx: Add #ifdefs around some mmxext functions on x86_64.
Remove unused header mpegaudio3.h.
Conflicts:
ffmpeg.c
libavcodec/mpegaudio.h
libavcodec/mpegaudio3.h
libavfilter/avfilter.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dct.c')
-rw-r--r-- | libavcodec/dct.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/libavcodec/dct.c b/libavcodec/dct.c index 83cf1b4896..ef3cd50a79 100644 --- a/libavcodec/dct.c +++ b/libavcodec/dct.c @@ -180,33 +180,36 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse) int n = 1 << nbits; int i; + memset(s, 0, sizeof(*s)); + s->nbits = nbits; s->inverse = inverse; - ff_init_ff_cos_tabs(nbits+2); + if (inverse == DCT_II && nbits == 5) { + s->dct_calc = dct32_func; + } else { + ff_init_ff_cos_tabs(nbits+2); - s->costab = ff_cos_tabs[nbits+2]; + s->costab = ff_cos_tabs[nbits+2]; - s->csc2 = av_malloc(n/2 * sizeof(FFTSample)); + s->csc2 = av_malloc(n/2 * sizeof(FFTSample)); - if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) { - av_free(s->csc2); - return -1; - } + if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) { + av_free(s->csc2); + return -1; + } - for (i = 0; i < n/2; i++) - s->csc2[i] = 0.5 / sin((M_PI / (2*n) * (2*i + 1))); + for (i = 0; i < n/2; i++) + s->csc2[i] = 0.5 / sin((M_PI / (2*n) * (2*i + 1))); - switch(inverse) { - case DCT_I : s->dct_calc = ff_dct_calc_I_c; break; - case DCT_II : s->dct_calc = ff_dct_calc_II_c ; break; - case DCT_III: s->dct_calc = ff_dct_calc_III_c; break; - case DST_I : s->dct_calc = ff_dst_calc_I_c; break; + switch(inverse) { + case DCT_I : s->dct_calc = ff_dct_calc_I_c; break; + case DCT_II : s->dct_calc = ff_dct_calc_II_c ; break; + case DCT_III: s->dct_calc = ff_dct_calc_III_c; break; + case DST_I : s->dct_calc = ff_dst_calc_I_c; break; + } } - if (inverse == DCT_II && nbits == 5) - s->dct_calc = dct32_func; - s->dct32 = dct32; if (HAVE_MMX) ff_dct_init_mmx(s); |