From 172ee1da2b2b7c84733822092eb29fcaec102055 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sun, 17 Jul 2011 14:17:10 +0100 Subject: [PATCH 1/6] random_seed: use proper #includes Use <> for system headers, add needed math.h, drop unnecessary avutil.h. Signed-off-by: Mans Rullgard --- libavutil/random_seed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index a1078d8bbb..ee71542652 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -20,10 +20,10 @@ #include #include +#include +#include #include "timer.h" -#include "time.h" #include "random_seed.h" -#include "avutil.h" static int read_random(uint32_t *dst, const char *file) { From 8f62ef0f95cd0bc915086a9d3d66b27fceb6916f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 17 Jul 2011 18:43:11 +0300 Subject: [PATCH 2/6] x86: Use LOCAL_ALIGNED in mpegvideo_mmx_template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavcodec/x86/mpegvideo_mmx_template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/x86/mpegvideo_mmx_template.c b/libavcodec/x86/mpegvideo_mmx_template.c index 0f01cb24b9..0b6cff3540 100644 --- a/libavcodec/x86/mpegvideo_mmx_template.c +++ b/libavcodec/x86/mpegvideo_mmx_template.c @@ -98,7 +98,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s, x86_reg last_non_zero_p1; int level=0, q; //=0 is because gcc says uninitialized ... const uint16_t *qmat, *bias; - DECLARE_ALIGNED(16, int16_t, temp_block)[64]; + LOCAL_ALIGNED_16(int16_t, temp_block, [64]); assert((7&(int)(&temp_block[0])) == 0); //did gcc align it correctly? From 6eaaf8da88f8fff9160c92c84128c182f934e0d9 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 17 Jul 2011 23:51:10 +0200 Subject: [PATCH 3/6] gxfenc: place variable declarations before statements libavformat/gxfenc.c:409: warning: ISO C90 forbids mixed declarations and code --- libavformat/gxfenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c index 11e1ea5798..89969b26e1 100644 --- a/libavformat/gxfenc.c +++ b/libavformat/gxfenc.c @@ -396,6 +396,7 @@ static int gxf_write_umf_material_description(AVFormatContext *s) int timecode_base = gxf->time_base.den == 60000 ? 60 : 50; int64_t timestamp = 0; AVDictionaryEntry *t; + uint32_t timecode; #if FF_API_TIMESTAMP if (s->timestamp) @@ -406,7 +407,7 @@ static int gxf_write_umf_material_description(AVFormatContext *s) timestamp = ff_iso8601_to_unix_time(t->value); // XXX drop frame - uint32_t timecode = + timecode = gxf->nb_fields / (timecode_base * 3600) % 24 << 24 | // hours gxf->nb_fields / (timecode_base * 60) % 60 << 16 | // minutes gxf->nb_fields / timecode_base % 60 << 8 | // seconds From c99c0e2625d5f19854586fc2142c673ce05c9f40 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 17 Jul 2011 13:26:53 +0200 Subject: [PATCH 4/6] tta: remove disabled code --- libavcodec/tta.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 001b1197b6..96de9c3202 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -66,23 +66,6 @@ typedef struct TTAContext { TTAChannel *ch_ctx; } TTAContext; -#if 0 -static inline int shift_1(int i) -{ - if (i < 32) - return 1 << i; - else - return 0x80000000; // 16 << 31 -} - -static inline int shift_16(int i) -{ - if (i < 28) - return 16 << i; - else - return 0x80000000; // 16 << 27 -} -#else static const uint32_t shift_1[] = { 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010, 0x00000020, 0x00000040, 0x00000080, @@ -97,7 +80,6 @@ static const uint32_t shift_1[] = { }; static const uint32_t * const shift_16 = shift_1 + 4; -#endif static const int32_t ttafilter_configs[4][2] = { {10, 1}, @@ -389,19 +371,6 @@ static int tta_decode_frame(AVCodecContext *avctx, } *predictor = *p; -#if 0 - // extract 32bit float from last two int samples - if (s->is_float && ((p - data) & 1)) { - uint32_t neg = *p & 0x80000000; - uint32_t hi = *(p - 1); - uint32_t lo = abs(*p) - 1; - - hi += (hi || lo) ? 0x3f80 : 0; - // SWAP16: swap all the 16 bits - *(p - 1) = (hi << 16) | SWAP16(lo) | neg; - } -#endif - /*if ((get_bits_count(&s->gb)+7)/8 > buf_size) { av_log(NULL, AV_LOG_INFO, "overread!!\n"); From 65083b49117cb64c0e9a3741da9ed1cfbf64aff3 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 17 Jul 2011 13:29:13 +0200 Subject: [PATCH 5/6] dsputil: remove disabled code --- libavcodec/dsputil.c | 32 ----------------------------- libavcodec/x86/dsputil_mmx.c | 39 ------------------------------------ 2 files changed, 71 deletions(-) diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 8bb7dc1181..6cbbf3d82e 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -175,16 +175,6 @@ static int pix_norm1_c(uint8_t * pix, int line_size) s = 0; for (i = 0; i < 16; i++) { for (j = 0; j < 16; j += 8) { -#if 0 - s += sq[pix[0]]; - s += sq[pix[1]]; - s += sq[pix[2]]; - s += sq[pix[3]]; - s += sq[pix[4]]; - s += sq[pix[5]]; - s += sq[pix[6]]; - s += sq[pix[7]]; -#else #if LONG_MAX > 2147483647 register uint64_t x=*(uint64_t*)pix; s += sq[x&0xff]; @@ -206,7 +196,6 @@ static int pix_norm1_c(uint8_t * pix, int line_size) s += sq[(x>>8)&0xff]; s += sq[(x>>16)&0xff]; s += sq[(x>>24)&0xff]; -#endif #endif pix += 8; } @@ -819,27 +808,6 @@ static inline void avg_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src, int dst += stride; } } -#if 0 -#define TPEL_WIDTH(width)\ -static void put_tpel_pixels ## width ## _mc00_c(uint8_t *dst, const uint8_t *src, int stride, int height){\ - void put_tpel_pixels_mc00_c(dst, src, stride, width, height);}\ -static void put_tpel_pixels ## width ## _mc10_c(uint8_t *dst, const uint8_t *src, int stride, int height){\ - void put_tpel_pixels_mc10_c(dst, src, stride, width, height);}\ -static void put_tpel_pixels ## width ## _mc20_c(uint8_t *dst, const uint8_t *src, int stride, int height){\ - void put_tpel_pixels_mc20_c(dst, src, stride, width, height);}\ -static void put_tpel_pixels ## width ## _mc01_c(uint8_t *dst, const uint8_t *src, int stride, int height){\ - void put_tpel_pixels_mc01_c(dst, src, stride, width, height);}\ -static void put_tpel_pixels ## width ## _mc11_c(uint8_t *dst, const uint8_t *src, int stride, int height){\ - void put_tpel_pixels_mc11_c(dst, src, stride, width, height);}\ -static void put_tpel_pixels ## width ## _mc21_c(uint8_t *dst, const uint8_t *src, int stride, int height){\ - void put_tpel_pixels_mc21_c(dst, src, stride, width, height);}\ -static void put_tpel_pixels ## width ## _mc02_c(uint8_t *dst, const uint8_t *src, int stride, int height){\ - void put_tpel_pixels_mc02_c(dst, src, stride, width, height);}\ -static void put_tpel_pixels ## width ## _mc12_c(uint8_t *dst, const uint8_t *src, int stride, int height){\ - void put_tpel_pixels_mc12_c(dst, src, stride, width, height);}\ -static void put_tpel_pixels ## width ## _mc22_c(uint8_t *dst, const uint8_t *src, int stride, int height){\ - void put_tpel_pixels_mc22_c(dst, src, stride, width, height);} -#endif #define QPEL_MC(r, OPNAME, RND, OP) \ static void OPNAME ## mpeg4_qpel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){\ diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 4e84f63378..29fff276ad 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -1665,10 +1665,6 @@ QPEL_2TAP(put_, 8, 3dnow) QPEL_2TAP(avg_, 8, 3dnow) -#if 0 -static void just_return(void) { return; } -#endif - #if HAVE_YASM typedef void emu_edge_core_func (uint8_t *buf, const uint8_t *src, x86_reg linesize, x86_reg start_y, @@ -2953,39 +2949,4 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) if (CONFIG_ENCODERS) dsputilenc_init_mmx(c, avctx); - -#if 0 - // for speed testing - get_pixels = just_return; - put_pixels_clamped = just_return; - add_pixels_clamped = just_return; - - pix_abs16x16 = just_return; - pix_abs16x16_x2 = just_return; - pix_abs16x16_y2 = just_return; - pix_abs16x16_xy2 = just_return; - - put_pixels_tab[0] = just_return; - put_pixels_tab[1] = just_return; - put_pixels_tab[2] = just_return; - put_pixels_tab[3] = just_return; - - put_no_rnd_pixels_tab[0] = just_return; - put_no_rnd_pixels_tab[1] = just_return; - put_no_rnd_pixels_tab[2] = just_return; - put_no_rnd_pixels_tab[3] = just_return; - - avg_pixels_tab[0] = just_return; - avg_pixels_tab[1] = just_return; - avg_pixels_tab[2] = just_return; - avg_pixels_tab[3] = just_return; - - avg_no_rnd_pixels_tab[0] = just_return; - avg_no_rnd_pixels_tab[1] = just_return; - avg_no_rnd_pixels_tab[2] = just_return; - avg_no_rnd_pixels_tab[3] = just_return; - - //av_fdct = just_return; - //ff_idct = just_return; -#endif } From 9bc8bcddbd4fc394e2268e9849dcbf3bad6de980 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Fri, 15 Jul 2011 15:40:31 +0200 Subject: [PATCH 6/6] vf_libopencv: replace opencv/cxtypes.h #include by opencv/cxcore.h cxtypes.h works with version 2.1 and older, cxcore.h works with 2.2 and older. Signed-off-by: Diego Biurrun --- libavfilter/vf_libopencv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c index 5a52f246ba..6e343af7ef 100644 --- a/libavfilter/vf_libopencv.c +++ b/libavfilter/vf_libopencv.c @@ -26,7 +26,7 @@ /* #define DEBUG */ #include -#include +#include #include "libavutil/avstring.h" #include "libavutil/file.h" #include "avfilter.h"