Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 21 Dec 2011 01:46:08 +0000 (02:46 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 21 Dec 2011 02:40:53 +0000 (03:40 +0100)
* qatar/master:
  lavc: always align height by 32 pixel
  raw: add 10bit YUV definitions
  nut: support 10bit YUV
  mpegvideo_enc: separate declarations and statements
  oma: make header compile standalone
  vp3: Reorder some functions to fix VP3 build with Theora disabled.
  build: fix standalone compilation of ADX encoder
  build: fix standalone compilation of ADPCM decoders
  build: fix standalone compilation of mpc7/mpc8 decoders
  4xm: Use bytestream2 functions to prevent overreads
  bytestream: add a new set of bytestream functions with overread checking
  mpegts: Suppress invalid timebase warnings on DMB streams.
  mpegts: Fix typo in handling sections in the PMT.
  vc1dec: Use the right pointer type for the tmp pointer

Conflicts:
libavcodec/4xm.c
libavcodec/utils.c
libavcodec/vc1dec.c
libavcodec/vp3.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
16 files changed:
1  2 
configure
libavcodec/4xm.c
libavcodec/Makefile
libavcodec/bytestream.h
libavcodec/mpegvideo_enc.c
libavcodec/raw.c
libavcodec/utils.c
libavcodec/vc1dec.c
libavcodec/vp3.c
libavformat/mpegts.c
libavformat/nut.c
tests/ref/lavfi/pixdesc
tests/ref/lavfi/pixfmts_copy
tests/ref/lavfi/pixfmts_null
tests/ref/lavfi/pixfmts_scale
tests/ref/lavfi/pixfmts_vflip

diff --cc configure
Simple merge
@@@ -330,11 -328,7 +328,11 @@@ static void decode_p_block(FourXContex
      assert(code>=0 && code<=6);
  
      if(code == 0){
-         if (f->bytestream_end - f->bytestream < 1){
 -        src += f->mv[bytestream2_get_byte(&f->g)];
++        if (f->g.buffer_end - f->g.buffer < 1){
 +            av_log(f->avctx, AV_LOG_ERROR, "bytestream overread\n");
 +            return;
 +        }
-         src += f->mv[ *f->bytestream++ ];
++        src += f->mv[ *f->g.buffer++ ];
          if(start > src || src > end){
              av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
              return;
      }else if(code == 3 && f->version<2){
          mcdc(dst, src, log2w, h, stride, 1, 0);
      }else if(code == 4){
-         if (f->bytestream_end - f->bytestream < 1){
 -        src += f->mv[bytestream2_get_byte(&f->g)];
++        if (f->g.buffer_end - f->g.buffer < 1){
 +            av_log(f->avctx, AV_LOG_ERROR, "bytestream overread\n");
 +            return;
 +        }
-         src += f->mv[ *f->bytestream++ ];
++        src += f->mv[ *f->g.buffer++ ];
          if(start > src || src > end){
              av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n");
              return;
          }
-         if (f->wordstream_end - f->wordstream < 1){
++        if (f->g2.buffer_end - f->g2.buffer < 1){
 +            av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
 +            return;
 +        }
-         mcdc(dst, src, log2w, h, stride, 1, av_le2ne16(*f->wordstream++));
+         mcdc(dst, src, log2w, h, stride, 1, bytestream2_get_le16(&f->g2));
      }else if(code == 5){
-         if (f->wordstream_end - f->wordstream < 1){
++        if (f->g2.buffer_end - f->g2.buffer < 1){
 +            av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
 +            return;
 +        }
-         mcdc(dst, src, log2w, h, stride, 0, av_le2ne16(*f->wordstream++));
+         mcdc(dst, src, log2w, h, stride, 0, bytestream2_get_le16(&f->g2));
      }else if(code == 6){
-         if (f->wordstream_end - f->wordstream < 2){
++        if (f->g2.buffer_end - f->g2.buffer < 2){
 +            av_log(f->avctx, AV_LOG_ERROR, "wordstream overread\n");
 +            return;
 +        }
          if(log2w){
-             dst[0] = av_le2ne16(*f->wordstream++);
-             dst[1] = av_le2ne16(*f->wordstream++);
+             dst[0] = bytestream2_get_le16(&f->g2);
+             dst[1] = bytestream2_get_le16(&f->g2);
          }else{
-             dst[0     ] = av_le2ne16(*f->wordstream++);
-             dst[stride] = av_le2ne16(*f->wordstream++);
+             dst[0     ] = bytestream2_get_le16(&f->g2);
+             dst[stride] = bytestream2_get_le16(&f->g2);
          }
      }
  }
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -5426,17 -5426,13 +5426,16 @@@ static int vc1_decode_frame(AVCodecCont
      AVFrame *pict = data;
      uint8_t *buf2 = NULL;
      const uint8_t *buf_start = buf;
-     uint8_t *tmp;
 -    int mb_height, n_slices1;
 +    int mb_height, n_slices1=-1;
      struct {
          uint8_t *buf;
          GetBitContext gb;
          int mby_start;
-     } *slices = NULL;
+     } *slices = NULL, *tmp;
  
 +    if(s->flags & CODEC_FLAG_LOW_DELAY)
 +        s->low_delay = 1;
 +
      /* no supplementary picture */
      if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == VC1_CODE_ENDOFSEQ)) {
          /* special case for last picture */
@@@ -2000,45 -2049,6 +2054,8 @@@ error
      return -1;
  }
  
- static av_cold int vp3_decode_end(AVCodecContext *avctx)
- {
-     Vp3DecodeContext *s = avctx->priv_data;
-     int i;
-     av_free(s->superblock_coding);
-     av_free(s->all_fragments);
-     av_free(s->coded_fragment_list[0]);
-     av_free(s->dct_tokens_base);
-     av_free(s->superblock_fragments);
-     av_free(s->macroblock_coding);
-     av_free(s->motion_val[0]);
-     av_free(s->motion_val[1]);
-     av_free(s->edge_emu_buffer);
-     if (avctx->internal->is_copy)
-         return 0;
-     for (i = 0; i < 16; i++) {
-         free_vlc(&s->dc_vlc[i]);
-         free_vlc(&s->ac_vlc_1[i]);
-         free_vlc(&s->ac_vlc_2[i]);
-         free_vlc(&s->ac_vlc_3[i]);
-         free_vlc(&s->ac_vlc_4[i]);
-     }
-     free_vlc(&s->superblock_run_length_vlc);
-     free_vlc(&s->fragment_run_length_vlc);
-     free_vlc(&s->mode_code_vlc);
-     free_vlc(&s->motion_vector_vlc);
-     /* release all frames */
-     vp3_decode_flush(avctx);
-     return 0;
- }
 +static void vp3_decode_flush(AVCodecContext *avctx);
 +
  static int read_huffman_tree(AVCodecContext *avctx, GetBitContext *gb)
  {
      Vp3DecodeContext *s = avctx->priv_data;
Simple merge
Simple merge
@@@ -35,23 -31,23 +35,23 @@@ uyvy422             adcf64516a19fce44df
  yuv410p             2d9225153c83ee1132397d619d94d1b3
  yuv411p             8b298af3e43348ca1b11eb8a3252ac6c
  yuv420p             eba2f135a08829387e2f698ff72a2939
- yuv420p10be         ea2aee509286fa3d07a6c68fec9967a5
- yuv420p10le         645ef73e06de41c83a7bc724179d2ce3
 -yuv420p10be         7605e266c088d0fcf68c7b27c3ceff5f
 -yuv420p10le         4228ee628c6deec123a13b9784516cc7
 -yuv420p16be         16c009a235cd52b74791a895423152a3
 -yuv420p16le         2d59c4f1d0314a5a957a7cfc4b6fabcc
 -yuv420p9be          ce880fa07830e5297c22acf6e20555ce
 -yuv420p9le          16543fda8f87d94a6cf857d2e8d4461a
++yuv420p10be         2f88c301feeaccd2a5fb55f54fc30be9
++yuv420p10le         93f175084af4e78f97c7710e505f3057
 +yuv420p16be         ba858ff4246368c28f03152487f57ef3
 +yuv420p16le         de239729a4fe1d4cfa3743e006654e78
 +yuv420p9be          64e36fd90573f67ac2006d103972a79b
 +yuv420p9le          9ed4b1dfabc53fd9e586ff6c4c43af80
  yuv422p             c9bba4529821d796a6ab09f6a5fd355a
--yuv422p10be         bdc13b630fd668b34c6fe1aae28dfc71
--yuv422p10le         d0607c260a45c973e6639f4e449730ad
++yuv422p10be         11af7dfafe8bc025c7e3bd82b830fe8a
++yuv422p10le         ec04efb76efa79bf0d02b21572371a56
  yuv422p16be         5499502e1c29534a158a1fe60e889f60
  yuv422p16le         e3d61fde6978591596bc36b914386623
  yuv422p9be          29b71579946940a8c00fa844c9dff507
  yuv422p9le          062b7f9cbb972bf36b5bdb1a7623701a
  yuv440p             5a064afe2b453bb52cdb3f176b1aa1cf
  yuv444p             0a98447b78fd476aa39686da6a74fa2e
--yuv444p10be         e65cbae7e4f1892c23defbc8e8052cf6
--yuv444p10le         767179dd82846cf00ee4c340c9c1ab74
++yuv444p10be         71be185a2fb7a353eb024df9bc63212d
++yuv444p10le         c1c6b30a12065c7901c0a267e4861a0f
  yuv444p16be         1c6ea2c2f5e539006112ceec3d4e7d90
  yuv444p16le         20f86bc2f68d2b3f1f2b48b97b2189f4
  yuv444p9be          6ab31f4c12b533ce318ecdff83cdd054
@@@ -36,23 -31,23 +36,23 @@@ uyvy422             adcf64516a19fce44df
  yuv410p             2d9225153c83ee1132397d619d94d1b3
  yuv411p             8b298af3e43348ca1b11eb8a3252ac6c
  yuv420p             eba2f135a08829387e2f698ff72a2939
- yuv420p10be         ea2aee509286fa3d07a6c68fec9967a5
- yuv420p10le         645ef73e06de41c83a7bc724179d2ce3
 -yuv420p10be         7605e266c088d0fcf68c7b27c3ceff5f
 -yuv420p10le         4228ee628c6deec123a13b9784516cc7
 -yuv420p16be         16c009a235cd52b74791a895423152a3
 -yuv420p16le         2d59c4f1d0314a5a957a7cfc4b6fabcc
 -yuv420p9be          ce880fa07830e5297c22acf6e20555ce
 -yuv420p9le          16543fda8f87d94a6cf857d2e8d4461a
++yuv420p10be         2f88c301feeaccd2a5fb55f54fc30be9
++yuv420p10le         93f175084af4e78f97c7710e505f3057
 +yuv420p16be         ba858ff4246368c28f03152487f57ef3
 +yuv420p16le         de239729a4fe1d4cfa3743e006654e78
 +yuv420p9be          64e36fd90573f67ac2006d103972a79b
 +yuv420p9le          9ed4b1dfabc53fd9e586ff6c4c43af80
  yuv422p             c9bba4529821d796a6ab09f6a5fd355a
--yuv422p10be         bdc13b630fd668b34c6fe1aae28dfc71
--yuv422p10le         d0607c260a45c973e6639f4e449730ad
++yuv422p10be         11af7dfafe8bc025c7e3bd82b830fe8a
++yuv422p10le         ec04efb76efa79bf0d02b21572371a56
  yuv422p16be         5499502e1c29534a158a1fe60e889f60
  yuv422p16le         e3d61fde6978591596bc36b914386623
  yuv422p9be          29b71579946940a8c00fa844c9dff507
  yuv422p9le          062b7f9cbb972bf36b5bdb1a7623701a
  yuv440p             5a064afe2b453bb52cdb3f176b1aa1cf
  yuv444p             0a98447b78fd476aa39686da6a74fa2e
--yuv444p10be         e65cbae7e4f1892c23defbc8e8052cf6
--yuv444p10le         767179dd82846cf00ee4c340c9c1ab74
++yuv444p10be         71be185a2fb7a353eb024df9bc63212d
++yuv444p10le         c1c6b30a12065c7901c0a267e4861a0f
  yuv444p16be         1c6ea2c2f5e539006112ceec3d4e7d90
  yuv444p16le         20f86bc2f68d2b3f1f2b48b97b2189f4
  yuv444p9be          6ab31f4c12b533ce318ecdff83cdd054
@@@ -36,23 -31,23 +36,23 @@@ uyvy422             adcf64516a19fce44df
  yuv410p             2d9225153c83ee1132397d619d94d1b3
  yuv411p             8b298af3e43348ca1b11eb8a3252ac6c
  yuv420p             eba2f135a08829387e2f698ff72a2939
- yuv420p10be         ea2aee509286fa3d07a6c68fec9967a5
- yuv420p10le         645ef73e06de41c83a7bc724179d2ce3
 -yuv420p10be         7605e266c088d0fcf68c7b27c3ceff5f
 -yuv420p10le         4228ee628c6deec123a13b9784516cc7
 -yuv420p16be         16c009a235cd52b74791a895423152a3
 -yuv420p16le         2d59c4f1d0314a5a957a7cfc4b6fabcc
 -yuv420p9be          ce880fa07830e5297c22acf6e20555ce
 -yuv420p9le          16543fda8f87d94a6cf857d2e8d4461a
++yuv420p10be         2f88c301feeaccd2a5fb55f54fc30be9
++yuv420p10le         93f175084af4e78f97c7710e505f3057
 +yuv420p16be         ba858ff4246368c28f03152487f57ef3
 +yuv420p16le         de239729a4fe1d4cfa3743e006654e78
 +yuv420p9be          64e36fd90573f67ac2006d103972a79b
 +yuv420p9le          9ed4b1dfabc53fd9e586ff6c4c43af80
  yuv422p             c9bba4529821d796a6ab09f6a5fd355a
--yuv422p10be         bdc13b630fd668b34c6fe1aae28dfc71
--yuv422p10le         d0607c260a45c973e6639f4e449730ad
++yuv422p10be         11af7dfafe8bc025c7e3bd82b830fe8a
++yuv422p10le         ec04efb76efa79bf0d02b21572371a56
  yuv422p16be         5499502e1c29534a158a1fe60e889f60
  yuv422p16le         e3d61fde6978591596bc36b914386623
  yuv422p9be          29b71579946940a8c00fa844c9dff507
  yuv422p9le          062b7f9cbb972bf36b5bdb1a7623701a
  yuv440p             5a064afe2b453bb52cdb3f176b1aa1cf
  yuv444p             0a98447b78fd476aa39686da6a74fa2e
--yuv444p10be         e65cbae7e4f1892c23defbc8e8052cf6
--yuv444p10le         767179dd82846cf00ee4c340c9c1ab74
++yuv444p10be         71be185a2fb7a353eb024df9bc63212d
++yuv444p10le         c1c6b30a12065c7901c0a267e4861a0f
  yuv444p16be         1c6ea2c2f5e539006112ceec3d4e7d90
  yuv444p16le         20f86bc2f68d2b3f1f2b48b97b2189f4
  yuv444p9be          6ab31f4c12b533ce318ecdff83cdd054
@@@ -36,23 -31,23 +36,23 @@@ uyvy422             314bd486277111a95d9
  yuv410p             7df8f6d69b56a8dcb6c7ee908e5018b5
  yuv411p             1143e7c5cc28fe0922b051b17733bc4c
  yuv420p             fdad2d8df8985e3d17e73c71f713cb14
- yuv420p10be         6d335e75b553da590135cf8bb999610c
- yuv420p10le         d510ddbabefd03ef39ec943fcb51b709
 -yuv420p10be         c143e77e97d2f7d62c3b518857ba9f9b
 -yuv420p10le         72d90eccf5c34691ff057dafb7447aa2
 -yuv420p16be         d7270efce54eb59c7b01c14157a1b890
 -yuv420p16le         e85abf00bad940a922b623c91c9026d7
 -yuv420p9be          bb87fddca65d1742412c8d2b1caf96c6
 -yuv420p9le          828eec50014a41258a5423c1fe56ac97
++yuv420p10be         418039dbd82cf612db88417276aa0d1a
++yuv420p10le         ff7e5321208ab995b4f95634ebdf192b
 +yuv420p16be         31988e9a5d6acacaa710f67bc1172f3a
 +yuv420p16le         f5390ce399f88e0e4e2621ed7833b250
 +yuv420p9be          ec4983b7a949c0472110a7a2c58e278a
 +yuv420p9le          c136dce5913a722eee44ab72cff664b2
  yuv422p             918e37701ee7377d16a8a6c119c56a40
--yuv422p10be         cea7ca6b0e66d6f29539885896c88603
--yuv422p10le         a10c4a5837547716f13cd61918b145f9
++yuv422p10be         315654908d50718e175aae018c484732
++yuv422p10le         91bbc78a9a56f659b55abc17722dcc09
  yuv422p16be         e7e34fe9264784763ab6cb406524c0f3
  yuv422p16le         c435b76b08204dda6908640fb5fd4621
  yuv422p9be          82494823944912f73cebc58ad2979bbd
  yuv422p9le          fc69c8a21f473916a4b4225636b97e06
  yuv440p             461503fdb9b90451020aa3b25ddf041c
  yuv444p             81b2eba962d12e8d64f003ac56f6faf2
--yuv444p10be         e9d3c8e744b8b0d8187ca092fa203fc9
--yuv444p10le         02f0a336e9da062a64df1ba487e102c5
++yuv444p10be         fb304d77c6d2e18df5938662a22176f0
++yuv444p10le         b17136913eb066dca6be6af645b9f7e8
  yuv444p16be         0da9bed80f5542682ab286f3261cf24c
  yuv444p16le         a0c5d3c7bf3f181db503cf8e450d1335
  yuv444p9be          9ac2643ce7f7e5c4e17c8c9fd8494d4a
@@@ -36,23 -31,23 +36,23 @@@ uyvy422             ffbd36720c77398d9a0
  yuv410p             7bfb39d7afb49d6a6173e6b23ae321eb
  yuv411p             4a90048cc3a65fac150e53289700efe1
  yuv420p             2e6d6062e8cad37fb3ab2c433b55f382
- yuv420p10be         fac8e0ae5a81861cddac97ddc4100b66
- yuv420p10le         cb83ed3552113e0292e30adee774359c
 -yuv420p10be         df97d20b3b4a10c174d4360552c4160d
 -yuv420p10le         4b5249208602b941332945c926f80ae9
 -yuv420p16be         539076782902664a8acf381bf4f713e8
 -yuv420p16le         0f609e588e5a258644ef85170d70e030
 -yuv420p9be          be40ec975fb2873891643cbbbddbc3b0
 -yuv420p9le          7e606310d3f5ff12badf911e8f333471
++yuv420p10be         7ce787a888381dd46b0212c099ecaad9
++yuv420p10le         bf22a1c543a7b3dbc556a0eb9592e179
 +yuv420p16be         b6d25ba55bc1831d352f379311b42b6d
 +yuv420p16le         1d7ef427b6f79a02b93948738dab5442
 +yuv420p9be          9865bf5c4392b56b1c4eb4f5a3fd32f9
 +yuv420p9le          0f1e371a1374d3cba2205b70cc7cac90
  yuv422p             d7f5cb44d9b0210d66d6a8762640ab34
--yuv422p10be         588fe319b96513c32e21d3e32b45447f
--yuv422p10le         11b57f2bd9661024153f3973b9090cdb
++yuv422p10be         0be8378c3773e1c0b394315ef4994351
++yuv422p10le         6518094fe8de6bee95af21af1e5dc1e1
  yuv422p16be         9bd8f8c961822b586fa4cf992be54acc
  yuv422p16le         9c4a1239605c7952b736ac3130163f14
  yuv422p9be          7c6f1e140b3999ee7d923854e507752a
  yuv422p9le          51f10d79c07989060dd06e767e6d7d60
  yuv440p             876385e96165acf51271b20e5d85a416
  yuv444p             9c3c667d1613b72d15bc6d851c5eb8f7
--yuv444p10be         944a4997c4edb3a8dd0f0493cfd5a1fd
--yuv444p10le         2d0947ae89ecc6a501eee6832cb27e06
++yuv444p10be         ee069cc6db48975eb029d72f889a7fe6
++yuv444p10le         645b3335248113cafe3c29edb1d7f3be
  yuv444p16be         de2dedfc6f12073ffead113f86e07ecf
  yuv444p16le         8e83323cf102d6c823a03ae8a7b7e033
  yuv444p9be          6ac92b7dc9ab2fc59bee99204886899a