Commit Graph

1337 Commits

Author SHA1 Message Date
Michael Niedermayer eadd4264ee Merge remote-tracking branch 'qatar/master'
* qatar/master: (36 commits)
  adpcmenc: Use correct frame_size for Yamaha ADPCM.
  avcodec: add ff_samples_to_time_base() convenience function to internal.h
  adx parser: set duration
  mlp parser: set duration instead of frame_size
  gsm parser: set duration
  mpegaudio parser: set duration instead of frame_size
  (e)ac3 parser: set duration instead of frame_size
  flac parser: set duration instead of frame_size
  avcodec: add duration field to AVCodecParserContext
  avutil: add av_rescale_q_rnd() to allow different rounding
  pnmdec: remove useless .pix_fmts
  libmp3lame: support float and s32 sample formats
  libmp3lame: renaming, rearrangement, alignment, and comments
  libmp3lame: use the LAME default bit rate
  libmp3lame: use avpriv_mpegaudio_decode_header() for output frame parsing
  libmp3lame: cosmetics: remove some pointless comments
  libmp3lame: convert some debugging code to av_dlog()
  libmp3lame: remove outdated comment.
  libmp3lame: do not set coded_frame->key_frame.
  libmp3lame: improve error handling in MP3lame_encode_init()
  ...

Conflicts:
	doc/APIchanges
	libavcodec/libmp3lame.c
	libavcodec/pcxenc.c
	libavcodec/pnmdec.c
	libavcodec/pnmenc.c
	libavcodec/sgienc.c
	libavcodec/utils.c
	libavformat/hls.c
	libavutil/avutil.h
	libswscale/x86/swscale_mmx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-21 05:10:12 +01:00
Ronald S. Bultje b18f8cbf3d Revert two swscale commits.
Revert "swscale: update context offsets after removal of AlpMmxFilter."
(commit a95e3fa90b)
and
Revert "swscale: Remove some write-only variables related to alpha handling."
(commit 9d03cb9fc5).

They broke alpha handling - it's the evil inline asm that still uses that
variable, so it's not truely write-only.
2012-02-19 13:31:12 -08:00
Michael Niedermayer bbb61a1cd5 Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
  als: prevent infinite loop in zero_remaining().
  cook: prevent div-by-zero if channels is zero.
  pamenc: switch to encode2().
  svq1enc: switch to encode2().
  dvenc: switch to encode2().
  dpxenc: switch to encode2().
  pngenc: switch to encode2().
  v210enc: switch to encode2().
  xwdenc: switch to encode2().
  ttadec: use branchless unsigned-to-signed unfolding
  avcodec: add a Sun Rasterfile encoder
  sunrast: Move common defines to a new header file.
  cdxl: fix video decoding for some files
  cdxl: fix audio for some samples
  apetag: add proper support for binary tags
  ttadec: remove dead code
  swscale: make access to filter data conditional on filter type.
  swscale: update context offsets after removal of AlpMmxFilter.
  prores: initialise encoder and decoder parts only when needed
  swscale: make monowhite/black RGB-independent.
  ...

Conflicts:
	Changelog
	libavcodec/alsdec.c
	libavcodec/dpxenc.c
	libavcodec/golomb.h
	libavcodec/pamenc.c
	libavcodec/pngenc.c
	libavformat/img2.c
	libswscale/output.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-18 02:20:19 +01:00
Ronald S. Bultje 1bab6f852c swscale: make access to filter data conditional on filter type.
Prevents crashes on 1-tap filter (unscaled). Also rename "bguf" argument
to "vbuf", seems that was a typo.
2012-02-17 10:31:15 -08:00
Ronald S. Bultje a95e3fa90b swscale: update context offsets after removal of AlpMmxFilter. 2012-02-17 10:31:15 -08:00
Ronald S. Bultje 25c42234a9 swscale: make monowhite/black RGB-independent.
Disadvantage is that it no longer allows modifying brightness through
adjustment of the RGB lookup table. Advantage is that now monowhite/black
no longer need to be identified as a RGB format.
2012-02-16 21:43:20 -08:00
Michael Niedermayer e7dbfa59f2 swscale: enable some more SIMD functions.
They no longer just segfault.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-15 00:41:40 +01:00
Michael Niedermayer 94bc672489 swscale: yuv2422_2_c_template() add cliping.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-14 21:33:45 +01:00
Michael Niedermayer f03a029939 swscale: Add cliping to yuv2422_1_c_template()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-14 21:33:40 +01:00
Michael Niedermayer ef96bf294d swscale: Fix rounding in yuv2mono_1_c_template()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-14 21:33:30 +01:00
Michael Niedermayer c0c32a3704 swscale: Fix rounding in yuv2rgb_1_c_template()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-14 21:33:20 +01:00
Michael Niedermayer 2bc610ddc5 swscale: yuv2422_1_c_template: fix rounding
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-14 21:33:08 +01:00
Carl Eugen Hoyos 186923758d Fix compilation with old yasm that does not support AVX. 2012-02-14 12:03:55 +01:00
Diego Biurrun 9d03cb9fc5 swscale: Remove some write-only variables related to alpha handling. 2012-02-14 10:12:43 +01:00
Michael Niedermayer 1fbd905bbb Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: fix crashes in yuv2yuvX on x86-32.
  sunrast: Add fate test for gray8.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-14 03:24:27 +01:00
Michael Niedermayer 04b53746ad Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtpdec: Use 4 byte startcodes for H.264
  matroskadec: Mark variable as av_unused.
  Move some conditionally used variables into the block where they are used.
  Drop some completely unnecessary av_unused attributes.
  swscale: Remove unused variable alpMmxFilter.
  Drop unnecessary av_uninit attributes from some variable declarations.
  movenc: Support muxing wmapro in ismv/isma
  mpegtsenc: Add an AVOption for forcing a new PAT/PMT/SDT to be written
  swscale: move YUV2PACKED16WRAPPER() macro down to where it is used.
  swscale: handle gray16 as a "planar" YUV format (Y-only, of course).
  swscale: use yuv2packed1() functions for unscaled chroma also.
  swscale: fix incorrect chroma bias in yuv2rgb48_1_c().
  swscale: fix invalid memory accesses in yuvpacked1() functions.
  Move PS2 MMI code below the mips subdirectory, where it belongs.
  mips: Move MMI function declarations to a header.
  build: Set correct dependencies for rtmp* protocols implemented by librtmp.

Conflicts:
	libavcodec/ac3enc_template.c
	libavformat/mpegtsenc.c
	libswscale/output.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-14 01:53:31 +01:00
Ronald S. Bultje 771bab7f57 swscale: fix crashes in yuv2yuvX on x86-32.
They were introduced in an earlier commit that introduced use of named
arguments. One cause was a typo, a second cause appears to be a bug in
x264asm that I work around by not using named arguments.
2012-02-13 13:41:13 -08:00
Diego Biurrun 7331b6e718 Drop some completely unnecessary av_unused attributes. 2012-02-13 19:20:53 +01:00
Diego Biurrun 92fed11352 swscale: Remove unused variable alpMmxFilter. 2012-02-13 19:20:53 +01:00
Ronald S. Bultje 3cac475655 swscale: move YUV2PACKED16WRAPPER() macro down to where it is used. 2012-02-13 07:14:05 -08:00
Ronald S. Bultje c0b87359b2 swscale: handle gray16 as a "planar" YUV format (Y-only, of course).
This allows removing any gray16-specific code, which is essentially
identical to the per-plane code in yuv2plane*().
2012-02-13 07:14:05 -08:00
Ronald S. Bultje 9d9c846491 swscale: use yuv2packed1() functions for unscaled chroma also. 2012-02-13 07:14:04 -08:00
Ronald S. Bultje d63b7d8c37 swscale: fix incorrect chroma bias in yuv2rgb48_1_c(). 2012-02-13 07:14:04 -08:00
Ronald S. Bultje 1ca7dc60d2 swscale: fix invalid memory accesses in yuvpacked1() functions. 2012-02-13 07:14:04 -08:00
Michael Niedermayer 4e04e1b81e Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: convert yuv2yuvX() to using named arguments.
  swscale: rename "dstw" to "w" to prevent name collisions.
  swscale: use named registers in yuv2yuv1_plane() place.
  lavf: fix aspect ratio mismatch message.
  avconv: set AVFormatContext.duration from '-t'
  cljr: implement encode2.
  cljr: set the properties of the coded_frame, not input frame.
  dnxhdenc: switch to encode2.
  bmpenc: switch to encode2().

Conflicts:
	libavcodec/bmpenc.c
	libavcodec/cljr.c
	libavformat/utils.c
	tests/ref/vsynth1/cljr
	tests/ref/vsynth2/cljr

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-13 02:06:44 +01:00
Ronald S. Bultje 3e23badd83 swscale: convert yuv2yuvX() to using named arguments. 2012-02-12 08:27:51 -08:00
Ronald S. Bultje 8c433d8a03 swscale: rename "dstw" to "w" to prevent name collisions.
"dstw" can collide with the word-version of the "dst" argument, causing
all kind of weird stuff down the pipe.
2012-02-12 08:27:50 -08:00
Ronald S. Bultje ef66a0ed2e swscale: use named registers in yuv2yuv1_plane() place.
Most of the function had been converted before, but I forgot this
particular location.
2012-02-12 08:27:50 -08:00
Michael Niedermayer cd1c12b5c5 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  FATE: update reference for seek-alac_mp4
  sunrast: Return AVERROR values instead of -1.
  sunrast: Add support for gray8 decoding.
  swscale: enforce a minimum filtersize.
  alacenc: use AVCodec.encode2()
  alacenc: cosmetics: indentation
  alacenc: consolidate bitstream writing into a single function.
  alacenc: only encode frame size in header for a final smaller frame
  alacenc: store current frame size in AlacEncodeContext.
  alacenc: return AVERROR codes in alac_encode_frame()
  alacenc: calculate a new max frame size for the final small frame
  alacenc: pretty-printing and other cosmetics
  alacenc: fix error handling and potential memleaks in alac_encode_init()
  alacenc: do not set coded_frame->key_frame
  alacenc: do not set bits_per_coded_sample
  alacenc: remove unneeded frame_size check in alac_encode_frame()
  tta: error out if samplerate is zero.
  ttadec: fix invalid free when an error occurs while decoding 24-bit tta
  wavpack: add needed braces for 2 statements inside an if block

Conflicts:
	tests/ref/acodec/alac

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-12 01:06:13 +01:00
Ronald S. Bultje dae2ce361a swscale: enforce a minimum filtersize.
At very small dimensions, this calculation could lead to zero-sized
filters, which leads to uninitialized output, zero-sized allocations,
loop overflows in SIMD that uses do{..}while(i++<filtersize); instead
of for(i=0;i<filtersize;i++){..} and several other similar failures.
Therefore, require a minimum filtersize of 1.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2012-02-11 10:06:50 -08:00
Michael Niedermayer 8c6ebab747 Merge remote-tracking branch 'qatar/master'
* qatar/master: (26 commits)
  eac3dec: replace undefined 1<<31 with INT32_MIN in noise generation
  yadif: specify array size outside DECLARE_ALIGNED
  prores: specify array size outside DECLARE_ALIGNED brackets.
  WavPack demuxer: set packet duration
  tta: use skip_bits_long()
  mxfdec: Ignore the last entry in Avid's index table segments
  mxfdec: Sanity-check SampleRate
  mxfdec: Handle small EditUnitByteCount
  mxfdec: Consider OPAtom files that do not have exactly one EC to be OP1a
  mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows
  mxfdec: Zero nb_ptses in mxf_compute_ptses_fake_index()
  mxfdec: Sanity check PreviousPartition
  mxfdec: Never seek back in local sets and KLVs
  mxfdec: Move the current_partition check inside mxf_read_header()
  mxfdec: Fix infinite loop in mxf_packet_timestamps()
  mxfdec: Check eof_reached in mxf_read_local_tags()
  mxfdec: Check for NULL component
  mxfdec: Make sure mxf->nb_index_tables > 0 in mxf_packet_timestamps()
  mxfdec: Make sure x < index_table->nb_ptses
  build: Add missing directories to DIRS declarations.
  ...

Conflicts:
	doc/build_system.txt
	doc/fate.texi
	libavfilter/x86/yadif_template.c
	libavformat/mxfdec.c
	libavutil/Makefile
	tests/fate/audio.mak
	tests/fate/prores.mak
	tests/fate/screen.mak
	tests/fate/video.mak
	tests/ref/fate/bethsoft-vid
	tests/ref/fate/cscd
	tests/ref/fate/dfa4
	tests/ref/fate/nuv
	tests/ref/fate/vp8-sign-bias
	tests/ref/fate/wmv8-drm
	tests/ref/lavf/gxf

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-10 01:20:07 +01:00
Diego Biurrun a2e40cd3e2 swscale: ppc: Add missing header #includes to pass 'make checkheaders'. 2012-02-09 12:26:46 +01:00
Michael Niedermayer f2b20b7a8b Merge remote-tracking branch 'qatar/master'
* qatar/master:
  pixdesc: mark pseudopaletted formats with a special flag.
  avconv: switch to avcodec_encode_video2().
  libx264: implement encode2().
  libx264: split extradata writing out of encode_nals().
  lavc: add avcodec_encode_video2() that encodes from an AVFrame -> AVPacket
  cmdutils: update copyright year to 2012.
  swscale: sign-extend integer function argument to qword on x86-64.
  x86inc: support yasm -f win64 flag also.
  h264: manually save/restore XMM registers for functions using INIT_MMX.
  x86inc: allow manual use of WIN64_SPILL_XMM.
  aacdec: Use correct speaker order for 7.1.
  aacdec: Remove incorrect comment.
  aacdec: Simplify output configuration.
  Remove Sun medialib glue code.
  dsputil: set STRIDE_ALIGN to 16 for x86 also.
  pngdsp: swap argument inversion.

Conflicts:
	cmdutils.c
	configure
	doc/APIchanges
	ffmpeg.c
	libavcodec/aacdec.c
	libavcodec/dsputil.h
	libavcodec/libx264.c
	libavcodec/mlib/dsputil_mlib.c
	libavcodec/utils.c
	libavfilter/vf_scale.c
	libavutil/avutil.h
	libswscale/mlib/yuv2rgb_mlib.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-09 01:27:12 +01:00
Anton Khirnov 38d5533228 pixdesc: mark pseudopaletted formats with a special flag.
This makes it possible to dintinguish them from PAL8.

Fixes an invalid write in avpicture_layout().
2012-02-08 21:01:31 +01:00
Ronald S. Bultje 783487ae44 swscale: sign-extend integer function argument to qword on x86-64. 2012-02-08 10:31:14 -08:00
Diego Biurrun 0144fe6995 Remove Sun medialib glue code.
It is obscure, most likely unused and not bit-exact compared to
libavcodec due to a different IDCT transform algorithm.
2012-02-08 08:52:30 +01:00
Michael Niedermayer 18d0a16fc9 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: make yuv2yuv1 use named registers.
  h264: mark h264_idct_add8_10 with number of XMM registers.
  swscale: fix V plane memory location in bilinear/unscaled RGB/YUYV case.
  vp8: always update next_framep[] before returning from decode_frame().
  avconv: estimate next_dts from framerate if it is set.
  avconv: better next_dts usage.
  avconv: rename InputStream.pts to last_dts.
  avconv: reduce overloading for InputStream.pts.
  avconv: rename InputStream.next_pts to next_dts.
  avconv: rework -t handling for encoding.
  avconv: set encoder timebase for subtitles.
  pva-demux test: add -vn
  swscale: K&R formatting cosmetics for SPARC code
  apedec: allow the user to set the maximum number of output samples per call
  apedec: do not unnecessarily zero output samples for mono frames
  apedec: allocate a single flat buffer for decoded samples
  apedec: use sizeof(field) instead of sizeof(type)
  swscale: split C output functions into separate file.
  swscale: Split C input functions into separate file.
  bytestream: Add bytestream2 writing API.

The avconv changes are due to massive regressions and bugs not merged yet.

Conflicts:
	ffmpeg.c
	libavcodec/vp8.c
	libswscale/swscale.c
	libswscale/x86/swscale_template.c
	tests/fate/demux.mak
	tests/ref/lavf/asf
	tests/ref/lavf/avi
	tests/ref/lavf/mkv
	tests/ref/lavf/mpg
	tests/ref/lavf/nut
	tests/ref/lavf/ogg
	tests/ref/lavf/rm
	tests/ref/lavf/ts
	tests/ref/seek/lavf_avi
	tests/ref/seek/lavf_mkv
	tests/ref/seek/lavf_rm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-08 05:53:35 +01:00
Ronald S. Bultje ef1c785f11 swscale: make yuv2yuv1 use named registers. 2012-02-07 11:38:13 -08:00
Ronald S. Bultje b7542dd3d7 swscale: fix V plane memory location in bilinear/unscaled RGB/YUYV case.
Fixes bug 221.

CC: libav-stable@libav.org
2012-02-07 11:33:20 -08:00
Diego Biurrun 06b320ad78 swscale: K&R formatting cosmetics for SPARC code 2012-02-07 19:49:49 +01:00
Ronald S. Bultje 2144941069 swscale: split C output functions into separate file.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-07 12:03:51 +01:00
Ronald S. Bultje 2dd7a1c030 swscale: Split C input functions into separate file.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-02-07 12:03:50 +01:00
Michael Niedermayer d77294c5e4 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  libx264: fix indentation.
  vorbis: fix overflows in floor1[] vector and inverse db table index.
  win64: add a XMM clobber test configure option.
  movdec: Parse the dvc1 atom
  ARM: ac3: fix ac3_bit_alloc_calc_bap_armv6
  swscale: K&R formatting cosmetics for Blackfin code
  frwu: lowercase the FRWU codec name
  movdec: fix dts generation in fragmented files
  fate: make acodec-ac3_fixed test output raw AC3
  APIchanges: add missing commit hashes
  swscale: implement MMX, SSE2 and AVX functions for RGB32 input.
  ra144enc: drop pointless "encoder" from .long_name
  bethsoftvideo: fix palette reading.
  mpc7: use av_fast_padded_malloc()
  mpc7: simplify handling of packet sizes that are not a multiple of 4 bytes
  doc: decoding Forward Uncompressed is supported
  Fix a typo in the x86 asm version of ff_vector_clip_int32()
  pcmenc: Do not set avpkt->size.
  ff_alloc_packet: modify the size of the packet to match the requested size

Conflicts:
	doc/APIchanges
	libavcodec/libx264.c
	libavcodec/mpc7.c
	libavformat/isom.h
	libswscale/Makefile
	libswscale/bfin/yuv2rgb_bfin.c
	tests/ref/fate/bethsoft-vid
	tests/ref/seek/ac3_ac3

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-03 03:51:32 +01:00
Ronald S. Bultje 7e4d9d5d45 win64: add a XMM clobber test configure option.
This will be useful to test more aggressively for failures to mark XMM
registers as clobbered in Win64 builds, and prevent regressions thereof.

Based on a patch by Ramiro Polla <ramiro.polla@gmail.com>
2012-02-02 12:00:48 -08:00
Diego Biurrun 148bc235b0 swscale: K&R formatting cosmetics for Blackfin code
Also prettyprint some comments in Assembly code.
2012-02-02 18:50:12 +01:00
Ronald S. Bultje de53b9068a swscale: implement MMX, SSE2 and AVX functions for RGB32 input. 2012-02-01 21:55:32 -08:00
Michael Niedermayer 4c677df27c Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
  frwu: Employ more meaningful return values.
  fraps: Use av_fast_padded_malloc() instead of av_realloc()
  mjpegdec: use av_fast_padded_malloc()
  eatqi: use av_fast_padded_malloc()
  asv1: use av_fast_padded_malloc()
  avcodec: Add av_fast_padded_malloc().
  swscale: enable dithering in MMX functions.
  swscale: make rgb24 function macros slightly smaller.
  avcodec.h: Remove some disabled cruft.
  swscale: remove obsolete comment.
  swscale-test: Drop unused argc and argv arguments from main().
  zmbv: Employ more meaningful return values.
  zmbvenc: Employ more meaningful return values.
  vc1: prevent null pointer dereference on broken files
  zmbv: check av_realloc() return values and avoid memleaks on ENOMEM
  truespeech: align buffer
  ac3: Do not read past the end of ff_ac3_band_start_tab.
  dv: Fix small stack overread related to CVE-2011-3929 and CVE-2011-3936.
  dv: Fix null pointer dereference due to ach=0
  dv: check stype
  ...

Conflicts:
	doc/APIchanges
	libavcodec/asv1.c
	libavcodec/avcodec.h
	libavcodec/eatqi.c
	libavcodec/fraps.c
	libavcodec/frwu.c
	libavcodec/zmbv.c
	libavformat/dv.c
	libswscale/swscale.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-02 02:24:09 +01:00
Ronald S. Bultje 378c5ef9ae swscale: enable dithering in MMX functions.
This was accidently disabled.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-02-01 09:33:29 -08:00
Ronald S. Bultje 212f161caa swscale: make rgb24 function macros slightly smaller. 2012-02-01 09:33:13 -08:00
Ronald S. Bultje f5490fbe3b swscale: remove obsolete comment. 2012-02-01 07:17:01 -08:00