Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Oct 2011 19:56:46 +0000 (21:56 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Oct 2011 20:24:00 +0000 (22:24 +0200)
* qatar/master:
  proresdsp: fix function prototypes.
  prores-idct: fix overflow in c code.
  fate: update prores-alpha ref after changing pix_fmt to yuv444p10le
  prores: add missing feature warning for alpha
  mov: 10l: Terminate string with 0 not '0'
  mov: Prevent illegal writes when chapter titles are very short.
  prores: add appropriate -fix_fmt parameter to FATE command
  riff: always generate a proper WAVEFORMATEX structure in ff_put_wav_header
  lavc: add a flag-based error_recognition field to AVCodecContext and deprecate non-flag-based ER field
  lavc: rename deprecation symbol FF_API_VERY_AGGRESSIVE to FF_API_ER

Conflicts:
libavcodec/avcodec.h
libavformat/mov.c
tests/fate/prores.mak
tests/ref/acodec/g726
tests/ref/fate/prores-alpha

Merged-by: Michael Niedermayer <michaelni@gmx.at>
13 files changed:
1  2 
libavcodec/avcodec.h
libavcodec/options.c
libavcodec/proresdec_lgpl.c
libavcodec/simple_idct.c
libavcodec/version.h
libavcodec/x86/proresdsp-init.c
libavformat/asfenc.c
libavformat/mov.c
libavformat/riff.c
tests/fate/prores.mak
tests/ref/acodec/g723_1
tests/ref/acodec/g726
tests/ref/acodec/pcm

@@@ -2961,16 -2905,19 +2959,31 @@@ typedef struct AVCodecContext 
      enum AVSampleFormat request_sample_fmt;
  
      /**
+      * Error recognition; may misdetect some more or less valid parts as errors.
+      * - encoding: unused
+      * - decoding: Set by user.
+      */
+ #if FF_API_ER
+     int error_recognition2;
+ #else
+     int error_recognition;
+ #endif /* FF_API_ER */
+ #define AV_ER_CRCCHECK   (1<<0)
+ #define AV_ER_BITSTREAM  (1<<1)
+ #define AV_ER_AGGRESSIVE (1<<2)
+ #define AV_ER_EXPLODE    (1<<3)
++
++    /**
 +     * Current statistics for PTS correction.
 +     * - decoding: maintained and used by libavcodec, not intended to be used by user apps
 +     * - encoding: unused
 +     */
 +    int64_t pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far
 +    int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far
 +    int64_t pts_correction_last_pts;       /// PTS of the last frame
 +    int64_t pts_correction_last_dts;       /// DTS of the last frame
 +
 +
  } AVCodecContext;
  
  /**
Simple merge
Simple merge
Simple merge
Simple merge
  #include "libavcodec/proresdsp.h"
  
  void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
-                                 DCTELEM *block);
+                                 DCTELEM *block, const int16_t *qmat);
  void ff_prores_idct_put_10_sse4(uint16_t *dst, int linesize,
-                                 DCTELEM *block);
+                                 DCTELEM *block, const int16_t *qmat);
  void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize,
-                                 DCTELEM *block);
+                                 DCTELEM *block, const int16_t *qmat);
  
 -void ff_proresdsp_x86_init(ProresDSPContext *dsp)
 +void ff_proresdsp_x86_init(ProresDSPContext *dsp, AVCodecContext *avctx)
  {
 -#if ARCH_X86_64
 +#if ARCH_X86_64 && HAVE_YASM
      int flags = av_get_cpu_flags();
  
 +    if(avctx->flags & CODEC_FLAG_BITEXACT)
 +        return;
 +
      if (flags & AV_CPU_FLAG_SSE2) {
          dsp->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
          dsp->idct_put = ff_prores_idct_put_10_sse2;
Simple merge
@@@ -2433,14 -2369,21 +2433,21 @@@ static void mov_read_chapters(AVFormatC
          // The samples could theoretically be in any encoding if there's an encd
          // atom following, but in practice are only utf-8 or utf-16, distinguished
          // instead by the presence of a BOM
-         ch = avio_rb16(sc->pb);
-         if (ch == 0xfeff)
-             avio_get_str16be(sc->pb, len, title, title_len);
-         else if (ch == 0xfffe)
-             avio_get_str16le(sc->pb, len, title, title_len);
-         else {
-             AV_WB16(title, ch);
-             get_strz(sc->pb, title + 2, len - 1);
+         if (!len) {
+             title[0] = 0;
+         } else {
+             ch = avio_rb16(sc->pb);
+             if (ch == 0xfeff)
+                 avio_get_str16be(sc->pb, len, title, title_len);
+             else if (ch == 0xfffe)
+                 avio_get_str16le(sc->pb, len, title, title_len);
+             else {
+                 AV_WB16(title, ch);
+                 if (len == 1 || len == 2)
+                     title[len] = 0;
+                 else
 -                    avio_get_str(sc->pb, len - 2, title + 2, title_len - 2);
++                    get_strz(sc->pb, title + 2, len - 1);
+             }
          }
  
          ff_new_chapter(s, i, st->time_base, sample->timestamp, end, title);
Simple merge
@@@ -7,9 -7,9 +7,9 @@@ FATE_PRORES = fate-prores-42
  FATE_TESTS += $(FATE_PRORES)
  fate-prores: $(FATE_PRORES)
  
- fate-prores-422:       CMD = framecrc -flags +bitexact -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422.mov
- fate-prores-422_hq:    CMD = framecrc -flags +bitexact -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422_HQ.mov
- fate-prores-422_lt:    CMD = framecrc -flags +bitexact -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422_LT.mov
- fate-prores-422_proxy: CMD = framecrc -flags +bitexact -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422_Proxy.mov
- fate-prores-alpha:     CMD = framecrc -flags +bitexact -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov
 -fate-prores-422:       CMD = framecrc -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422.mov -pix_fmt yuv422p10le
 -fate-prores-422_hq:    CMD = framecrc -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422_HQ.mov -pix_fmt yuv422p10le
 -fate-prores-422_lt:    CMD = framecrc -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422_LT.mov -pix_fmt yuv422p10le
 -fate-prores-422_proxy: CMD = framecrc -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422_Proxy.mov -pix_fmt yuv422p10le
 -fate-prores-alpha:     CMD = framecrc -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt yuv444p10le
++fate-prores-422:       CMD = framecrc -flags +bitexact -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422.mov -pix_fmt yuv422p10le
++fate-prores-422_hq:    CMD = framecrc -flags +bitexact -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422_HQ.mov -pix_fmt yuv422p10le
++fate-prores-422_lt:    CMD = framecrc -flags +bitexact -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422_LT.mov -pix_fmt yuv422p10le
++fate-prores-422_proxy: CMD = framecrc -flags +bitexact -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_422_Proxy.mov -pix_fmt yuv422p10le
++fate-prores-alpha:     CMD = framecrc -flags +bitexact -vsync 0 -i $(SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt yuv444p10le
  
index 2e0f3ef,0000000..57b80dd
mode 100644,000000..100644
--- /dev/null
@@@ -1,4 -1,0 +1,4 @@@
- 2cc429a4383e80070189cf1fb1132501 *./tests/data/g723_1.acodec.out.wav
 +5815887898457847a7717fbe60d9cfb6 *./tests/data/acodec/g723_1.tco
 +4800 ./tests/data/acodec/g723_1.tco
++5d706e32b8e8fa991f2b1a309ea5e917 *./tests/data/g723_1.acodec.out.wav
 +stddev: 8507.20 PSNR: 17.73 MAXDIFF:26473 bytes:    96000/  1058400
@@@ -1,4 -1,4 +1,4 @@@
- 687d70267e999fc9afba2a1ecc960f3c *./tests/data/acodec/g726.wav
- 24052 ./tests/data/acodec/g726.wav
- 700845e9457cae5f961fb703cb46d6a7 *./tests/data/g726.acodec.out.wav
 -64bfac75bd371304b704be5b3dbcd04a *./tests/data/acodec/g726.wav
++331fcf91f4483b508059d0933af97987 *./tests/data/acodec/g726.wav
+ 24054 ./tests/data/acodec/g726.wav
 -79523adfec05760931fda877e1eaf7b4 *./tests/data/g726.acodec.out.wav
 -stddev: 8554.55 PSNR: 17.69 MAXDIFF:29353 bytes:    95984/  1058400
++fac563ba7947d8fc42b4af048707c145 *./tests/data/g726.acodec.out.wav
 +stddev: 8553.69 PSNR: 17.69 MAXDIFF:29353 bytes:    95984/  1058400
@@@ -60,13 -60,13 +60,13 @@@ stddev:    0.00 PSNR:999.99 MAXDIFF
  stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
  ba17c6d1a270e1333e981f239bf7eb45 *./tests/data/acodec/pcm_f64le.wav
  4233680 ./tests/data/acodec/pcm_f64le.wav
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav
64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm.acodec.out.wav
  stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
8c74234928ed425b1171211a89f67ead *./tests/data/acodec/pcm_zork.wav
- 529256 ./tests/data/acodec/pcm_zork.wav
864c8c866ac25642c29a13b122c70709 *./tests/data/pcm.acodec.out.wav
ebd38ed390ebdefe0bdf00d21bf12c6b *./tests/data/acodec/pcm_zork.wav
+ 529258 ./tests/data/acodec/pcm_zork.wav
7b02646acdd063650bb3ebc444543ace *./tests/data/pcm.acodec.out.wav
  stddev:  633.11 PSNR: 40.30 MAXDIFF:32768 bytes:  1058400/  1058400
 -8168a5c1343553ef027541830f2cb879 *./tests/data/acodec/pcm_s24daud.302
 +1b75d5198ae789ab3c48f7024e08f4a9 *./tests/data/acodec/pcm_s24daud.302
  10368730 ./tests/data/acodec/pcm_s24daud.302
 -f552afadfdfcd6348a07095da6382de5 *./tests/data/pcm.acodec.out.wav
 -stddev: 9416.28 PSNR: 16.85 MAXDIFF:42744 bytes:  6911796/  1058400
 +4708f86529c594e29404603c64bb208c *./tests/data/pcm.acodec.out.wav
 +stddev: 8967.92 PSNR: 17.28 MAXDIFF:42548 bytes:  6911796/  1058400