diff --git a/COPYING.LGPLv2.1 b/COPYING.LGPLv2.1 index 00b4fedfe7..58af0d3787 100644 --- a/COPYING.LGPLv2.1 +++ b/COPYING.LGPLv2.1 @@ -500,5 +500,3 @@ necessary. Here is a sample; alter the names: Ty Coon, President of Vice That's all there is to it! - - diff --git a/doc/fate.texi b/doc/fate.texi index acb4bfe6a1..1612bdf1e0 100644 --- a/doc/fate.texi +++ b/doc/fate.texi @@ -171,4 +171,4 @@ the synchronisation of the samples directory. Example: @example make V=1 SAMPLES=/var/fate/samples THREADS=2 fate -@end example +@end example \ No newline at end of file diff --git a/doc/ffserver.conf b/doc/ffserver.conf index 217117005c..d10ac5bc09 100644 --- a/doc/ffserver.conf +++ b/doc/ffserver.conf @@ -373,5 +373,3 @@ ACL allow 192.168.0.0 192.168.255.255 URL http://www.ffmpeg.org/ - - diff --git a/doc/filters.texi b/doc/filters.texi index 938a5e1704..12b551cf2e 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -3365,4 +3365,3 @@ mainly useful as a template and to be employed in analysis / debugging tools. @c man end VIDEO SINKS - diff --git a/doc/swscale.txt b/doc/swscale.txt index 4c62e67321..0dc4b8a5af 100644 --- a/doc/swscale.txt +++ b/doc/swscale.txt @@ -96,4 +96,3 @@ would benefit from it. Also, as already hinted at, initFilter() accepts an optional convolutional filter as input that can be used for contrast, saturation, blur, sharpening shift, chroma vs. luma shift, ... - diff --git a/doc/viterbi.txt b/doc/viterbi.txt index d9d924f621..5362a0b765 100644 --- a/doc/viterbi.txt +++ b/doc/viterbi.txt @@ -107,4 +107,3 @@ one with score 3) Author: Michael niedermayer Copyright LGPL - diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 27372f3b9a..7ff6975da1 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -747,7 +747,7 @@ HOSTPROGS = aac_tablegen aacps_tablegen cbrt_tablegen cos_tablegen \ dv_tablegen motionpixels_tablegen mpegaudio_tablegen \ pcm_tablegen qdm2_tablegen sinewin_tablegen -DIRS = alpha arm bfin ppc ps2 sh4 sparc x86 +DIRS = alpha arm avr32 bfin ppc ps2 sh4 sparc x86 CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF) diff --git a/libavcodec/arm/vp8.h b/libavcodec/arm/vp8.h index d3fce4cafe..5a7b142690 100644 --- a/libavcodec/arm/vp8.h +++ b/libavcodec/arm/vp8.h @@ -19,6 +19,8 @@ #ifndef AVCODEC_ARM_VP8_H #define AVCODEC_ARM_VP8_H +#include "config.h" + #if HAVE_ARMV6 #define decode_block_coeffs_internal ff_decode_block_coeffs_armv6 int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, DCTELEM block[16], diff --git a/libavcodec/bfin/dsputil_bfin.c b/libavcodec/bfin/dsputil_bfin.c index bfcc337388..2132d08cdb 100644 --- a/libavcodec/bfin/dsputil_bfin.c +++ b/libavcodec/bfin/dsputil_bfin.c @@ -270,6 +270,3 @@ void dsputil_init_bfin( DSPContext* c, AVCodecContext *avctx ) } } } - - - diff --git a/libavcodec/bfin/fdct_bfin.S b/libavcodec/bfin/fdct_bfin.S index 0eac7a3042..e15acb654f 100644 --- a/libavcodec/bfin/fdct_bfin.S +++ b/libavcodec/bfin/fdct_bfin.S @@ -330,4 +330,3 @@ DEFUN(fdct,mL1, (r7:4,p5:3) = [sp++]; RTS; DEFUN_END(fdct) - diff --git a/libavcodec/bfin/idct_bfin.S b/libavcodec/bfin/idct_bfin.S index 04f9159d8d..66430096f0 100644 --- a/libavcodec/bfin/idct_bfin.S +++ b/libavcodec/bfin/idct_bfin.S @@ -302,5 +302,3 @@ DEFUN(idct,mL1, unlink; RTS; DEFUN_END(idct) - - diff --git a/libavcodec/bfin/mpegvideo_bfin.c b/libavcodec/bfin/mpegvideo_bfin.c index 996290a52d..2f819271f6 100644 --- a/libavcodec/bfin/mpegvideo_bfin.c +++ b/libavcodec/bfin/mpegvideo_bfin.c @@ -150,4 +150,3 @@ void MPV_common_init_bfin (MpegEncContext *s) { /* s->dct_quantize= dct_quantize_bfin; */ } - diff --git a/libavcodec/bfin/pixels_bfin.S b/libavcodec/bfin/pixels_bfin.S index 69b493b647..1fc93f9a47 100644 --- a/libavcodec/bfin/pixels_bfin.S +++ b/libavcodec/bfin/pixels_bfin.S @@ -737,5 +737,3 @@ DEFUN(sse16,mL1, unlink; rts; DEFUN_END(sse16) - - diff --git a/libavcodec/bfin/vp3_bfin.c b/libavcodec/bfin/vp3_bfin.c index dfe34c5b3e..6d6ac82636 100644 --- a/libavcodec/bfin/vp3_bfin.c +++ b/libavcodec/bfin/vp3_bfin.c @@ -41,5 +41,3 @@ void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, DCTELEM *block) ff_bfin_vp3_idct (block); ff_bfin_add_pixels_clamped (block, dest, line_size); } - - diff --git a/libavcodec/bfin/vp3_idct_bfin.S b/libavcodec/bfin/vp3_idct_bfin.S index 21f732c58d..83747f9fcd 100644 --- a/libavcodec/bfin/vp3_idct_bfin.S +++ b/libavcodec/bfin/vp3_idct_bfin.S @@ -278,5 +278,3 @@ DEFUN(vp3_idct,mL1, unlink; RTS; DEFUN_END(vp3_idct) - - diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h index d315e3f818..cba2dbb22d 100644 --- a/libavcodec/bytestream.h +++ b/libavcodec/bytestream.h @@ -24,6 +24,7 @@ #define AVCODEC_BYTESTREAM_H #include + #include "libavutil/common.h" #include "libavutil/intreadwrite.h" @@ -36,46 +37,52 @@ typedef struct { int eof; } PutByteContext; -#define DEF_T(type, name, bytes, read, write) \ -static av_always_inline type bytestream_get_ ## name(const uint8_t **b){\ - (*b) += bytes;\ - return read(*b - bytes);\ -}\ -static av_always_inline void bytestream_put_ ##name(uint8_t **b, const type value){\ - write(*b, value);\ - (*b) += bytes;\ -}\ -static av_always_inline void bytestream2_put_ ## name ## u(PutByteContext *p, const type value)\ -{\ - bytestream_put_ ## name(&p->buffer, value);\ -}\ -static av_always_inline void bytestream2_put_ ## name(PutByteContext *p, const type value){\ - if (!p->eof && (p->buffer_end - p->buffer >= bytes)) {\ - write(p->buffer, value);\ - p->buffer += bytes;\ - } else\ - p->eof = 1;\ -}\ -static av_always_inline type bytestream2_get_ ## name ## u(GetByteContext *g)\ -{\ - return bytestream_get_ ## name(&g->buffer);\ -}\ -static av_always_inline type bytestream2_get_ ## name(GetByteContext *g)\ -{\ - if (g->buffer_end - g->buffer < bytes)\ - return 0;\ - return bytestream2_get_ ## name ## u(g);\ -}\ -static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g)\ -{\ - if (g->buffer_end - g->buffer < bytes)\ - return 0;\ - return read(g->buffer);\ +#define DEF_T(type, name, bytes, read, write) \ +static av_always_inline type bytestream_get_ ## name(const uint8_t **b) \ +{ \ + (*b) += bytes; \ + return read(*b - bytes); \ +} \ +static av_always_inline void bytestream_put_ ## name(uint8_t **b, \ + const type value) \ +{ \ + write(*b, value); \ + (*b) += bytes; \ +} \ +static av_always_inline void bytestream2_put_ ## name ## u(PutByteContext *p, \ + const type value) \ +{ \ + bytestream_put_ ## name(&p->buffer, value); \ +} \ +static av_always_inline void bytestream2_put_ ## name(PutByteContext *p, \ + const type value) \ +{ \ + if (!p->eof && (p->buffer_end - p->buffer >= bytes)) { \ + write(p->buffer, value); \ + p->buffer += bytes; \ + } else \ + p->eof = 1; \ +} \ +static av_always_inline type bytestream2_get_ ## name ## u(GetByteContext *g) \ +{ \ + return bytestream_get_ ## name(&g->buffer); \ +} \ +static av_always_inline type bytestream2_get_ ## name(GetByteContext *g) \ +{ \ + if (g->buffer_end - g->buffer < bytes) \ + return 0; \ + return bytestream2_get_ ## name ## u(g); \ +} \ +static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \ +{ \ + if (g->buffer_end - g->buffer < bytes) \ + return 0; \ + return read(g->buffer); \ } -#define DEF(name, bytes, read, write) \ +#define DEF(name, bytes, read, write) \ DEF_T(unsigned int, name, bytes, read, write) -#define DEF64(name, bytes, read, write) \ +#define DEF64(name, bytes, read, write) \ DEF_T(uint64_t, name, bytes, read, write) DEF64(le64, 8, AV_RL64, AV_WL64) @@ -129,15 +136,17 @@ DEF (byte, 1, AV_RB8 , AV_WB8 ) #endif static av_always_inline void bytestream2_init(GetByteContext *g, - const uint8_t *buf, int buf_size) + const uint8_t *buf, + int buf_size) { - g->buffer = buf; + g->buffer = buf; g->buffer_start = buf; - g->buffer_end = buf + buf_size; + g->buffer_end = buf + buf_size; } static av_always_inline void bytestream2_init_writer(PutByteContext *p, - uint8_t *buf, int buf_size) + uint8_t *buf, + int buf_size) { p->buffer = buf; p->buffer_start = buf; @@ -183,21 +192,22 @@ static av_always_inline int bytestream2_tell_p(PutByteContext *p) return (int)(p->buffer - p->buffer_start); } -static av_always_inline int bytestream2_seek(GetByteContext *g, int offset, +static av_always_inline int bytestream2_seek(GetByteContext *g, + int offset, int whence) { switch (whence) { case SEEK_CUR: - offset = av_clip(offset, -(g->buffer - g->buffer_start), - g->buffer_end - g->buffer); + offset = av_clip(offset, -(g->buffer - g->buffer_start), + g->buffer_end - g->buffer); g->buffer += offset; break; case SEEK_END: - offset = av_clip(offset, -(g->buffer_end - g->buffer_start), 0); + offset = av_clip(offset, -(g->buffer_end - g->buffer_start), 0); g->buffer = g->buffer_end + offset; break; case SEEK_SET: - offset = av_clip(offset, 0, g->buffer_end - g->buffer_start); + offset = av_clip(offset, 0, g->buffer_end - g->buffer_start); g->buffer = g->buffer_start + offset; break; default: @@ -206,7 +216,8 @@ static av_always_inline int bytestream2_seek(GetByteContext *g, int offset, return bytestream2_tell(g); } -static av_always_inline int bytestream2_seek_p(PutByteContext *p, int offset, +static av_always_inline int bytestream2_seek_p(PutByteContext *p, + int offset, int whence) { p->eof = 0; @@ -214,20 +225,20 @@ static av_always_inline int bytestream2_seek_p(PutByteContext *p, int offset, case SEEK_CUR: if (p->buffer_end - p->buffer < offset) p->eof = 1; - offset = av_clip(offset, -(p->buffer - p->buffer_start), - p->buffer_end - p->buffer); + offset = av_clip(offset, -(p->buffer - p->buffer_start), + p->buffer_end - p->buffer); p->buffer += offset; break; case SEEK_END: if (offset > 0) p->eof = 1; - offset = av_clip(offset, -(p->buffer_end - p->buffer_start), 0); + offset = av_clip(offset, -(p->buffer_end - p->buffer_start), 0); p->buffer = p->buffer_end + offset; break; case SEEK_SET: if (p->buffer_end - p->buffer_start < offset) p->eof = 1; - offset = av_clip(offset, 0, p->buffer_end - p->buffer_start); + offset = av_clip(offset, 0, p->buffer_end - p->buffer_start); p->buffer = p->buffer_start + offset; break; default: @@ -280,14 +291,18 @@ static av_always_inline unsigned int bytestream2_get_eof(PutByteContext *p) return p->eof; } -static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b, uint8_t *dst, unsigned int size) +static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b, + uint8_t *dst, + unsigned int size) { memcpy(dst, *b, size); (*b) += size; return size; } -static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size) +static av_always_inline void bytestream_put_buffer(uint8_t **b, + const uint8_t *src, + unsigned int size) { memcpy(*b, src, size); (*b) += size; diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c index ad240e4341..7fc1bb5071 100644 --- a/libavcodec/eac3dec.c +++ b/libavcodec/eac3dec.c @@ -140,7 +140,7 @@ void ff_eac3_apply_spectral_extension(AC3DecodeContext *s) each band. */ bin = s->spx_src_start_freq; for (bnd = 0; bnd < s->num_spx_bands; bnd++) { - float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * (1.0f/(1<<31)); + float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * (1.0f / INT32_MIN); float sscale = s->spx_signal_blend[ch][bnd]; for (i = 0; i < s->spx_band_sizes[bnd]; i++) { float noise = nscale * (int32_t)av_lfg_get(&s->dith_state); diff --git a/libavcodec/ppc/idct_altivec.c b/libavcodec/ppc/idct_altivec.c index d65ba24f3a..f1c95c1557 100644 --- a/libavcodec/ppc/idct_altivec.c +++ b/libavcodec/ppc/idct_altivec.c @@ -215,4 +215,3 @@ void idct_add_altivec(uint8_t* dest, int stride, int16_t *blk) ADD (dest, vx6, perm0) dest += stride; ADD (dest, vx7, perm1) } - diff --git a/libavcodec/proresdec_lgpl.c b/libavcodec/proresdec_lgpl.c index 5fe47755c2..33653de71a 100644 --- a/libavcodec/proresdec_lgpl.c +++ b/libavcodec/proresdec_lgpl.c @@ -42,7 +42,7 @@ typedef struct { int slice_num; int x_pos, y_pos; int slice_width; - DECLARE_ALIGNED(16, DCTELEM, blocks[8 * 4 * 64]); + DECLARE_ALIGNED(16, DCTELEM, blocks)[8 * 4 * 64]; } ProresThreadData; typedef struct { @@ -57,8 +57,8 @@ typedef struct { uint8_t qmat_chroma[64]; ///< dequantization matrix for chroma int qmat_changed; ///< 1 - global quantization matrices changed int prev_slice_sf; ///< scalefactor of the previous decoded slice - DECLARE_ALIGNED(16, int16_t, qmat_luma_scaled[64]); - DECLARE_ALIGNED(16, int16_t, qmat_chroma_scaled[64]); + DECLARE_ALIGNED(16, int16_t, qmat_luma_scaled)[64]; + DECLARE_ALIGNED(16, int16_t, qmat_chroma_scaled)[64]; int total_slices; ///< total number of slices in a picture ProresThreadData *slice_data; int pic_num; diff --git a/libavcodec/ps2/dsputil_mmi.c b/libavcodec/ps2/dsputil_mmi.c index d04a425b49..26259c8453 100644 --- a/libavcodec/ps2/dsputil_mmi.c +++ b/libavcodec/ps2/dsputil_mmi.c @@ -164,4 +164,3 @@ void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx) c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM; } } - diff --git a/libavcodec/ps2/idct_mmi.c b/libavcodec/ps2/idct_mmi.c index bfe362a91d..5a3af173de 100644 --- a/libavcodec/ps2/idct_mmi.c +++ b/libavcodec/ps2/idct_mmi.c @@ -359,4 +359,3 @@ void ff_mmi_idct_add(uint8_t *dest, int line_size, DCTELEM *block) //let savedtemp regs be saved __asm__ volatile(" ":::"$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23"); } - diff --git a/libavcodec/ps2/mpegvideo_mmi.c b/libavcodec/ps2/mpegvideo_mmi.c index 68c3b0d0e7..8c8d3a7932 100644 --- a/libavcodec/ps2/mpegvideo_mmi.c +++ b/libavcodec/ps2/mpegvideo_mmi.c @@ -85,5 +85,3 @@ void MPV_common_init_mmi(MpegEncContext *s) s->dct_unquantize_h263_intra = s->dct_unquantize_h263_inter = dct_unquantize_h263_mmi; } - - diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c index 8fc9cd9fc0..577a8fc98a 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "raw.h" +#include "internal.h" #include "libavutil/pixdesc.h" #include "libavutil/intreadwrite.h" @@ -40,19 +41,29 @@ static av_cold int raw_init_encoder(AVCodecContext *avctx) return 0; } -static int raw_encode(AVCodecContext *avctx, - unsigned char *frame, int buf_size, void *data) +static int raw_encode(AVCodecContext *avctx, AVPacket *pkt, + const AVFrame *frame, int *got_packet) { - int ret = avpicture_layout((AVPicture *)data, avctx->pix_fmt, avctx->width, - avctx->height, frame, buf_size); + int ret = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); + + if (ret < 0) + return ret; + + if ((ret = ff_alloc_packet(pkt, ret)) < 0) + return ret; + if ((ret = avpicture_layout((const AVPicture *)frame, avctx->pix_fmt, avctx->width, + avctx->height, pkt->data, pkt->size)) < 0) + return ret; if(avctx->codec_tag == AV_RL32("yuv2") && ret > 0 && avctx->pix_fmt == PIX_FMT_YUYV422) { int x; for(x = 1; x < avctx->height*avctx->width*2; x += 2) - frame[x] ^= 0x80; + pkt->data[x] ^= 0x80; } - return ret; + pkt->flags |= AV_PKT_FLAG_KEY; + *got_packet = 1; + return 0; } AVCodec ff_rawvideo_encoder = { @@ -61,6 +72,6 @@ AVCodec ff_rawvideo_encoder = { .id = CODEC_ID_RAWVIDEO, .priv_data_size = sizeof(AVFrame), .init = raw_init_encoder, - .encode = raw_encode, + .encode2 = raw_encode, .long_name = NULL_IF_CONFIG_SMALL("raw video"), }; diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 8d49bc80d2..ab83730dfd 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -201,7 +201,6 @@ static const int64_t tta_channel_layouts[7] = { static av_cold int tta_decode_init(AVCodecContext * avctx) { TTAContext *s = avctx->priv_data; - int i; s->avctx = avctx; @@ -213,7 +212,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) if (show_bits_long(&s->gb, 32) == AV_RL32("TTA1")) { /* signature */ - skip_bits(&s->gb, 32); + skip_bits_long(&s->gb, 32); s->format = get_bits(&s->gb, 16); if (s->format > 2) { @@ -231,7 +230,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) s->bps = (avctx->bits_per_coded_sample + 7) / 8; avctx->sample_rate = get_bits_long(&s->gb, 32); s->data_length = get_bits_long(&s->gb, 32); - skip_bits(&s->gb, 32); // CRC32 of header + skip_bits_long(&s->gb, 32); // CRC32 of header if (s->channels == 0) { av_log(s->avctx, AV_LOG_ERROR, "Invalid number of channels\n"); @@ -272,9 +271,8 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) s->data_length, s->frame_length, s->last_frame_length, s->total_frames); // FIXME: seek table - for (i = 0; i < s->total_frames; i++) - skip_bits(&s->gb, 32); - skip_bits(&s->gb, 32); // CRC32 of seektable + skip_bits_long(&s->gb, 32 * s->total_frames); + skip_bits_long(&s->gb, 32); // CRC32 of seektable if(s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))){ av_log(avctx, AV_LOG_ERROR, "frame_length too large\n"); @@ -413,7 +411,7 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data, if (get_bits_left(&s->gb) < 32) return -1; - skip_bits(&s->gb, 32); // frame crc + skip_bits_long(&s->gb, 32); // frame crc // convert to output buffer switch(s->bps) { diff --git a/libavcodec/x86/fdct_mmx.c b/libavcodec/x86/fdct_mmx.c index 94f61574aa..366224210f 100644 --- a/libavcodec/x86/fdct_mmx.c +++ b/libavcodec/x86/fdct_mmx.c @@ -579,4 +579,3 @@ void ff_fdct_sse2(int16_t *block) fdct_col_sse2(block, block1, 0); fdct_row_sse2(block1, block); } - diff --git a/libavcodec/x86/fft.c b/libavcodec/x86/fft.c index d2d157c2d3..8544e322c4 100644 --- a/libavcodec/x86/fft.c +++ b/libavcodec/x86/fft.c @@ -67,4 +67,3 @@ av_cold void ff_dct_init_mmx(DCTContext *s) #endif } #endif - diff --git a/libavcodec/x86/fft_3dn2.c b/libavcodec/x86/fft_3dn2.c index 7a6cac14c4..f3c5dd05ca 100644 --- a/libavcodec/x86/fft_3dn2.c +++ b/libavcodec/x86/fft_3dn2.c @@ -171,4 +171,3 @@ void ff_imdct_calc_3dn2(FFTContext *s, FFTSample *output, const FFTSample *input ); __asm__ volatile("femms"); } - diff --git a/libavcodec/x86/fft_sse.c b/libavcodec/x86/fft_sse.c index 43f19fff3b..a09ad38d45 100644 --- a/libavcodec/x86/fft_sse.c +++ b/libavcodec/x86/fft_sse.c @@ -108,4 +108,3 @@ void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input) XMM_CLOBBERS_ONLY("%xmm0", "%xmm1", "%xmm7") ); } - diff --git a/libavcodec/x86/idct_mmx.c b/libavcodec/x86/idct_mmx.c index ed2d3217e5..f199941f55 100644 --- a/libavcodec/x86/idct_mmx.c +++ b/libavcodec/x86/idct_mmx.c @@ -626,4 +626,3 @@ declare_idct (ff_mmxext_idct, mmxext_table, declare_idct (ff_mmx_idct, mmx_table, mmx_row_head, mmx_row, mmx_row_tail, mmx_row_mid) - diff --git a/libavcodec/x86/idct_mmx_xvid.c b/libavcodec/x86/idct_mmx_xvid.c index 466cf75bc4..1b48ab52bb 100644 --- a/libavcodec/x86/idct_mmx_xvid.c +++ b/libavcodec/x86/idct_mmx_xvid.c @@ -523,4 +523,3 @@ __asm__ volatile( DCT_8_INV_COL(8(%0), 8(%0)) :: "r"(block), "r"(rounder_0), "r"(tab_i_04_xmm), "r"(tg_1_16)); } - diff --git a/libavfilter/x86/yadif_template.c b/libavfilter/x86/yadif_template.c index 0b60526007..71cf9d1358 100644 --- a/libavfilter/x86/yadif_template.c +++ b/libavfilter/x86/yadif_template.c @@ -261,4 +261,3 @@ void RENAME(ff_yadif_filter_line)(uint8_t *dst, #undef CHECK1 #undef CHECK2 #undef FILTER - diff --git a/libavformat/apetag.h b/libavformat/apetag.h index 8aaef68c38..869fc4b3c0 100644 --- a/libavformat/apetag.h +++ b/libavformat/apetag.h @@ -30,4 +30,4 @@ */ void ff_ape_parse_tag(AVFormatContext *s); -#endif /* AVFORMAT_ID3V2_H */ +#endif /* AVFORMAT_APETAG_H */ diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index c9278692a3..44533b4431 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -490,7 +490,8 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size /* sanity check PreviousPartition if set */ if (partition->previous_partition && mxf->run_in + partition->previous_partition >= klv_offset) { - av_log(mxf->fc, AV_LOG_ERROR, "PreviousPartition points to this partition or forward\n"); + av_log(mxf->fc, AV_LOG_ERROR, + "PreviousPartition points to this partition or forward\n"); return AVERROR_INVALIDDATA; } @@ -1107,7 +1108,6 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta if (s->nb_index_entries == 2 * s->index_duration + 1) { index_delta = 2; /* Avid index */ - /* ignore the last entry - it's the size of the essence container */ n--; } @@ -1117,7 +1117,8 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta int index = x + offset; if (x >= index_table->nb_ptses) { - av_log(mxf->fc, AV_LOG_ERROR, "x >= nb_ptses - IndexEntryCount %i < IndexDuration %"PRId64"?\n", + av_log(mxf->fc, AV_LOG_ERROR, + "x >= nb_ptses - IndexEntryCount %i < IndexDuration %"PRId64"?\n", s->nb_index_entries, s->index_duration); break; } @@ -1401,8 +1402,10 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) st->codec->codec_id = container_ul->id; st->codec->channels = descriptor->channels; st->codec->bits_per_coded_sample = descriptor->bits_per_sample; + if (descriptor->sample_rate.den > 0) - st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den; + st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den; + /* TODO: implement CODEC_ID_RAWAUDIO */ if (st->codec->codec_id == CODEC_ID_PCM_S16LE) { if (descriptor->bits_per_sample > 16 && descriptor->bits_per_sample <= 24) @@ -1496,14 +1499,15 @@ static int mxf_read_local_tags(MXFContext *mxf, KLVPacket *klv, MXFMetadataReadF else if ((ret = read_child(ctx, pb, tag, size, uid, -1)) < 0) return ret; - /* accept the 64k local set limit being exceeded (Avid) - * don't accept it extending past the end of the KLV though (zzuf5.mxf) */ + /* Accept the 64k local set limit being exceeded (Avid). Don't accept + * it extending past the end of the KLV though (zzuf5.mxf). */ if (avio_tell(pb) > klv_end) { - av_log(mxf->fc, AV_LOG_ERROR, "local tag %#04x extends past end of local set @ %#"PRIx64"\n", + av_log(mxf->fc, AV_LOG_ERROR, + "local tag %#04x extends past end of local set @ %#"PRIx64"\n", tag, klv->offset); return AVERROR_INVALIDDATA; } else if (avio_tell(pb) <= next) /* only seek forward, else this can loop for a long time */ - avio_seek(pb, next, SEEK_SET); + avio_seek(pb, next, SEEK_SET); } if (ctx_size) ctx->type = type; return ctx_size ? mxf_add_metadata_set(mxf, ctx) : 0; @@ -1628,8 +1632,9 @@ static int is_pcm(enum CodecID codec_id) } /** - * Deals with the case where for some audio atoms EditUnitByteCount is very small (2, 4..). - * In those cases we should read more than one sample per call to mxf_read_packet(). + * Deal with the case where for some audio atoms EditUnitByteCount is + * very small (2, 4..). In those cases we should read more than one + * sample per call to mxf_read_packet(). */ static void mxf_handle_small_eubc(AVFormatContext *s) { @@ -1641,15 +1646,18 @@ static void mxf_handle_small_eubc(AVFormatContext *s) return; /* expect PCM with exactly one index table segment and a small (< 32) EUBC */ - if (s->nb_streams != 1 || s->streams[0]->codec->codec_type != AVMEDIA_TYPE_AUDIO || - !is_pcm(s->streams[0]->codec->codec_id) || mxf->nb_index_tables != 1 || - mxf->index_tables[0].nb_segments != 1 || + if (s->nb_streams != 1 || + s->streams[0]->codec->codec_type != AVMEDIA_TYPE_AUDIO || + !is_pcm(s->streams[0]->codec->codec_id) || + mxf->nb_index_tables != 1 || + mxf->index_tables[0].nb_segments != 1 || mxf->index_tables[0].segments[0]->edit_unit_byte_count >= 32) return; /* arbitrarily default to 48 kHz PAL audio frame size */ - /* TODO: we could compute this from the ratio between the audio and video edit rates - * for 48 kHz NTSC we could use the 1802-1802-1802-1802-1801 pattern */ + /* TODO: We could compute this from the ratio between the audio + * and video edit rates for 48 kHz NTSC we could use the + * 1802-1802-1802-1802-1801 pattern. */ mxf->edit_units_per_packet = 1920; } @@ -1799,7 +1807,8 @@ static void mxf_packet_timestamps(MXFContext *mxf, AVPacket *pkt) int64_t last_ofs = -1, next_ofs; MXFIndexTable *t = &mxf->index_tables[0]; - /* this is called from the OP1a demuxing logic, which means there may be no index tables */ + /* this is called from the OP1a demuxing logic, which means there + * may be no index tables */ if (mxf->nb_index_tables <= 0) return; @@ -1809,9 +1818,10 @@ static void mxf_packet_timestamps(MXFContext *mxf, AVPacket *pkt) break; if (next_ofs <= last_ofs) { - /* large next_ofs didn't change or current_edit_unit wrapped around - * this fixes the infinite loop on zzuf3.mxf */ - av_log(mxf->fc, AV_LOG_ERROR, "next_ofs didn't change. not deriving packet timestamps\n"); + /* large next_ofs didn't change or current_edit_unit wrapped + * around this fixes the infinite loop on zzuf3.mxf */ + av_log(mxf->fc, AV_LOG_ERROR, + "next_ofs didn't change. not deriving packet timestamps\n"); return; } diff --git a/libavformat/wv.c b/libavformat/wv.c index 537fdec583..767f4f48ef 100644 --- a/libavformat/wv.c +++ b/libavformat/wv.c @@ -251,6 +251,7 @@ static int wv_read_packet(AVFormatContext *s, int ret; int size, ver, off; int64_t pos; + uint32_t block_samples; if (url_feof(s->pb)) return AVERROR(EIO); @@ -316,6 +317,12 @@ static int wv_read_packet(AVFormatContext *s, pkt->stream_index = 0; wc->block_parsed = 1; pkt->pts = wc->soff; + block_samples = AV_RN32(wc->extra); + if (block_samples > INT32_MAX) + av_log(s, AV_LOG_WARNING, "Too many samples in block: %"PRIu32"\n", block_samples); + else + pkt->duration = block_samples; + av_add_index_entry(s->streams[0], pos, pkt->pts, 0, 0, AVINDEX_KEYFRAME); return 0; } diff --git a/libavutil/Makefile b/libavutil/Makefile index b918da7ed8..6d78bd5528 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -88,7 +88,7 @@ TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo TOOLS = ffeval -DIRS = arm bfin sh4 x86 +DIRS = arm avr32 bfin mips ppc sh4 tomi x86 ARCH_HEADERS = bswap.h intmath.h intreadwrite.h timer.h diff --git a/libswscale/ppc/yuv2rgb_altivec.h b/libswscale/ppc/yuv2rgb_altivec.h index 8c62c322e7..aa52a4743e 100644 --- a/libswscale/ppc/yuv2rgb_altivec.h +++ b/libswscale/ppc/yuv2rgb_altivec.h @@ -24,6 +24,10 @@ #ifndef SWSCALE_PPC_YUV2RGB_ALTIVEC_H #define SWSCALE_PPC_YUV2RGB_ALTIVEC_H +#include + +#include "libswscale/swscale_internal.h" + #define YUV2PACKEDX_HEADER(suffix) \ void ff_yuv2 ## suffix ## _X_altivec(SwsContext *c, \ const int16_t *lumFilter, \ diff --git a/tests/fate/audio.mak b/tests/fate/audio.mak index bad874b623..f694cb9bc3 100644 --- a/tests/fate/audio.mak +++ b/tests/fate/audio.mak @@ -32,4 +32,4 @@ FATE_AUDIO += fate-ws_snd fate-ws_snd: CMD = md5 -i $(SAMPLES)/vqa/ws_snd.vqa -f s16le FATE_TESTS += $(FATE_AUDIO) -fate-audio: $(FATE_AUDIO) +fate-audio: $(FATE_AUDIO) \ No newline at end of file diff --git a/tests/fate/prores.mak b/tests/fate/prores.mak index 1890dac6e7..d211d3f4ae 100644 --- a/tests/fate/prores.mak +++ b/tests/fate/prores.mak @@ -12,4 +12,3 @@ fate-prores-422_hq: CMD = framecrc -flags +bitexact -i $(SAMPLES)/prores/Sequ fate-prores-422_lt: CMD = framecrc -flags +bitexact -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422_LT.mov -pix_fmt yuv422p10le fate-prores-422_proxy: CMD = framecrc -flags +bitexact -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422_Proxy.mov -pix_fmt yuv422p10le fate-prores-alpha: CMD = framecrc -flags +bitexact -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt yuv444p10le - diff --git a/tests/fate/screen.mak b/tests/fate/screen.mak index 28fb9a93b8..1cc519dff8 100644 --- a/tests/fate/screen.mak +++ b/tests/fate/screen.mak @@ -1,3 +1,4 @@ +# FIXME dropped frames in this test because of coarse timebase FATE_SCREEN += fate-cscd fate-cscd: CMD = framecrc -i $(SAMPLES)/CSCD/sample_video.avi -an -pix_fmt rgb24 diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak index 73dfab1732..f6823651f5 100644 --- a/tests/fate/vpx.mak +++ b/tests/fate/vpx.mak @@ -33,6 +33,8 @@ endef define FATE_VP8_FULL $(foreach N,$(VP8_SUITE),$(eval $(call FATE_VP8_SUITE,$(N),$(1),$(2)))) +# FIXME this file contains two frames with identical timestamps, +# so avconv drops one of them FATE_VP8 += fate-vp8-sign-bias$(1) fate-vp8-sign-bias$(1): CMD = framemd5 $(2) -i $(SAMPLES)/vp8/sintel-signbias.ivf fate-vp8-sign-bias$(1): REF = $(SRC_PATH)/tests/ref/fate/vp8-sign-bias