From ea382767ad2191acbe97e90624059723e15f0e4b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 14 Jan 2013 20:07:53 +0100 Subject: h264: fix ff_generate_sliding_window_mmcos() prototype. It's been returning an error value since bad446e251405dc250c3cbee199072e083a1e4b9 Also check for the errors it returns. --- libavcodec/h264.c | 4 +++- libavcodec/h264.h | 2 +- libavcodec/h264_refs.c | 12 ++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index d2bbe465eb..3298565d97 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2904,7 +2904,9 @@ static int decode_slice_header(H264Context *h, H264Context *h0) s->current_picture_ptr->frame_num = h->prev_frame_num; ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX, 0); ff_thread_report_progress(&s->current_picture_ptr->f, INT_MAX, 1); - ff_generate_sliding_window_mmcos(h, 1); + if ((ret = ff_generate_sliding_window_mmcos(h, 1)) < 0 && + s->avctx->err_recognition & AV_EF_EXPLODE) + return ret; if (ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index) < 0 && (s->avctx->err_recognition & AV_EF_EXPLODE)) return AVERROR_INVALIDDATA; diff --git a/libavcodec/h264.h b/libavcodec/h264.h index ad4732e1df..898ebf7b0a 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -648,7 +648,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count); int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb, int first_slice); -void ff_generate_sliding_window_mmcos(H264Context *h, int first_slice); +int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice); /** * Check if the top & left blocks are available if needed & change the diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c index 62c2a5758e..0e4bd76931 100644 --- a/libavcodec/h264_refs.c +++ b/libavcodec/h264_refs.c @@ -488,7 +488,7 @@ static int check_opcodes(MMCO *mmco1, MMCO *mmco2, int n_mmcos) return 0; } -void ff_generate_sliding_window_mmcos(H264Context *h, int first_slice) +int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice) { MpegEncContext * const s = &h->s; MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp; @@ -521,6 +521,7 @@ void ff_generate_sliding_window_mmcos(H264Context *h, int first_slice) mmco_index, h->mmco_index, i); return AVERROR_INVALIDDATA; } + return 0; } int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){ @@ -686,7 +687,7 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb, int first_slice) { MpegEncContext * const s = &h->s; - int i; + int i, ret; MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp; int mmco_index = 0; @@ -743,8 +744,11 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb, } mmco_index = i; } else { - if (first_slice) - ff_generate_sliding_window_mmcos(h, first_slice); + if (first_slice) { + ret = ff_generate_sliding_window_mmcos(h, first_slice); + if (ret < 0 && s->avctx->err_recognition & AV_EF_EXPLODE) + return ret; + } mmco_index = -1; } } -- cgit v1.2.3 From 171f1446f05440c9f5ffb986e3dcc828e50d440a Mon Sep 17 00:00:00 2001 From: RĂ©mi Denis-Courmont Date: Mon, 14 Jan 2013 22:00:05 +0200 Subject: vdpau: Remove av_unused attribute from function declaration Signed-off-by: Diego Biurrun --- libavcodec/vdpau_internal.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/vdpau_internal.h b/libavcodec/vdpau_internal.h index 87c94c803b..4aefc85196 100644 --- a/libavcodec/vdpau_internal.h +++ b/libavcodec/vdpau_internal.h @@ -34,8 +34,7 @@ static inline uintptr_t ff_vdpau_get_surface_id(Picture *pic) } int ff_vdpau_common_start_frame(AVCodecContext *avctx, - av_unused const uint8_t *buffer, - av_unused uint32_t size); + const uint8_t *buffer, uint32_t size); int ff_vdpau_common_end_frame(AVCodecContext *avctx); int ff_vdpau_add_buffer(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); -- cgit v1.2.3 From 51969a652c2e9e330393c9ad40f919516a4795d1 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 15 Jul 2012 18:23:40 +0200 Subject: x86: ABS2: port to cpuflags --- libavcodec/x86/ac3dsp.asm | 3 --- libavcodec/x86/dsputilenc.asm | 2 -- libavutil/x86/x86util.asm | 29 +++++++++++++---------------- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm index a5d9458b39..ef59db2b3b 100644 --- a/libavcodec/x86/ac3dsp.asm +++ b/libavcodec/x86/ac3dsp.asm @@ -151,15 +151,12 @@ cglobal ac3_max_msb_abs_int16, 2,2,5, src, len %endmacro INIT_MMX mmx -%define ABS2 ABS2_MMX AC3_MAX_MSB_ABS_INT16 or_abs INIT_MMX mmxext -%define ABS2 ABS2_MMXEXT AC3_MAX_MSB_ABS_INT16 min_max INIT_XMM sse2 AC3_MAX_MSB_ABS_INT16 min_max INIT_XMM ssse3 -%define ABS2 ABS2_SSSE3 AC3_MAX_MSB_ABS_INT16 or_abs ;----------------------------------------------------------------------------- diff --git a/libavcodec/x86/dsputilenc.asm b/libavcodec/x86/dsputilenc.asm index 3bb1f2f4ed..a2cb7f9202 100644 --- a/libavcodec/x86/dsputilenc.asm +++ b/libavcodec/x86/dsputilenc.asm @@ -263,7 +263,6 @@ INIT_MMX mmxext HADAMARD8_DIFF INIT_XMM sse2 -%define ABS2 ABS2_MMXEXT %if ARCH_X86_64 %define ABS_SUM_8x8 ABS_SUM_8x8_64 %else @@ -272,7 +271,6 @@ INIT_XMM sse2 HADAMARD8_DIFF 10 INIT_XMM ssse3 -%define ABS2 ABS2_SSSE3 %define ABS_SUM_8x8 ABS_SUM_8x8_64 HADAMARD8_DIFF 9 diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm index e24acdd940..1451500534 100644 --- a/libavutil/x86/x86util.asm +++ b/libavutil/x86/x86util.asm @@ -187,7 +187,18 @@ %endif %endmacro -%macro ABS2_MMX 4 ; a, b, tmp0, tmp1 +%macro ABS2 4 +%if cpuflag(ssse3) + pabsw %1, %1 + pabsw %2, %2 +%elif cpuflag(mmxext) ; a, b, tmp0, tmp1 + pxor %3, %3 + pxor %4, %4 + psubw %3, %1 + psubw %4, %2 + pmaxsw %1, %3 + pmaxsw %2, %4 +%else ; a, b, tmp0, tmp1 pxor %3, %3 pxor %4, %4 pcmpgtw %3, %1 @@ -196,20 +207,7 @@ pxor %2, %4 psubw %1, %3 psubw %2, %4 -%endmacro - -%macro ABS2_MMXEXT 4 ; a, b, tmp0, tmp1 - pxor %3, %3 - pxor %4, %4 - psubw %3, %1 - psubw %4, %2 - pmaxsw %1, %3 - pmaxsw %2, %4 -%endmacro - -%macro ABS2_SSSE3 4 - pabsw %1, %1 - pabsw %2, %2 +%endif %endmacro %macro ABSB_MMX 2 @@ -252,7 +250,6 @@ ABS2 %3, %4, %5, %6 %endmacro -%define ABS2 ABS2_MMX %define ABSB ABSB_MMX %define ABSB2 ABSB2_MMX -- cgit v1.2.3 From 99853cb8d4237b810b2fffb4a34f66fd0064ef72 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Mon, 14 Jan 2013 20:38:33 +0100 Subject: configure: Make warnings from -Wreturn-type fatal errors These warnings have no false positives and point to serious bugs. --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 3d5fe7cd4f..375865e74e 100755 --- a/configure +++ b/configure @@ -3684,6 +3684,7 @@ elif enabled gcc; then check_optflags -fno-tree-vectorize check_cflags -Werror=implicit-function-declaration check_cflags -Werror=missing-prototypes + check_cflags -Werror=return-type check_cflags -Werror=declaration-after-statement check_cflags -Werror=vla elif enabled llvm_gcc; then @@ -3693,6 +3694,7 @@ elif enabled clang; then check_cflags -Qunused-arguments check_cflags -Werror=implicit-function-declaration check_cflags -Werror=missing-prototypes + check_cflags -Werror=return-type elif enabled armcc; then # 2523: use of inline assembler is deprecated add_cflags -W${armcc_opt},--diag_suppress=2523 -- cgit v1.2.3 From d8c772de53d29afb1bada88afa859fce8489c668 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 15 Jan 2013 00:39:23 +0100 Subject: nutdec: Always return a value from nut_read_timestamp() The function is a callback that is called by ff_gen_search with a constant stream index. Avoid a false positive on older gcc version. Signed-off-by: Luca Barbato --- libavformat/nutdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index b705987795..cee411b601 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -910,7 +910,7 @@ static int64_t nut_read_timestamp(AVFormatContext *s, int stream_index, else if (stream_index == -2) return back_ptr; - assert(0); + return AV_NOPTS_VALUE; } static int read_seek(AVFormatContext *s, int stream_index, -- cgit v1.2.3