diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-26 20:34:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-26 20:52:52 +0200 |
commit | 7e496e154583b5fe11ccf04b833c418b22f05ca4 (patch) | |
tree | 51ff1dc2484ab90ede1d715d30e935ce22b1af7d /libavcodec | |
parent | 60497cb984221268ef95d2b63476f4f3379fb7e2 (diff) | |
parent | 72ccfb3cb7a85d35cfe2c99ab53e981974e599cd (diff) | |
download | ffmpeg-7e496e154583b5fe11ccf04b833c418b22f05ca4.tar.gz |
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>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/Makefile | 2 | ||||
-rw-r--r-- | libavcodec/alac.c | 39 | ||||
-rw-r--r-- | libavcodec/alpha/Makefile | 12 | ||||
-rw-r--r-- | libavcodec/bfin/Makefile | 14 | ||||
-rw-r--r-- | libavcodec/ppc/Makefile | 11 | ||||
-rw-r--r-- | libavcodec/sh4/Makefile | 6 | ||||
-rw-r--r-- | libavcodec/smacker.c | 20 | ||||
-rw-r--r-- | libavcodec/sparc/Makefile | 4 | ||||
-rw-r--r-- | libavcodec/x86/Makefile | 100 |
9 files changed, 98 insertions, 110 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile index ec29ce5ef1..ba7b4b8963 100644 --- a/libavcodec/Makefile +++ b/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 diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 83e0d810e6..8ba7b805ad 100644 --- a/libavcodec/alac.c +++ b/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; } diff --git a/libavcodec/alpha/Makefile b/libavcodec/alpha/Makefile index 2779a2316a..e55fe49b7b 100644 --- a/libavcodec/alpha/Makefile +++ b/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 \ diff --git a/libavcodec/bfin/Makefile b/libavcodec/bfin/Makefile index e50e3cd669..6b3e7cf67c 100644 --- a/libavcodec/bfin/Makefile +++ b/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 \ diff --git a/libavcodec/ppc/Makefile b/libavcodec/ppc/Makefile index 8e37fc791d..d15fe2a1c9 100644 --- a/libavcodec/ppc/Makefile +++ b/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 \ diff --git a/libavcodec/sh4/Makefile b/libavcodec/sh4/Makefile index 142cba47d1..aa17eabd6e 100644 --- a/libavcodec/sh4/Makefile +++ b/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 \ diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 3c979ebbfa..04994b2d0c 100644 --- a/libavcodec/smacker.c +++ b/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; } diff --git a/libavcodec/sparc/Makefile b/libavcodec/sparc/Makefile index 4b387461c2..d42bed0779 100644 --- a/libavcodec/sparc/Makefile +++ b/libavcodec/sparc/Makefile @@ -1,2 +1,2 @@ -OBJS-$(HAVE_VIS) += sparc/dsputil_vis.o \ - sparc/simple_idct_vis.o \ +OBJS-$(HAVE_VIS) += sparc/dsputil_vis.o \ + sparc/simple_idct_vis.o \ diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile index 267cf241b7..b0a1c7ef77 100644 --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -1,8 +1,46 @@ OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o OBJS-$(CONFIG_TRUEHD_DECODER) += x86/mlpdsp.o +OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o -YASM-OBJS-$(CONFIG_DCT) += x86/dct32_sse.o +OBJS-$(HAVE_MMX) += x86/dsputil_mmx.o \ + x86/fdct_mmx.o \ + x86/fmtconvert_mmx.o \ + x86/idct_mmx_xvid.o \ + x86/idct_sse2_xvid.o \ + x86/motion_est_mmx.o \ + x86/mpegvideo_mmx.o \ + x86/simple_idct_mmx.o \ +MMX-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o +MMX-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_mmx.o +MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp_mmx.o +MMX-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhd_mmx.o +MMX-OBJS-$(CONFIG_DWT) += x86/snowdsp_mmx.o \ + x86/dwt.o +MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o +MMX-OBJS-$(CONFIG_FFT) += x86/fft.o +MMX-OBJS-$(CONFIG_GPL) += x86/idct_mmx.o +MMX-OBJS-$(CONFIG_H264DSP) += x86/h264dsp_mmx.o +MMX-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o +MMX-OBJS-$(CONFIG_LPC) += x86/lpc_mmx.o +MMX-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodec_mmx.o +MMX-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp-init.o +MMX-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp-init.o +MMX-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp-init.o +MMX-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp_init.o +MMX-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp_init.o \ + x86/rv40dsp_init.o +MMX-OBJS-$(CONFIG_V210_DECODER) += x86/v210-init.o +MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o +MMX-OBJS-$(CONFIG_VP5_DECODER) += x86/vp56dsp_init.o +MMX-OBJS-$(CONFIG_VP6_DECODER) += x86/vp56dsp_init.o +MMX-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp-init.o + +YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o +YASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o +YASM-OBJS-$(CONFIG_DCT) += x86/dct32_sse.o +YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_mmx.o x86/diracdsp_yasm.o +YASM-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_yasm.o YASM-OBJS-FFT-$(HAVE_AMD3DNOW) += x86/fft_3dn.o YASM-OBJS-FFT-$(HAVE_AMD3DNOWEXT) += x86/fft_3dn2.o YASM-OBJS-FFT-$(HAVE_SSE) += x86/fft_sse.o @@ -10,79 +48,33 @@ YASM-OBJS-$(CONFIG_FFT) += x86/fft_mmx.o \ $(YASM-OBJS-FFT-yes) YASM-OBJS-$(CONFIG_DWT) += x86/dwt_yasm.o - YASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \ x86/h264_chromamc_10bit.o - -MMX-OBJS-$(CONFIG_H264DSP) += x86/h264dsp_mmx.o YASM-OBJS-$(CONFIG_H264DSP) += x86/h264_deblock.o \ x86/h264_deblock_10bit.o \ x86/h264_idct.o \ x86/h264_idct_10bit.o \ x86/h264_weight.o \ - x86/h264_weight_10bit.o \ - + x86/h264_weight_10bit.o YASM-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred.o \ x86/h264_intrapred_10bit.o -MMX-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o YASM-OBJS-$(CONFIG_H264QPEL) += x86/h264_qpel_10bit.o - -MMX-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp_init.o -YASM-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp.o -MMX-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp_init.o \ - x86/rv40dsp_init.o -YASM-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp.o \ - x86/rv40dsp.o - -YASM-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_yasm.o - -YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_mmx.o x86/diracdsp_yasm.o - -MMX-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_mmx.o -YASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o -MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp_mmx.o -MMX-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhd_mmx.o -MMX-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodec_mmx.o YASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36_sse.o -MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o -YASM-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_yasm.o -MMX-OBJS-$(CONFIG_GPL) += x86/idct_mmx.o -MMX-OBJS-$(CONFIG_LPC) += x86/lpc_mmx.o -YASM-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp.o -MMX-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp-init.o YASM-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp.o -MMX-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp-init.o YASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o -MMX-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp-init.o -MMX-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o -YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o -MMX-OBJS-$(CONFIG_DWT) += x86/snowdsp_mmx.o \ - x86/dwt.o +YASM-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp.o +YASM-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp.o +YASM-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp.o \ + x86/rv40dsp.o YASM-OBJS-$(CONFIG_V210_DECODER) += x86/v210.o -MMX-OBJS-$(CONFIG_V210_DECODER) += x86/v210-init.o -MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o +YASM-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_yasm.o YASM-OBJS-$(CONFIG_VP3_DECODER) += x86/vp3dsp.o YASM-OBJS-$(CONFIG_VP5_DECODER) += x86/vp3dsp.o -MMX-OBJS-$(CONFIG_VP5_DECODER) += x86/vp56dsp_init.o YASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp3dsp.o \ x86/vp56dsp.o -MMX-OBJS-$(CONFIG_VP6_DECODER) += x86/vp56dsp_init.o YASM-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp.o -MMX-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp-init.o + MMX-OBJS-$(HAVE_YASM) += x86/dsputil_yasm.o \ x86/deinterlace.o \ x86/fmtconvert.o \ $(YASM-OBJS-yes) - -MMX-OBJS-$(CONFIG_FFT) += x86/fft.o - -OBJS-$(HAVE_MMX) += x86/dsputil_mmx.o \ - x86/fdct_mmx.o \ - x86/fmtconvert_mmx.o \ - x86/idct_mmx_xvid.o \ - x86/idct_sse2_xvid.o \ - x86/motion_est_mmx.o \ - x86/mpegvideo_mmx.o \ - x86/simple_idct_mmx.o \ - -OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o |