Browse Source

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>
Michael Niedermayer 13 years ago
parent
commit
1d186e9e12

+ 3 - 0
doc/APIchanges

@@ -13,6 +13,9 @@ libavutil:   2011-04-18
 
 
 API changes, most recent first:
 API changes, most recent first:
 
 
+2011-08-02 - 9d39cbf - lavc 53.7.1
+  Add AV_PKT_FLAG_CORRUPT AVPacket flag.
+
 2011-07-16 - xxxxxx - lavfi 2.27.0
 2011-07-16 - xxxxxx - lavfi 2.27.0
   Add audio packing negotiation fields and helper functions.
   Add audio packing negotiation fields and helper functions.
 
 

+ 0 - 2
libavcodec/aacdec.c

@@ -1791,12 +1791,10 @@ static void windowing_and_mdct_ltp(AACContext *ac, float *out,
     } else {
     } else {
         memset(in, 0, 448 * sizeof(float));
         memset(in, 0, 448 * sizeof(float));
         ac->dsp.vector_fmul(in + 448, in + 448, swindow_prev, 128);
         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) {
     if (ics->window_sequence[0] != LONG_START_SEQUENCE) {
         ac->dsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
         ac->dsp.vector_fmul_reverse(in + 1024, in + 1024, lwindow, 1024);
     } else {
     } else {
-        memcpy(in + 1024, in + 1024, 448 * sizeof(float));
         ac->dsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
         ac->dsp.vector_fmul_reverse(in + 1024 + 448, in + 1024 + 448, swindow, 128);
         memset(in + 1024 + 576, 0, 448 * sizeof(float));
         memset(in + 1024 + 576, 0, 448 * sizeof(float));
     }
     }

+ 5 - 1
libavcodec/avcodec.h

@@ -800,6 +800,9 @@ typedef struct AVPacket {
     uint8_t *data;
     uint8_t *data;
     int   size;
     int   size;
     int   stream_index;
     int   stream_index;
+    /**
+     * A combination of AV_PKT_FLAG values
+     */
     int   flags;
     int   flags;
     /**
     /**
      * Additional packet data that can be provided by the container.
      * Additional packet data that can be provided by the container.
@@ -840,7 +843,8 @@ typedef struct AVPacket {
      */
      */
     int64_t convergence_duration;
     int64_t convergence_duration;
 } AVPacket;
 } 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.
  * Audio Video Frame.

+ 0 - 1
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;
                         coef_list[--list_start] = ccoef;
                         mode_list[  list_start] = 3;
                         mode_list[  list_start] = 3;
                     } else {
                     } else {
-                        int t;
                         if (!bits) {
                         if (!bits) {
                             t = 1 - (get_bits1(gb) << 1);
                             t = 1 - (get_bits1(gb) << 1);
                         } else {
                         } else {

+ 2 - 2
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);
         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;
         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;
         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);
         umx = (chroma_mx + (3 << 24)) / 3 - (1 << 24);
         umy = (chroma_my + (3 << 24)) / 3 - (1 << 24);
         umy = (chroma_my + (3 << 24)) / 3 - (1 << 24);
         uvmx = chroma_coeffs[(chroma_mx + (3 << 24)) % 3];
         uvmx = chroma_coeffs[(chroma_mx + (3 << 24)) % 3];

+ 1 - 1
libavcodec/version.h

@@ -22,7 +22,7 @@
 
 
 #define LIBAVCODEC_VERSION_MAJOR 53
 #define LIBAVCODEC_VERSION_MAJOR 53
 #define LIBAVCODEC_VERSION_MINOR  9
 #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, \
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
                                                LIBAVCODEC_VERSION_MINOR, \

+ 30 - 9
libavcodec/x86/dct32_sse.asm

@@ -63,6 +63,13 @@ ps_p1p1m1m1: dd 0, 0, 0x80000000, 0x80000000, 0, 0, 0x80000000, 0x80000000
     mulps  %1, %3
     mulps  %1, %3
 %endmacro
 %endmacro
 
 
+%macro BUTTERFLY0_SSE2 5
+    pshufd %4, %1, %5
+    xorps  %1, %2
+    addps  %1, %4
+    mulps  %1, %3
+%endmacro
+
 %macro BUTTERFLY0_AVX 5
 %macro BUTTERFLY0_AVX 5
     vshufps %4, %1, %1, %5
     vshufps %4, %1, %1, %5
     vxorps  %1, %1, %2
     vxorps  %1, %1, %2
@@ -405,18 +412,17 @@ INIT_XMM
 
 
 
 
 INIT_XMM
 INIT_XMM
+%macro DCT32_FUNC 1
 ; void ff_dct32_float_sse(FFTSample *out, const FFTSample *in)
 ; 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
     ; pass 1
 
 
     movaps      m0, [inq+0]
     movaps      m0, [inq+0]
-    movaps      m1, [inq+112]
-    shufps      m1, m1, 0x1b
+    LOAD_INV    m1, [inq+112]
     BUTTERFLY   m0, m1, [ps_cos_vec], m3
     BUTTERFLY   m0, m1, [ps_cos_vec], m3
 
 
     movaps      m7, [inq+64]
     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
     BUTTERFLY   m7, m4, [ps_cos_vec+32], m3
 
 
     ; pass 2
     ; pass 2
@@ -427,13 +433,11 @@ cglobal dct32_float_sse, 2,3,16, out, in, tmp
 
 
     ; pass 1
     ; pass 1
     movaps      m1, [inq+16]
     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
     BUTTERFLY   m1, m6, [ps_cos_vec+16], m3
 
 
     movaps      m4, [inq+80]
     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
     BUTTERFLY   m4, m5, [ps_cos_vec+48], m3
 
 
     ; pass 2
     ; pass 2
@@ -492,3 +496,20 @@ cglobal dct32_float_sse, 2,3,16, out, in, tmp
     PASS5
     PASS5
     PASS6
     PASS6
     RET
     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

+ 2 - 0
libavcodec/x86/fft.c

@@ -60,6 +60,8 @@ av_cold void ff_dct_init_mmx(DCTContext *s)
     int has_vectors = av_get_cpu_flags();
     int has_vectors = av_get_cpu_flags();
     if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX)
     if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX)
         s->dct32 = ff_dct32_float_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)
     else if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE)
         s->dct32 = ff_dct32_float_sse;
         s->dct32 = ff_dct32_float_sse;
 #endif
 #endif

+ 1 - 0
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_sse(FFTContext *s, FFTSample *output, const FFTSample *input);
 void ff_imdct_half_avx(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_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);
 void ff_dct32_float_avx(FFTSample *out, const FFTSample *in);
 
 
 #endif /* AVCODEC_X86_FFT_H */
 #endif /* AVCODEC_X86_FFT_H */

+ 1 - 0
libavformat/avformat.h

@@ -774,6 +774,7 @@ typedef struct AVFormatContext {
 #define AVFMT_FLAG_RTP_HINT     0x0040 ///< Deprecated, use the -movflags rtphint muxer specific AVOption instead
 #define AVFMT_FLAG_RTP_HINT     0x0040 ///< Deprecated, use the -movflags rtphint muxer specific AVOption instead
 #endif
 #endif
 #define AVFMT_FLAG_CUSTOM_IO    0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
 #define AVFMT_FLAG_CUSTOM_IO    0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
+#define AVFMT_FLAG_DISCARD_CORRUPT  0x0100 ///< Discard frames marked corrupted
 #define AVFMT_FLAG_MP4A_LATM    0x8000 ///< Enable RTP MP4A-LATM payload
 #define AVFMT_FLAG_MP4A_LATM    0x8000 ///< Enable RTP MP4A-LATM payload
 #define AVFMT_FLAG_SORT_DTS    0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
 #define AVFMT_FLAG_SORT_DTS    0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
 #define AVFMT_FLAG_PRIV_OPT    0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted)
 #define AVFMT_FLAG_PRIV_OPT    0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted)

Some files were not shown because too many files changed in this diff