aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-28 00:42:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-28 01:08:52 +0200
commit87df986dcf90dcda2d10d9c3b3c84656cdd032aa (patch)
treef7c506a9a96b3df41f392a558a1f9add4f9ff013 /libavcodec
parentee7214c59a2641389bec9e9598345c7a58f1e173 (diff)
parent15358ade152ebc28fcc824e09ad9206597c281df (diff)
downloadffmpeg-87df986dcf90dcda2d10d9c3b3c84656cdd032aa.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: mss1: validate number of changeable palette entries mss1: report palette changed when some additional colours were decoded x86: fft: replace call to memcpy by a loop udp: Support IGMPv3 source specific multicast and source blocking dxva2: include dxva.h if found libm: Provide fallback definitions for isnan() and isinf() tcp: Pass NULL as hostname to getaddrinfo if the string is empty tcp: Set AI_PASSIVE when the socket will be used for listening Conflicts: configure libavcodec/mss1.c libavformat/udp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dxva2_internal.h7
-rw-r--r--libavcodec/mss1.c8
-rw-r--r--libavcodec/x86/fft_mmx.asm37
3 files changed, 24 insertions, 28 deletions
diff --git a/libavcodec/dxva2_internal.h b/libavcodec/dxva2_internal.h
index 23d4d87522..fcf45bc664 100644
--- a/libavcodec/dxva2_internal.h
+++ b/libavcodec/dxva2_internal.h
@@ -25,7 +25,14 @@
#define _WIN32_WINNT 0x0600
#define COBJMACROS
+
+#include "config.h"
+
#include "dxva2.h"
+#if HAVE_DXVA_H
+#include <dxva.h>
+#endif
+
#include "avcodec.h"
#include "mpegvideo.h"
diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c
index 6163ecf26e..6299037d01 100644
--- a/libavcodec/mss1.c
+++ b/libavcodec/mss1.c
@@ -557,7 +557,7 @@ static int decode_pal(MSS1Context *ctx, ArithCoder *acoder)
*pal++ = (0xFF << 24) | (r << 16) | (g << 8) | b;
}
- return 1;
+ return !!ncol;
}
static int decode_pivot(MSS1Context *ctx, ArithCoder *acoder, int base)
@@ -783,8 +783,10 @@ static av_cold int mss1_decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d\n",
AV_RB32(avctx->extradata + 4), AV_RB32(avctx->extradata + 8));
c->free_colours = AV_RB32(avctx->extradata + 48);
- if (c->free_colours < 0 || c->free_colours > 256) {
- av_log(avctx, AV_LOG_ERROR, "Invalid free colours %d\n", c->free_colours);
+ if ((unsigned)c->free_colours > 256) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Incorrect number of changeable palette entries: %d\n",
+ c->free_colours);
return AVERROR_INVALIDDATA;
}
av_log(avctx, AV_LOG_DEBUG, "%d free colour(s)\n", c->free_colours);
diff --git a/libavcodec/x86/fft_mmx.asm b/libavcodec/x86/fft_mmx.asm
index 2ff282d51c..5bf0e2f259 100644
--- a/libavcodec/x86/fft_mmx.asm
+++ b/libavcodec/x86/fft_mmx.asm
@@ -616,8 +616,6 @@ cglobal fft_calc, 2,5,8
.end:
REP_RET
-cextern_naked memcpy
-
cglobal fft_permute, 2,7,1
mov r4, [r0 + FFTContext.revtab]
mov r5, [r0 + FFTContext.tmpbuf]
@@ -638,29 +636,18 @@ cglobal fft_permute, 2,7,1
cmp r0, r2
jl .loop
shl r2, 3
-%if ARCH_X86_64
- mov r0, r1
- mov r1, r5
-%endif
-%if WIN64
- sub rsp, 8
- call memcpy
- add rsp, 8
- RET
-%elif ARCH_X86_64
-%ifdef PIC
- jmp memcpy wrt ..plt
-%else
- jmp memcpy
-%endif
-%else
- push r2
- push r5
- push r1
- call memcpy
- add esp, 12
- RET
-%endif
+ add r1, r2
+ add r5, r2
+ neg r2
+; nbits >= 2 (FFT4) and sizeof(FFTComplex)=8 => at least 32B
+.loopcopy:
+ movaps xmm0, [r5 + r2]
+ movaps xmm1, [r5 + r2 + 16]
+ movaps [r1 + r2], xmm0
+ movaps [r1 + r2 + 16], xmm1
+ add r2, 32
+ jl .loopcopy
+ REP_RET
cglobal imdct_calc, 3,5,3
mov r3d, [r0 + FFTContext.mdctsize]