diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-09 05:58:59 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-09 05:59:49 +0400 |
commit | 4354788a893d3633cb9f94932b4c075377a4b324 (patch) | |
tree | b72774c0284514532dcebd447fc637cb5e573a60 /libavcodec | |
parent | 0827222b9cecc3bb07b07059716b81f644db9dcc (diff) | |
parent | f38f3b88a5a74d0573dc299a512a87f6d579323b (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
tls: Use ERR_get_error() in do_tls_poll
indeo3: Fix a fencepost error.
mxfdec: Fix comparison of unsigned expression < 0.
mpegts: set stream id on just created stream, not an unrelated variable
ra288: return error if input buffer is too small
ra288: utilize DSPContext.vector_fmul()
ra288: use memcpy() to copy decoded samples to output
mace: only calculate output buffer size once
Remove redundant filename self-references inside files.
indeo3data: add missing config.h #include for HAVE_BIGENDIAN
x86: drop pointless ARCH_X86 #ifdef from files in x86 subdirectory
avplay: reset rdft when closing stream.
doc/git-howto: expand format-patch and send-email notes.
lavf: expand doxy for some AVFormatContext fields.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/arm/simple_idct_arm.S | 1 | ||||
-rw-r--r-- | libavcodec/indeo3.c | 2 | ||||
-rw-r--r-- | libavcodec/indeo3data.h | 2 | ||||
-rw-r--r-- | libavcodec/jfdctfst.c | 2 | ||||
-rw-r--r-- | libavcodec/jfdctint_template.c | 2 | ||||
-rw-r--r-- | libavcodec/jrevdct.c | 2 | ||||
-rw-r--r-- | libavcodec/libdirac.h | 2 | ||||
-rw-r--r-- | libavcodec/libschroedinger.c | 2 | ||||
-rw-r--r-- | libavcodec/libschroedinger.h | 2 | ||||
-rw-r--r-- | libavcodec/mace.c | 11 | ||||
-rw-r--r-- | libavcodec/ra288.c | 42 | ||||
-rw-r--r-- | libavcodec/ra288.h | 9 | ||||
-rw-r--r-- | libavcodec/x86/cabac.h | 4 | ||||
-rw-r--r-- | libavcodec/x86/h264_i386.h | 4 | ||||
-rw-r--r-- | libavcodec/x86/idct_mmx.c | 1 |
15 files changed, 44 insertions, 44 deletions
diff --git a/libavcodec/arm/simple_idct_arm.S b/libavcodec/arm/simple_idct_arm.S index 990dde6ff7..f85c89a1b7 100644 --- a/libavcodec/arm/simple_idct_arm.S +++ b/libavcodec/arm/simple_idct_arm.S @@ -1,5 +1,4 @@ /* - * simple_idct_arm.S * Copyright (C) 2002 Frederic 'dilb' Boulay * * Author: Frederic Boulay <dilb@handhelds.org> diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 6d3c3cc775..a5146e8b87 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -444,7 +444,7 @@ static int decode_cell_data(Cell *cell, uint8_t *block, uint8_t *ref_block, BUFFER_PRECHECK; dyad1 = bytestream_get_byte(data_ptr); dyad2 = code; - if (dyad1 > delta_tab->num_dyads || dyad1 >= 248) + if (dyad1 >= delta_tab->num_dyads || dyad1 >= 248) return IV3_BAD_DATA; } else { /* process QUADS */ diff --git a/libavcodec/indeo3data.h b/libavcodec/indeo3data.h index 8109f70df2..15b9d9a9da 100644 --- a/libavcodec/indeo3data.h +++ b/libavcodec/indeo3data.h @@ -24,6 +24,8 @@ #include <stdint.h> +#include "config.h" + /* * Define compressed VQ tables. */ diff --git a/libavcodec/jfdctfst.c b/libavcodec/jfdctfst.c index 8d3448a676..b8dc407f7b 100644 --- a/libavcodec/jfdctfst.c +++ b/libavcodec/jfdctfst.c @@ -1,6 +1,4 @@ /* - * jfdctfst.c - * * This file is part of the Independent JPEG Group's software. * * The authors make NO WARRANTY or representation, either express or implied, diff --git a/libavcodec/jfdctint_template.c b/libavcodec/jfdctint_template.c index e60e72a412..02b6f09381 100644 --- a/libavcodec/jfdctint_template.c +++ b/libavcodec/jfdctint_template.c @@ -1,6 +1,4 @@ /* - * jfdctint.c - * * This file is part of the Independent JPEG Group's software. * * The authors make NO WARRANTY or representation, either express or implied, diff --git a/libavcodec/jrevdct.c b/libavcodec/jrevdct.c index 9e28daeae6..5ed96da2ca 100644 --- a/libavcodec/jrevdct.c +++ b/libavcodec/jrevdct.c @@ -1,6 +1,4 @@ /* - * jrevdct.c - * * This file is part of the Independent JPEG Group's software. * * The authors make NO WARRANTY or representation, either express or implied, diff --git a/libavcodec/libdirac.h b/libavcodec/libdirac.h index abea0ca492..388674eb0d 100644 --- a/libavcodec/libdirac.h +++ b/libavcodec/libdirac.h @@ -20,7 +20,7 @@ /** * @file -* data structures common to libdiracenc.c and libdiracdec.c +* data structures common to libdirac encoder and decoder */ #ifndef AVCODEC_LIBDIRAC_H diff --git a/libavcodec/libschroedinger.c b/libavcodec/libschroedinger.c index 7dc49f3a92..a2ea5ddbdc 100644 --- a/libavcodec/libschroedinger.c +++ b/libavcodec/libschroedinger.c @@ -20,7 +20,7 @@ /** * @file -* function definitions common to libschroedingerdec.c and libschroedingerenc.c +* function definitions common to libschroedinger decoder and encoder */ #include "libdirac_libschro.h" diff --git a/libavcodec/libschroedinger.h b/libavcodec/libschroedinger.h index dc3ba1815e..262e0220bf 100644 --- a/libavcodec/libschroedinger.h +++ b/libavcodec/libschroedinger.h @@ -20,7 +20,7 @@ /** * @file -* data structures common to libschroedingerdec.c and libschroedingerenc.c +* data structures common to libschroedinger decoder and encoder */ #ifndef AVCODEC_LIBSCHROEDINGER_H diff --git a/libavcodec/mace.c b/libavcodec/mace.c index 67288b82fd..980ebb9027 100644 --- a/libavcodec/mace.c +++ b/libavcodec/mace.c @@ -243,11 +243,14 @@ static int mace_decode_frame(AVCodecContext *avctx, int16_t *samples = data; MACEContext *ctx = avctx->priv_data; int i, j, k, l; + int out_size; int is_mace3 = (avctx->codec_id == CODEC_ID_MACE3); - if (*data_size < (3 * buf_size << (2-is_mace3))) { - av_log(avctx, AV_LOG_ERROR, "Output buffer too small!\n"); - return -1; + out_size = 3 * (buf_size << (1 - is_mace3)) * + av_get_bytes_per_sample(avctx->sample_fmt); + if (*data_size < out_size) { + av_log(avctx, AV_LOG_ERROR, "Output buffer is too small\n"); + return AVERROR(EINVAL); } for(i = 0; i < avctx->channels; i++) { @@ -274,7 +277,7 @@ static int mace_decode_frame(AVCodecContext *avctx, } } - *data_size = 3 * buf_size << (2-is_mace3); + *data_size = out_size; return buf_size; } diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index 620c711526..e22d7ee675 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -26,6 +26,7 @@ #include "lpc.h" #include "celp_math.h" #include "celp_filters.h" +#include "dsputil.h" #define MAX_BACKWARD_FILTER_ORDER 36 #define MAX_BACKWARD_FILTER_LEN 40 @@ -35,8 +36,9 @@ #define RA288_BLOCKS_PER_FRAME 32 typedef struct { - float sp_lpc[36]; ///< LPC coefficients for speech data (spec: A) - float gain_lpc[10]; ///< LPC coefficients for gain (spec: GB) + DSPContext dsp; + DECLARE_ALIGNED(16, float, sp_lpc)[FFALIGN(36, 8)]; ///< LPC coefficients for speech data (spec: A) + DECLARE_ALIGNED(16, float, gain_lpc)[FFALIGN(10, 8)]; ///< LPC coefficients for gain (spec: GB) /** speech data history (spec: SB). * Its first 70 coefficients are updated only at backward filtering. @@ -57,16 +59,12 @@ typedef struct { static av_cold int ra288_decode_init(AVCodecContext *avctx) { + RA288Context *ractx = avctx->priv_data; avctx->sample_fmt = AV_SAMPLE_FMT_FLT; + dsputil_init(&ractx->dsp, avctx); return 0; } -static void apply_window(float *tgt, const float *m1, const float *m2, int n) -{ - while (n--) - *tgt++ = *m1++ * *m2++; -} - static void convolve(float *tgt, const float *src, int len, int n) { for (; n >= 0; n--) @@ -123,15 +121,18 @@ static void decode(RA288Context *ractx, float gain, int cb_coef) * @param out2 pointer to the recursive part of the output * @param window pointer to the windowing function table */ -static void do_hybrid_window(int order, int n, int non_rec, float *out, +static void do_hybrid_window(RA288Context *ractx, + int order, int n, int non_rec, float *out, float *hist, float *out2, const float *window) { int i; float buffer1[MAX_BACKWARD_FILTER_ORDER + 1]; float buffer2[MAX_BACKWARD_FILTER_ORDER + 1]; - float work[MAX_BACKWARD_FILTER_ORDER + MAX_BACKWARD_FILTER_LEN + MAX_BACKWARD_FILTER_NONREC]; + LOCAL_ALIGNED_16(float, work)[FFALIGN(MAX_BACKWARD_FILTER_ORDER + + MAX_BACKWARD_FILTER_LEN + + MAX_BACKWARD_FILTER_NONREC, 8)]; - apply_window(work, window, hist, order + n + non_rec); + ractx->dsp.vector_fmul(work, window, hist, FFALIGN(order + n + non_rec, 8)); convolve(buffer1, work + order , n , order); convolve(buffer2, work + order + n, non_rec, order); @@ -148,16 +149,17 @@ static void do_hybrid_window(int order, int n, int non_rec, float *out, /** * Backward synthesis filter, find the LPC coefficients from past speech data. */ -static void backward_filter(float *hist, float *rec, const float *window, +static void backward_filter(RA288Context *ractx, + float *hist, float *rec, const float *window, float *lpc, const float *tab, int order, int n, int non_rec, int move_size) { float temp[MAX_BACKWARD_FILTER_ORDER+1]; - do_hybrid_window(order, n, non_rec, temp, hist, rec, window); + do_hybrid_window(ractx, order, n, non_rec, temp, hist, rec, window); if (!compute_lpc_coefs(temp, order, lpc, 0, 1, 1)) - apply_window(lpc, lpc, tab, order); + ractx->dsp.vector_fmul(lpc, lpc, tab, FFALIGN(order, 8)); memmove(hist, hist + n, move_size*sizeof(*hist)); } @@ -168,7 +170,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data, const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; float *out = data; - int i, j, out_size; + int i, out_size; RA288Context *ractx = avctx->priv_data; GetBitContext gb; @@ -176,7 +178,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data, av_log(avctx, AV_LOG_ERROR, "Error! Input buffer is too small [%d<%d]\n", buf_size, avctx->block_align); - return 0; + return AVERROR_INVALIDDATA; } out_size = RA288_BLOCK_SIZE * RA288_BLOCKS_PER_FRAME * @@ -194,14 +196,14 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data, decode(ractx, gain, cb_coef); - for (j=0; j < RA288_BLOCK_SIZE; j++) - *(out++) = ractx->sp_hist[70 + 36 + j]; + memcpy(out, &ractx->sp_hist[70 + 36], RA288_BLOCK_SIZE * sizeof(*out)); + out += RA288_BLOCK_SIZE; if ((i & 7) == 3) { - backward_filter(ractx->sp_hist, ractx->sp_rec, syn_window, + backward_filter(ractx, ractx->sp_hist, ractx->sp_rec, syn_window, ractx->sp_lpc, syn_bw_tab, 36, 40, 35, 70); - backward_filter(ractx->gain_hist, ractx->gain_rec, gain_window, + backward_filter(ractx, ractx->gain_hist, ractx->gain_rec, gain_window, ractx->gain_lpc, gain_bw_tab, 10, 8, 20, 28); } } diff --git a/libavcodec/ra288.h b/libavcodec/ra288.h index d7fd4b54f9..769e30ec17 100644 --- a/libavcodec/ra288.h +++ b/libavcodec/ra288.h @@ -23,6 +23,7 @@ #define AVCODEC_RA288_H #include <stdint.h> +#include "dsputil.h" static const float amptable[8]={ 0.515625, 0.90234375, 1.57910156, 2.76342773, @@ -96,7 +97,7 @@ static const int16_t codetable[128][5]={ { 3746, -606, 53, -269, -3301}, { 606, 2018, -1316, 4064, 398} }; -static const float syn_window[111]={ +DECLARE_ALIGNED(16, static const float, syn_window)[FFALIGN(111, 8)]={ 0.576690972, 0.580838025, 0.585013986, 0.589219987, 0.59345597, 0.597723007, 0.602020264, 0.606384277, 0.610748291, 0.615142822, 0.619598389, 0.624084473, 0.628570557, 0.633117676, 0.637695313, 0.642272949, 0.646911621, 0.651580811, @@ -118,7 +119,7 @@ static const float syn_window[111]={ 0.142852783, 0.0954284668,0.0477600098 }; -static const float gain_window[38]={ +DECLARE_ALIGNED(16, static const float, gain_window)[FFALIGN(38, 8)]={ 0.505699992, 0.524200022, 0.54339999, 0.563300014, 0.583953857, 0.60534668, 0.627502441, 0.650482178, 0.674316406, 0.699005127, 0.724578857, 0.75112915, 0.778625488, 0.807128906, 0.836669922, 0.86730957, 0.899078369, 0.932006836, @@ -129,7 +130,7 @@ static const float gain_window[38]={ }; /** synthesis bandwidth broadening table */ -static const float syn_bw_tab[36]={ +DECLARE_ALIGNED(16, static const float, syn_bw_tab)[FFALIGN(36, 8)] = { 0.98828125, 0.976699829, 0.965254128, 0.953942537, 0.942763507, 0.931715488, 0.920796931, 0.910006344, 0.899342179, 0.888803005, 0.878387332, 0.868093729, 0.857920766, 0.847867012, 0.837931097, 0.828111589, 0.818407178, 0.808816493, @@ -139,7 +140,7 @@ static const float syn_bw_tab[36]={ }; /** gain bandwidth broadening table */ -static const float gain_bw_tab[10]={ +DECLARE_ALIGNED(16, static const float, gain_bw_tab)[FFALIGN(10, 8)] = { 0.90625, 0.821289063, 0.74432373, 0.674499512, 0.61126709, 0.553955078, 0.50201416, 0.454956055, 0.41229248, 0.373657227 }; diff --git a/libavcodec/x86/cabac.h b/libavcodec/x86/cabac.h index 5c46342808..33304ab0f4 100644 --- a/libavcodec/x86/cabac.h +++ b/libavcodec/x86/cabac.h @@ -82,7 +82,7 @@ "add "tmp" , "low" \n\t"\ "1: \n\t" -#if ARCH_X86 && HAVE_7REGS && !defined(BROKEN_RELOCATIONS) +#if HAVE_7REGS && !defined(BROKEN_RELOCATIONS) #define get_cabac_inline get_cabac_inline_x86 static av_always_inline int get_cabac_inline_x86(CABACContext *c, uint8_t *const state) @@ -105,7 +105,7 @@ static av_always_inline int get_cabac_inline_x86(CABACContext *c, ); return bit & 1; } -#endif /* ARCH_X86 && HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */ +#endif /* HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */ #define get_cabac_bypass_sign get_cabac_bypass_sign_x86 static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val) diff --git a/libavcodec/x86/h264_i386.h b/libavcodec/x86/h264_i386.h index 8ea430a82a..84da48d2e2 100644 --- a/libavcodec/x86/h264_i386.h +++ b/libavcodec/x86/h264_i386.h @@ -36,7 +36,7 @@ //FIXME use some macros to avoid duplicating get_cabac (cannot be done yet //as that would make optimization work hard) -#if ARCH_X86 && HAVE_7REGS && !defined(BROKEN_RELOCATIONS) +#if HAVE_7REGS && !defined(BROKEN_RELOCATIONS) static int decode_significance_x86(CABACContext *c, int max_coeff, uint8_t *significant_coeff_ctx_base, int *index, x86_reg last_off){ @@ -145,6 +145,6 @@ static int decode_significance_8x8_x86(CABACContext *c, ); return coeff_count; } -#endif /* ARCH_X86 && HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */ +#endif /* HAVE_7REGS && !defined(BROKEN_RELOCATIONS) */ #endif /* AVCODEC_X86_H264_I386_H */ diff --git a/libavcodec/x86/idct_mmx.c b/libavcodec/x86/idct_mmx.c index 57fa81892d..ed2d3217e5 100644 --- a/libavcodec/x86/idct_mmx.c +++ b/libavcodec/x86/idct_mmx.c @@ -1,5 +1,4 @@ /* - * idct_mmx.c * Copyright (C) 1999-2001 Aaron Holtzman <aholtzma@ess.engr.uvic.ca> * * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. |