diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-09 02:58:59 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-09 02:59:49 +0100 |
commit | 4354788a893d3633cb9f94932b4c075377a4b324 (patch) | |
tree | b72774c0284514532dcebd447fc637cb5e573a60 | |
parent | 0827222b9cecc3bb07b07059716b81f644db9dcc (diff) | |
parent | f38f3b88a5a74d0573dc299a512a87f6d579323b (diff) | |
download | ffmpeg-4354788a893d3633cb9f94932b4c075377a4b324.tar.gz |
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>
-rw-r--r-- | doc/git-howto.txt | 17 | ||||
-rw-r--r-- | ffplay.c | 2 | ||||
-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 | ||||
-rw-r--r-- | libavformat/avformat.h | 49 | ||||
-rw-r--r-- | libavformat/mxfdec.c | 2 | ||||
-rw-r--r-- | libavformat/tls.c | 2 |
20 files changed, 107 insertions, 53 deletions
diff --git a/doc/git-howto.txt b/doc/git-howto.txt index 72cde72eed..06aee44501 100644 --- a/doc/git-howto.txt +++ b/doc/git-howto.txt @@ -205,8 +205,19 @@ I. BASICS: git format-patch <commit> [-o directory] - will generate a set of patches out of the current branch starting from - commit. By default the patches are created in the current directory. + will generate a set of patches for each commit between <commit> and + current HEAD. E.g. + + git format-patch origin/master + + will generate patches for all commits on current branch which are not + present in upstream. + A useful shortcut is also + + git format-patch -n + + which will generate patches from last n commits. + By default the patches are created in the current directory. 11. Sending patches for review @@ -215,6 +226,8 @@ I. BASICS: will send the patches created by git format-patch or directly generates them. All the email fields can be configured in the global/local configuration or overridden by command line. + Note that this tool must often be installed separately (e.g. git-email + package on Debian-based distros). 12. Pushing changes to remote trees @@ -2348,6 +2348,8 @@ static void stream_component_close(VideoState *is, int stream_index) if (is->rdft) { av_rdft_end(is->rdft); av_freep(&is->rdft_data); + is->rdft = NULL; + is->rdft_bits = 0; } break; case AVMEDIA_TYPE_VIDEO: 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. diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 1b0229daee..cf0dae9c32 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -765,17 +765,56 @@ typedef struct AVChapter { * New fields can be added to the end with minor version bumps. * Removal, reordering and changes to existing fields require a major * version bump. - * sizeof(AVFormatContext) must not be used outside libav*. + * sizeof(AVFormatContext) must not be used outside libav*, use + * avformat_alloc_context() to create an AVFormatContext. */ typedef struct AVFormatContext { - const AVClass *av_class; /**< Set by avformat_alloc_context. */ - /* Can only be iformat or oformat, not both at the same time. */ + /** + * A class for logging and AVOptions. Set by avformat_alloc_context(). + * Exports (de)muxer private options if they exist. + */ + const AVClass *av_class; + + /** + * Can only be iformat or oformat, not both at the same time. + * + * decoding: set by avformat_open_input(). + * encoding: set by the user. + */ struct AVInputFormat *iformat; struct AVOutputFormat *oformat; + + /** + * Format private data. This is an AVOptions-enabled struct + * if and only if iformat/oformat.priv_class is not NULL. + */ void *priv_data; + + /* + * I/O context. + * + * decoding: either set by the user before avformat_open_input() (then + * the user must close it manually) or set by avformat_open_input(). + * encoding: set by the user. + * + * Do NOT set this field if AVFMT_NOFILE flag is set in + * iformat/oformat.flags. In such a case, the (de)muxer will handle + * I/O in some other way and this field will be NULL. + */ AVIOContext *pb; + + /** + * A list of all streams in the file. New streams are created with + * avformat_new_stream(). + * + * decoding: streams are created by libavformat in avformat_open_input(). + * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also + * appear in av_read_frame(). + * encoding: streams are created by the user before avformat_write_header(). + */ unsigned int nb_streams; AVStream **streams; + char filename[1024]; /**< input or output filename */ /* stream info */ #if FF_API_TIMESTAMP @@ -886,8 +925,8 @@ typedef struct AVFormatContext { unsigned int probesize; /** - * Maximum time (in AV_TIME_BASE units) during which the input should - * be analyzed in av_find_stream_info(). + * decoding: maximum time (in AV_TIME_BASE units) during which the input should + * be analyzed in avformat_find_stream_info(). */ int max_analyze_duration; diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index efc4bd1aef..d940649c6a 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -283,7 +283,7 @@ static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket *pkt, KLVPacket *klv MXFContext *mxf = s->priv_data; AVIOContext *pb = s->pb; int64_t end = avio_tell(pb) + klv->length; - uint64_t size; + int64_t size; uint64_t orig_size; uint64_t plaintext_size; uint8_t ivec[16]; diff --git a/libavformat/tls.c b/libavformat/tls.c index 85bf46f903..bd73febd4d 100644 --- a/libavformat/tls.c +++ b/libavformat/tls.c @@ -87,7 +87,7 @@ static int do_tls_poll(URLContext *h, int ret) } else if (ret == SSL_ERROR_WANT_WRITE) { p.events = POLLOUT; } else { - av_log(NULL, AV_LOG_ERROR, "%s\n", ERR_error_string(ret, NULL)); + av_log(NULL, AV_LOG_ERROR, "%s\n", ERR_error_string(ERR_get_error(), NULL)); return AVERROR(EIO); } #endif |