From 965dbe09b01c45eaf5d6dacde4bf03267751ebc9 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 5 Jul 2011 02:34:28 +0200 Subject: [PATCH 01/10] configure: simplify -rpath-link linker flag Lists of ':'-separated directories can be passed to -rpath-link directly. --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index e315afa1cb..e77340f74a 100755 --- a/configure +++ b/configure @@ -2958,7 +2958,7 @@ enabled extra_warnings && check_cflags -Winline # add some linker flags check_ldflags -Wl,--warn-common -check_ldflags -Wl,-rpath-link,libpostproc -Wl,-rpath-link,libswscale -Wl,-rpath-link,libavfilter -Wl,-rpath-link,libavdevice -Wl,-rpath-link,libavformat -Wl,-rpath-link,libavcodec -Wl,-rpath-link,libavutil +check_ldflags -Wl,-rpath-link=libpostproc:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic echo "X{};" > $TMPV From 65614321db88fc52100db9d7ca1a3e1eee762729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Tue, 5 Jul 2011 10:30:48 +0200 Subject: [PATCH 02/10] dv: fix comment spelling Signed-off-by: Diego Biurrun --- libavcodec/dv.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 4fde2a7899..fd33998aed 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -370,7 +370,6 @@ typedef struct BlockInfo { /* bit budget for AC only in 5 MBs */ static const int vs_total_ac_bits = (100 * 4 + 68*2) * 5; -/* see dv_88_areas and dv_248_areas for details */ static const int mb_area_start[5] = { 1, 6, 21, 43, 64 }; static inline int put_bits_left(PutBitContext* s) @@ -378,7 +377,7 @@ static inline int put_bits_left(PutBitContext* s) return (s->buf_end - s->buf) * 8 - put_bits_count(s); } -/* decode ac coefficients */ +/* decode AC coefficients */ static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block) { int last_index = gb->size_in_bits; @@ -391,7 +390,7 @@ static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block) OPEN_READER(re, gb); UPDATE_CACHE(re, gb); - /* if we must parse a partial vlc, we do it here */ + /* if we must parse a partial VLC, we do it here */ if (partial_bit_count > 0) { re_cache = ((unsigned)re_cache >> partial_bit_count) | (mb->partial_bit_buffer << (sizeof(re_cache) * 8 - partial_bit_count)); @@ -486,7 +485,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) memset(sblock, 0, 5*DV_MAX_BPM*sizeof(*sblock)); - /* pass 1 : read DC and AC coefficients in blocks */ + /* pass 1: read DC and AC coefficients in blocks */ buf_ptr = &s->buf[work_chunk->buf_offset*80]; block1 = &sblock[0][0]; mb1 = mb_data; @@ -503,7 +502,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) last_index = s->sys->block_sizes[j]; init_get_bits(&gb, buf_ptr, last_index); - /* get the dc */ + /* get the DC */ dc = get_sbits(&gb, 9); dct_mode = get_bits1(&gb); class1 = get_bits(&gb, 2); @@ -530,7 +529,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) av_dlog(avctx, "MB block: %d, %d ", mb_index, j); dv_decode_ac(&gb, mb, block); - /* write the remaining bits in a new buffer only if the + /* write the remaining bits in a new buffer only if the block is finished */ if (mb->pos >= 64) bit_copy(&pb, &gb); @@ -539,7 +538,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) mb++; } - /* pass 2 : we can do it just after */ + /* pass 2: we can do it just after */ av_dlog(avctx, "***pass 2 size=%d MB#=%d\n", put_bits_count(&pb), mb_index); block = block1; mb = mb1; @@ -559,7 +558,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) bit_copy(&vs_pb, &gb); } - /* we need a pass other the whole video segment */ + /* we need a pass over the whole video segment */ av_dlog(avctx, "***pass 3 size=%d\n", put_bits_count(&vs_pb)); block = &sblock[0][0]; mb = mb_data; @@ -640,7 +639,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) } #if CONFIG_SMALL -/* Converts run and level (where level != 0) pair into vlc, returning bit size */ +/* Converts run and level (where level != 0) pair into VLC, returning bit size */ static av_always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc) { int size; @@ -817,7 +816,7 @@ static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, i if (level + 15 > 30U) { bi->sign[i] = (level >> 31) & 1; - /* weigh it and and shift down into range, adding for rounding */ + /* weight it and and shift down into range, adding for rounding */ /* the extra division by a factor of 2^4 reverses the 8x expansion of the DCT AND the 2x doubling of the weights */ level = (FFABS(level) * weight[i] + (1 << (dv_weight_bits+3))) >> (dv_weight_bits+4); From 6cbf2420b95db9c65921c2f1c23105b9f7998338 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Tue, 5 Jul 2011 15:53:05 +0100 Subject: [PATCH 03/10] PPC: use Altivec IMDCT only for supported sizes The Altivec IMDCT works with size 32 and higher only. Signed-off-by: Mans Rullgard --- libavcodec/ppc/fft_altivec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/ppc/fft_altivec.c b/libavcodec/ppc/fft_altivec.c index 435024a0cb..39830b29a0 100644 --- a/libavcodec/ppc/fft_altivec.c +++ b/libavcodec/ppc/fft_altivec.c @@ -141,7 +141,9 @@ av_cold void ff_fft_init_altivec(FFTContext *s) { #if HAVE_GNU_AS s->fft_calc = ff_fft_calc_interleave_altivec; - s->imdct_calc = ff_imdct_calc_altivec; - s->imdct_half = ff_imdct_half_altivec; + if (s->mdct_bits >= 5) { + s->imdct_calc = ff_imdct_calc_altivec; + s->imdct_half = ff_imdct_half_altivec; + } #endif } From 4d5e7ab5c48451404038706ef3113c9925a83087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Mon, 4 Jul 2011 10:19:46 +0200 Subject: [PATCH 04/10] mxfenc: fix ignored drop flag in binary timecode representation. Signed-off-by: Ronald S. Bultje --- libavformat/mxfenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index c87f2334ba..16fa0dadd1 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1539,7 +1539,7 @@ static const uint8_t system_metadata_package_set_key[] = { 0x06,0x0E,0x2B,0x34,0 static uint32_t ff_framenum_to_12m_time_code(unsigned frame, int drop, int fps) { return (0 << 31) | // color frame flag - (0 << 30) | // drop frame flag + (drop << 30) | // drop frame flag ( ((frame % fps) / 10) << 28) | // tens of frames ( ((frame % fps) % 10) << 24) | // units of frames (0 << 23) | // field phase (NTSC), b0 (PAL) From 68e39d6efeacbf95144e3fd47b34fc79f907df3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Tue, 5 Jul 2011 16:02:56 +0200 Subject: [PATCH 05/10] dv: fix valgrind use of uninitialised value warnings. Signed-off-by: Ronald S. Bultje --- libavcodec/dv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/dv.c b/libavcodec/dv.c index fd33998aed..e5cade5033 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -475,8 +475,8 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) GetBitContext gb; BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1; LOCAL_ALIGNED_16(DCTELEM, sblock, [5*DV_MAX_BPM], [64]); - LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [80 + 4]); /* allow some slack */ - LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5 * 80 + 4]); /* allow some slack */ + LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [ 80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */ + LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5*80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */ const int log2_blocksize = 3-s->avctx->lowres; int is_field_mode[5]; @@ -543,6 +543,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) block = block1; mb = mb1; init_get_bits(&gb, mb_bit_buffer, put_bits_count(&pb)); + put_bits32(&pb, 0); // padding must be zero'ed flush_put_bits(&pb); for (j = 0; j < s->sys->bpm; j++, block += 64, mb++) { if (mb->pos < 64 && get_bits_left(&gb) > 0) { @@ -563,6 +564,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) block = &sblock[0][0]; mb = mb_data; init_get_bits(&gb, vs_bit_buffer, put_bits_count(&vs_pb)); + put_bits32(&vs_pb, 0); // padding must be zero'ed flush_put_bits(&vs_pb); for (mb_index = 0; mb_index < 5; mb_index++) { for (j = 0; j < s->sys->bpm; j++) { From c45f629576151f05ce7010967683385d277859fe Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 5 Jul 2011 17:33:24 +0200 Subject: [PATCH 06/10] Rename libavcodec/high_bit_depth.h ---> libavcodec/bit_depth_template.c This naming scheme is used elsewhere, so it's sensible to be consistent. --- libavcodec/{high_bit_depth.h => bit_depth_template.c} | 0 libavcodec/dsputil_template.c | 2 +- libavcodec/h264dsp_template.c | 2 +- libavcodec/h264idct_template.c | 2 +- libavcodec/h264pred_template.c | 3 ++- 5 files changed, 5 insertions(+), 4 deletions(-) rename libavcodec/{high_bit_depth.h => bit_depth_template.c} (100%) diff --git a/libavcodec/high_bit_depth.h b/libavcodec/bit_depth_template.c similarity index 100% rename from libavcodec/high_bit_depth.h rename to libavcodec/bit_depth_template.c diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c index b85931856a..645a881a19 100644 --- a/libavcodec/dsputil_template.c +++ b/libavcodec/dsputil_template.c @@ -27,7 +27,7 @@ * DSP utils */ -#include "high_bit_depth.h" +#include "bit_depth_template.c" static inline void FUNC(copy_block2)(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h) { diff --git a/libavcodec/h264dsp_template.c b/libavcodec/h264dsp_template.c index be88f7487f..d11eff0919 100644 --- a/libavcodec/h264dsp_template.c +++ b/libavcodec/h264dsp_template.c @@ -25,7 +25,7 @@ * @author Michael Niedermayer */ -#include "high_bit_depth.h" +#include "bit_depth_template.c" #define op_scale1(x) block[x] = av_clip_pixel( (block[x]*weight + offset) >> log2_denom ) #define op_scale2(x) dst[x] = av_clip_pixel( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1)) diff --git a/libavcodec/h264idct_template.c b/libavcodec/h264idct_template.c index c024538db5..55c1d3a4d8 100644 --- a/libavcodec/h264idct_template.c +++ b/libavcodec/h264idct_template.c @@ -25,7 +25,7 @@ * @author Michael Niedermayer */ -#include "high_bit_depth.h" +#include "bit_depth_template.c" #ifndef AVCODEC_H264IDCT_INTERNAL_H #define AVCODEC_H264IDCT_INTERNAL_H diff --git a/libavcodec/h264pred_template.c b/libavcodec/h264pred_template.c index 1c1fe0bc31..e5d91555b8 100644 --- a/libavcodec/h264pred_template.c +++ b/libavcodec/h264pred_template.c @@ -26,7 +26,8 @@ */ #include "mathops.h" -#include "high_bit_depth.h" + +#include "bit_depth_template.c" static void FUNCC(pred4x4_vertical)(uint8_t *_src, const uint8_t *topright, int _stride){ pixel *src = (pixel*)_src; From 6d75fb01eb9d3cf72fff45aa757932cced3bcd4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Tue, 5 Jul 2011 17:30:00 +0200 Subject: [PATCH 07/10] dv: fix comment wording mistake --- libavcodec/dv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/dv.c b/libavcodec/dv.c index e5cade5033..a35bb2f2ed 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -543,7 +543,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) block = block1; mb = mb1; init_get_bits(&gb, mb_bit_buffer, put_bits_count(&pb)); - put_bits32(&pb, 0); // padding must be zero'ed + put_bits32(&pb, 0); // padding must be zeroed flush_put_bits(&pb); for (j = 0; j < s->sys->bpm; j++, block += 64, mb++) { if (mb->pos < 64 && get_bits_left(&gb) > 0) { @@ -564,7 +564,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) block = &sblock[0][0]; mb = mb_data; init_get_bits(&gb, vs_bit_buffer, put_bits_count(&vs_pb)); - put_bits32(&vs_pb, 0); // padding must be zero'ed + put_bits32(&vs_pb, 0); // padding must be zeroed flush_put_bits(&vs_pb); for (mb_index = 0; mb_index < 5; mb_index++) { for (j = 0; j < s->sys->bpm; j++) { From fce1e43410bdc032c4cf2b1c66166a9ed99cc8f1 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Tue, 5 Jul 2011 18:29:35 +0100 Subject: [PATCH 08/10] ARM: workaround for bug in GNU assembler Some versions of the GNU assembler do not handle 64-bit immediate operands containing arithmetic. Writing the value out in full works correctly. Signed-off-by: Mans Rullgard --- libavcodec/arm/fft_fixed_neon.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/arm/fft_fixed_neon.S b/libavcodec/arm/fft_fixed_neon.S index 2cfd817fc9..0508088590 100644 --- a/libavcodec/arm/fft_fixed_neon.S +++ b/libavcodec/arm/fft_fixed_neon.S @@ -56,7 +56,7 @@ vhsub.s16 \r0, \d0, \d1 @ t3, t4, t8, t7 vhsub.s16 \r1, \d1, \d0 vhadd.s16 \d0, \d0, \d1 @ t1, t2, t6, t5 - vmov.i64 \d1, #0xffff<<32 + vmov.i64 \d1, #0xffff00000000 vbit \r0, \r1, \d1 vrev64.16 \r1, \r0 @ t7, t8, t4, t3 vtrn.32 \r0, \r1 @ t3, t4, t7, t8 From 8dd52d82029febc3effd981c3107846904559c6d Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 15 Jun 2011 00:04:48 +0200 Subject: [PATCH 09/10] opencore-amr: Add missing initializer braces to shut up gcc warning. This fixes the warning: libavcodec/libopencore-amr.c:91: warning: missing braces around initializer --- libavcodec/libopencore-amr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index cf8bdbbcb8..edf372ffad 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -88,7 +88,7 @@ typedef struct AMRContext { } AMRContext; static const AVOption options[] = { - { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRContext, enc_dtx), FF_OPT_TYPE_INT, 0, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM }, + { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRContext, enc_dtx), FF_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM }, { NULL } }; From d3f751e6030545c5e1f312c5a83c1e6ed5794f18 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 5 Jul 2011 00:42:31 +0200 Subject: [PATCH 10/10] Add some missing mathematics.h #includes for av_rescale(). --- libavdevice/libdc1394.c | 1 + libavfilter/vf_frei0r.c | 1 + libavformat/flvdec.c | 1 + libavformat/librtmp.c | 1 + libavformat/mpegts.c | 1 + 5 files changed, 5 insertions(+) diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c index bf4e27e51b..e6161a1386 100644 --- a/libavdevice/libdc1394.c +++ b/libavdevice/libdc1394.c @@ -23,6 +23,7 @@ #include "config.h" #include "libavformat/avformat.h" #include "libavutil/log.h" +#include "libavutil/mathematics.h" #include "libavutil/opt.h" #include "libavutil/parseutils.h" #include "libavutil/pixdesc.h" diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index 48683f4fea..455e24a7f1 100644 --- a/libavfilter/vf_frei0r.c +++ b/libavfilter/vf_frei0r.c @@ -28,6 +28,7 @@ #include #include "libavutil/avstring.h" #include "libavutil/imgutils.h" +#include "libavutil/mathematics.h" #include "libavutil/parseutils.h" #include "avfilter.h" diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 3b7db0e6ca..57eaa84696 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -27,6 +27,7 @@ #include "libavutil/avstring.h" #include "libavutil/dict.h" #include "libavutil/intfloat_readwrite.h" +#include "libavutil/mathematics.h" #include "libavcodec/bytestream.h" #include "libavcodec/mpeg4audio.h" #include "avformat.h" diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c index 30fe8a196b..6ccb66bd8c 100644 --- a/libavformat/librtmp.c +++ b/libavformat/librtmp.c @@ -24,6 +24,7 @@ * RTMP protocol based on http://rtmpdump.mplayerhq.hu/ librtmp */ +#include "libavutil/mathematics.h" #include "avformat.h" #include "url.h" diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index f2ae567789..43cd1fbd6f 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -25,6 +25,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/log.h" #include "libavutil/dict.h" +#include "libavutil/mathematics.h" #include "libavutil/opt.h" #include "libavcodec/bytestream.h" #include "avformat.h"