summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-08-02 22:07:51 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-08-02 22:12:18 +0200
commit1d186e9e120d777cc9f5e68d2974d48bfbdd528e (patch)
tree571e05f6a9ba06c10729f67ccd29353c2b31aa19 /libavcodec
parent03cbe6c8bc42626107e75b001180b81781619ed7 (diff)
parent62ee0e6a977e1990c9853630c7dea1415b38bb28 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: Revert "swscale: use 15-bit intermediates for 9/10-bit scaling." swscale: use 15-bit intermediates for 9/10-bit scaling. dct32: Add SSE2 ASM optimizations Correct chroma vector calculation for RealVideo 3. lavf: Add an option to discard corrupted frames mpegts: Mark wrongly-sized packets as corrupted mpegts: Move scan test to handle_packets mpegts: Mark corrupted packets mpegts: Reset continuity counter on seek mpegts: Fix for continuity counter mpegts: Silence "can't seek" warning on unseekable apichange: add an entry for AV_PKT_FLAG_CORRUPT avpacket: signal possibly corrupted packets mpeg4videodec: remove dead code that would have detected erroneous encoding aac: Remove some suspicious illegal memcpy()s from LTP. bink: Eliminate unnecessary shadow declaration. Conflicts: doc/APIchanges libavcodec/version.h libavformat/avformat.h libavformat/options.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/aacdec.c2
-rw-r--r--libavcodec/avcodec.h6
-rw-r--r--libavcodec/bink.c1
-rw-r--r--libavcodec/rv34.c4
-rw-r--r--libavcodec/version.h2
-rw-r--r--libavcodec/x86/dct32_sse.asm39
-rw-r--r--libavcodec/x86/fft.c2
-rw-r--r--libavcodec/x86/fft.h1
8 files changed, 41 insertions, 16 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 7fce228193..927d4314fa 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -1791,12 +1791,10 @@ static void windowing_and_mdct_ltp(AACContext *ac, float *out,
} else {
memset(in, 0, 448 * sizeof(float));
ac->dsp.vector_fmul(in + 448, in + 448, swindow_prev, 128);
- memcpy(in + 576, in + 576, 448 * sizeof(float));
}
if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
ac->dsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
} else {
- memcpy(in + 1024, in + 1024, 448 * sizeof(float));
ac->dsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
memset(in + 1024 + 576, 0, 448 * sizeof(float));
}
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 0bb86690bc..2a438ccc13 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -800,6 +800,9 @@ typedef struct AVPacket {
uint8_t *data;
int size;
int stream_index;
+ /**
+ * A combination of AV_PKT_FLAG values
+ */
int flags;
/**
* Additional packet data that can be provided by the container.
@@ -840,7 +843,8 @@ typedef struct AVPacket {
*/
int64_t convergence_duration;
} AVPacket;
-#define AV_PKT_FLAG_KEY 0x0001
+#define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe
+#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
/**
* Audio Video Frame.
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 6b58f7716b..e137312693 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -624,7 +624,6 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
coef_list[--list_start] = ccoef;
mode_list[ list_start] = 3;
} else {
- int t;
if (!bits) {
t = 1 - (get_bits1(gb) << 1);
} else {
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index 2be01041fe..ee9dd7db6b 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -737,8 +737,8 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type,
my = (s->current_picture_ptr->f.motion_val[dir][mv_pos][1] + (3 << 24)) / 3 - (1 << 24);
lx = (s->current_picture_ptr->f.motion_val[dir][mv_pos][0] + (3 << 24)) % 3;
ly = (s->current_picture_ptr->f.motion_val[dir][mv_pos][1] + (3 << 24)) % 3;
- chroma_mx = (s->current_picture_ptr->f.motion_val[dir][mv_pos][0] + 1) >> 1;
- chroma_my = (s->current_picture_ptr->f.motion_val[dir][mv_pos][1] + 1) >> 1;
+ chroma_mx = s->current_picture_ptr->f.motion_val[dir][mv_pos][0] / 2;
+ chroma_my = s->current_picture_ptr->f.motion_val[dir][mv_pos][1] / 2;
umx = (chroma_mx + (3 << 24)) / 3 - (1 << 24);
umy = (chroma_my + (3 << 24)) / 3 - (1 << 24);
uvmx = chroma_coeffs[(chroma_mx + (3 << 24)) % 3];
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 69040a5195..b19e8946d8 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -22,7 +22,7 @@
#define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MINOR 9
-#define LIBAVCODEC_VERSION_MICRO 0
+#define LIBAVCODEC_VERSION_MICRO 1
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavcodec/x86/dct32_sse.asm b/libavcodec/x86/dct32_sse.asm
index 7f5f815591..9a2a6ea88c 100644
--- a/libavcodec/x86/dct32_sse.asm
+++ b/libavcodec/x86/dct32_sse.asm
@@ -63,6 +63,13 @@ ps_p1p1m1m1: dd 0, 0, 0x80000000, 0x80000000, 0, 0, 0x80000000, 0x80000000
mulps %1, %3
%endmacro
+%macro BUTTERFLY0_SSE2 5
+ pshufd %4, %1, %5
+ xorps %1, %2
+ addps %1, %4
+ mulps %1, %3
+%endmacro
+
%macro BUTTERFLY0_AVX 5
vshufps %4, %1, %1, %5
vxorps %1, %1, %2
@@ -405,18 +412,17 @@ INIT_XMM
INIT_XMM
+%macro DCT32_FUNC 1
; void ff_dct32_float_sse(FFTSample *out, const FFTSample *in)
-cglobal dct32_float_sse, 2,3,16, out, in, tmp
+cglobal dct32_float_%1, 2,3,16, out, in, tmp
; pass 1
movaps m0, [inq+0]
- movaps m1, [inq+112]
- shufps m1, m1, 0x1b
+ LOAD_INV m1, [inq+112]
BUTTERFLY m0, m1, [ps_cos_vec], m3
movaps m7, [inq+64]
- movaps m4, [inq+48]
- shufps m4, m4, 0x1b
+ LOAD_INV m4, [inq+48]
BUTTERFLY m7, m4, [ps_cos_vec+32], m3
; pass 2
@@ -427,13 +433,11 @@ cglobal dct32_float_sse, 2,3,16, out, in, tmp
; pass 1
movaps m1, [inq+16]
- movaps m6, [inq+96]
- shufps m6, m6, 0x1b
+ LOAD_INV m6, [inq+96]
BUTTERFLY m1, m6, [ps_cos_vec+16], m3
movaps m4, [inq+80]
- movaps m5, [inq+32]
- shufps m5, m5, 0x1b
+ LOAD_INV m5, [inq+32]
BUTTERFLY m4, m5, [ps_cos_vec+48], m3
; pass 2
@@ -492,3 +496,20 @@ cglobal dct32_float_sse, 2,3,16, out, in, tmp
PASS5
PASS6
RET
+%endmacro
+
+%macro LOAD_INV_SSE 2
+ movaps %1, %2
+ shufps %1, %1, 0x1b
+%endmacro
+
+%define LOAD_INV LOAD_INV_SSE
+DCT32_FUNC sse
+
+%macro LOAD_INV_SSE2 2
+ pshufd %1, %2, 0x1b
+%endmacro
+
+%define LOAD_INV LOAD_INV_SSE2
+%define BUTTERFLY0 BUTTERFLY0_SSE2
+DCT32_FUNC sse2
diff --git a/libavcodec/x86/fft.c b/libavcodec/x86/fft.c
index 18964d88ca..d2d157c2d3 100644
--- a/libavcodec/x86/fft.c
+++ b/libavcodec/x86/fft.c
@@ -60,6 +60,8 @@ av_cold void ff_dct_init_mmx(DCTContext *s)
int has_vectors = av_get_cpu_flags();
if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX)
s->dct32 = ff_dct32_float_avx;
+ else if (has_vectors & AV_CPU_FLAG_SSE2 && HAVE_SSE)
+ s->dct32 = ff_dct32_float_sse2;
else if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE)
s->dct32 = ff_dct32_float_sse;
#endif
diff --git a/libavcodec/x86/fft.h b/libavcodec/x86/fft.h
index 79064c27cd..7fdc858a50 100644
--- a/libavcodec/x86/fft.h
+++ b/libavcodec/x86/fft.h
@@ -35,6 +35,7 @@ void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input)
void ff_imdct_half_sse(FFTContext *s, FFTSample *output, const FFTSample *input);
void ff_imdct_half_avx(FFTContext *s, FFTSample *output, const FFTSample *input);
void ff_dct32_float_sse(FFTSample *out, const FFTSample *in);
+void ff_dct32_float_sse2(FFTSample *out, const FFTSample *in);
void ff_dct32_float_avx(FFTSample *out, const FFTSample *in);
#endif /* AVCODEC_X86_FFT_H */