Browse Source

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  build: ppc: drop stray leftover backslash
  build: Only clean the architecture subdirectory we build for.
  build: drop some unnecessary dependencies from the H.264 parser
  build: prettyprinting cosmetics
  libavutil: Remove pointless rational test program.
  libavutil: Remove broken and pointless lzo test program.
  lavf doxy: expand AVStream.codec doxy.
  lavf doxy: improve AVStream.time_base doxy.
  lavf doxy: add some basic documentation about reading from the demuxer.
  lavf doxy: document passing options to demuxers.
  lavf doxy: clarify that an AVPacket contains encoded data.
  mpegtsenc: allow user triggered PES packet flushing
  APIchanges: mark the place where 0.7 was cut.
  APIchanges: mark the place where 0.8 was cut.
  APIchanges: fill in missing dates and hashes.
  smacker: convert palette and header reading to bytestream2.
  alac: convert extradata reading to bytestream2.

Conflicts:
	doc/APIchanges
	libavcodec/smacker.c
	libavcodec/x86/Makefile
	libavfilter/Makefile
	libavutil/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Michael Niedermayer 13 years ago
parent
commit
7e496e1545
10 changed files with 68 additions and 64 deletions
  1. 4 3
      Makefile
  2. 1 1
      configure
  3. 13 6
      doc/APIchanges
  4. 0 2
      libavcodec/Makefile
  5. 20 19
      libavcodec/alac.c
  6. 6 6
      libavcodec/alpha/Makefile
  7. 7 7
      libavcodec/bfin/Makefile
  8. 4 7
      libavcodec/ppc/Makefile
  9. 3 3
      libavcodec/sh4/Makefile
  10. 10 10
      libavcodec/smacker.c

+ 4 - 3
Makefile

@@ -64,9 +64,10 @@ config.h: .config
 	@-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
 	@-tput sgr0 2>/dev/null
 
-SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
-               ALTIVEC-OBJS MMX-OBJS NEON-OBJS YASM-OBJS                  \
-               HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS TOOLS
+SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS      \
+               ARCH_HEADERS BUILT_HEADERS SKIPHEADERS                    \
+               ALTIVEC-OBJS ARMV6-OBJS MMX-OBJS NEON-OBJS YASM-OBJS      \
+               OBJS TESTOBJS
 
 define RESET
 $(1) :=

+ 1 - 1
configure

@@ -1545,7 +1545,7 @@ vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
 vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
 
 # parsers
-h264_parser_select="golomb h264chroma h264dsp h264pred h264qpel"
+h264_parser_select="golomb h264dsp h264pred"
 
 # external libraries
 libaacplus_encoder_deps="libaacplus"

+ 13 - 6
doc/APIchanges

@@ -38,22 +38,23 @@ API changes, most recent first:
 2012-01-24 - xxxxxxx - lavfi 2.60.100
   Add avfilter_graph_dump.
 
-2012-xx-xx - lavc 54.8.0
-  xxxxxxx Add av_get_exact_bits_per_sample()
-  xxxxxxx Add av_get_audio_frame_duration()
+2012-03-05 - lavc 54.8.0
+  6699d07 Add av_get_exact_bits_per_sample()
+  9524cf7 Add av_get_audio_frame_duration()
 
-2012-03-xx - xxxxxxx - lavc 54.7.0 - avcodec.h
+2012-03-04 - 44fe77b - lavc 54.7.0 - avcodec.h
   Add av_codec_is_encoder/decoder().
 
-2012-xx-xx - xxxxxxx - lavc 54.3.0 - avcodec.h
+2012-03-01 - 442c132 - lavc 54.3.0 - avcodec.h
   Add av_packet_shrink_side_data.
 
-2012-xx-xx - xxxxxxx - lavf 54.2.0 - avformat.h
+2012-02-29 - dd2a4bc - lavf 54.2.0 - avformat.h
   Add AVStream.attached_pic and AV_DISPOSITION_ATTACHED_PIC,
   used for dealing with attached pictures/cover art.
 
 2012-02-25 - c9bca80 - lavu 51.24.0 - error.h
   Add AVERROR_UNKNOWN
+  NOTE: this was backported to 0.8
 
 2012-02-20 - e9cda85 - lavc 54.2.0
   Add duration field to AVCodecParserContext
@@ -74,13 +75,16 @@ API changes, most recent first:
 
 2012-01-31 - dd6d3b0 - lavf 54.01.0
   Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags().
+  NOTE: this was backported to 0.8
 
 2012-01-31 - af08d9a - lavc 54.01.0
   Add avcodec_is_open() function.
+  NOTE: this was backported to 0.8
 
 2012-01-30 - 8b93312 - lavu 51.22.0 - intfloat.h
   Add a new installed header libavutil/intfloat.h with int/float punning
   functions.
+  NOTE: this was backported to 0.8
 
 2012-01-25 - lavf 53.22.0
   f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
@@ -286,9 +290,12 @@ API changes, most recent first:
 
 2011-07-10 - a67c061 - lavf 53.6.0
   Add avformat_find_stream_info(), deprecate av_find_stream_info().
+  NOTE: this was backported to 0.7
 
 2011-07-10 - 0b950fe - lavc 53.8.0
   Add avcodec_open2(), deprecate avcodec_open().
+  NOTE: this was backported to 0.7
+
   Add avcodec_alloc_context3. Deprecate avcodec_alloc_context() and
   avcodec_alloc_context2().
 

+ 0 - 2
libavcodec/Makefile

@@ -763,8 +763,6 @@ HOSTPROGS = aac_tablegen aacps_tablegen cbrt_tablegen cos_tablegen      \
             dv_tablegen motionpixels_tablegen mpegaudio_tablegen        \
             pcm_tablegen qdm2_tablegen sinewin_tablegen
 
-DIRS = alpha arm avr32 bfin mips ppc sh4 sparc x86
-
 CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
 
 $(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o

+ 20 - 19
libavcodec/alac.c

@@ -602,29 +602,30 @@ buf_alloc_fail:
 
 static int alac_set_info(ALACContext *alac)
 {
-    const unsigned char *ptr = alac->avctx->extradata;
+    GetByteContext gb;
 
-    ptr += 4; /* size */
-    ptr += 4; /* alac */
-    ptr += 4; /* version */
+    bytestream2_init(&gb, alac->avctx->extradata,
+                     alac->avctx->extradata_size);
 
-    if(AV_RB32(ptr) >= UINT_MAX/4){
-        av_log(alac->avctx, AV_LOG_ERROR, "setinfo_max_samples_per_frame too large\n");
-        return -1;
-    }
+    bytestream2_skipu(&gb, 12); // size:4, alac:4, version:4
 
     /* buffer size / 2 ? */
-    alac->setinfo_max_samples_per_frame = bytestream_get_be32(&ptr);
-    ptr++;                          /* compatible version */
-    alac->setinfo_sample_size           = *ptr++;
-    alac->setinfo_rice_historymult      = *ptr++;
-    alac->setinfo_rice_initialhistory   = *ptr++;
-    alac->setinfo_rice_kmodifier        = *ptr++;
-    alac->numchannels                   = *ptr++;
-    bytestream_get_be16(&ptr);      /* maxRun */
-    bytestream_get_be32(&ptr);      /* max coded frame size */
-    bytestream_get_be32(&ptr);      /* average bitrate */
-    bytestream_get_be32(&ptr);      /* samplerate */
+    alac->setinfo_max_samples_per_frame = bytestream2_get_be32u(&gb);
+    if (alac->setinfo_max_samples_per_frame >= UINT_MAX/4){
+        av_log(alac->avctx, AV_LOG_ERROR,
+               "setinfo_max_samples_per_frame too large\n");
+        return AVERROR_INVALIDDATA;
+    }
+    bytestream2_skipu(&gb, 1);  // compatible version
+    alac->setinfo_sample_size           = bytestream2_get_byteu(&gb);
+    alac->setinfo_rice_historymult      = bytestream2_get_byteu(&gb);
+    alac->setinfo_rice_initialhistory   = bytestream2_get_byteu(&gb);
+    alac->setinfo_rice_kmodifier        = bytestream2_get_byteu(&gb);
+    alac->numchannels                   = bytestream2_get_byteu(&gb);
+    bytestream2_get_be16u(&gb); // maxRun
+    bytestream2_get_be32u(&gb); // max coded frame size
+    bytestream2_get_be32u(&gb); // average bitrate
+    bytestream2_get_be32u(&gb); // samplerate
 
     return 0;
 }

+ 6 - 6
libavcodec/alpha/Makefile

@@ -1,6 +1,6 @@
-OBJS                                   += alpha/dsputil_alpha.o         \
-                                          alpha/dsputil_alpha_asm.o     \
-                                          alpha/motion_est_alpha.o      \
-                                          alpha/motion_est_mvi_asm.o    \
-                                          alpha/mpegvideo_alpha.o       \
-                                          alpha/simple_idct_alpha.o     \
+OBJS += alpha/dsputil_alpha.o                                           \
+        alpha/dsputil_alpha_asm.o                                       \
+        alpha/motion_est_alpha.o                                        \
+        alpha/motion_est_mvi_asm.o                                      \
+        alpha/mpegvideo_alpha.o                                         \
+        alpha/simple_idct_alpha.o                                       \

+ 7 - 7
libavcodec/bfin/Makefile

@@ -1,7 +1,7 @@
-OBJS                                   += bfin/dsputil_bfin.o           \
-                                          bfin/fdct_bfin.o              \
-                                          bfin/idct_bfin.o              \
-                                          bfin/mpegvideo_bfin.o         \
-                                          bfin/pixels_bfin.o            \
-                                          bfin/vp3_bfin.o               \
-                                          bfin/vp3_idct_bfin.o          \
+OBJS += bfin/dsputil_bfin.o                                             \
+        bfin/fdct_bfin.o                                                \
+        bfin/idct_bfin.o                                                \
+        bfin/mpegvideo_bfin.o                                           \
+        bfin/pixels_bfin.o                                              \
+        bfin/vp3_bfin.o                                                 \
+        bfin/vp3_idct_bfin.o                                            \

+ 4 - 7
libavcodec/ppc/Makefile

@@ -1,19 +1,16 @@
 OBJS                                   += ppc/dsputil_ppc.o             \
 
+FFT-OBJS-$(HAVE_GNU_AS)                += ppc/fft_altivec_s.o
+ALTIVEC-OBJS-$(CONFIG_FFT)             += ppc/fft_altivec.o             \
+                                          $(FFT-OBJS-yes)
 ALTIVEC-OBJS-$(CONFIG_H264DSP)         += ppc/h264_altivec.o
+ALTIVEC-OBJS-$(CONFIG_MPEGAUDIODSP)    += ppc/mpegaudiodec_altivec.o
 ALTIVEC-OBJS-$(CONFIG_VC1_DECODER)     += ppc/vc1dsp_altivec.o
 ALTIVEC-OBJS-$(CONFIG_VP3_DECODER)     += ppc/vp3dsp_altivec.o
 ALTIVEC-OBJS-$(CONFIG_VP5_DECODER)     += ppc/vp3dsp_altivec.o
 ALTIVEC-OBJS-$(CONFIG_VP6_DECODER)     += ppc/vp3dsp_altivec.o
 ALTIVEC-OBJS-$(CONFIG_VP8_DECODER)     += ppc/vp8dsp_altivec.o
 
-ALTIVEC-OBJS-$(CONFIG_MPEGAUDIODSP)    += ppc/mpegaudiodec_altivec.o
-
-FFT-OBJS-$(HAVE_GNU_AS)                += ppc/fft_altivec_s.o           \
-
-ALTIVEC-OBJS-$(CONFIG_FFT)             += ppc/fft_altivec.o             \
-                                          $(FFT-OBJS-yes)
-
 OBJS-$(HAVE_ALTIVEC)                   += ppc/dsputil_altivec.o         \
                                           ppc/fdct_altivec.o            \
                                           ppc/float_altivec.o           \

+ 3 - 3
libavcodec/sh4/Makefile

@@ -1,3 +1,3 @@
-OBJS                                   += sh4/dsputil_align.o           \
-                                          sh4/dsputil_sh4.o             \
-                                          sh4/idct_sh4.o                \
+OBJS += sh4/dsputil_align.o                                             \
+        sh4/dsputil_sh4.o                                               \
+        sh4/idct_sh4.o                                                  \

+ 10 - 10
libavcodec/smacker.c

@@ -362,17 +362,17 @@ static av_always_inline int smk_get_code(GetBitContext *gb, int *recode, int *la
 
 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
 {
-    const uint8_t *buf = avpkt->data;
-    int buf_size = avpkt->size;
     SmackVContext * const smk = avctx->priv_data;
     uint8_t *out;
     uint32_t *pal;
+    GetByteContext gb2;
     GetBitContext gb;
     int blocks, blk, bw, bh;
     int i;
     int stride;
+    int flags;
 
-    if(buf_size <= 769)
+    if (avpkt->size <= 769)
         return 0;
 
     smk->pic.reference = 3;
@@ -384,23 +384,23 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
 
     /* make the palette available on the way out */
     pal = (uint32_t*)smk->pic.data[1];
-    smk->pic.palette_has_changed = buf[0] & 1;
-    smk->pic.key_frame = !!(buf[0] & 2);
+    bytestream2_init(&gb2, avpkt->data, avpkt->size);
+    flags = bytestream2_get_byteu(&gb2);
+    smk->pic.palette_has_changed = flags & 1;
+    smk->pic.key_frame = !!(flags & 2);
     if(smk->pic.key_frame)
         smk->pic.pict_type = AV_PICTURE_TYPE_I;
     else
         smk->pic.pict_type = AV_PICTURE_TYPE_P;
 
-    buf++;
     for(i = 0; i < 256; i++)
-        *pal++ = 0xFF << 24 | bytestream_get_be24(&buf);
-    buf_size -= 769;
+        *pal++ = 0xFF << 24 | bytestream2_get_be24u(&gb2);
 
     last_reset(smk->mmap_tbl, smk->mmap_last);
     last_reset(smk->mclr_tbl, smk->mclr_last);
     last_reset(smk->full_tbl, smk->full_last);
     last_reset(smk->type_tbl, smk->type_last);
-    init_get_bits(&gb, buf, buf_size * 8);
+    init_get_bits(&gb, avpkt->data + 769, (avpkt->size - 769) * 8);
 
     blk = 0;
     bw = avctx->width >> 2;
@@ -511,7 +511,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
     *(AVFrame*)data = smk->pic;
 
     /* always report that the buffer was completely consumed */
-    return buf_size;
+    return avpkt->size;
 }
 
 

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