Commit Graph

269 Commits

Author SHA1 Message Date
Michael Niedermayer 9afd55922a imgconvert: silence some const incompatible pointer warnings.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-05 18:44:42 +02:00
Michael Niedermayer dfb4757bbe lavc: support building with the forks ABI for avcodec_find_best_pix_fmt2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-31 21:35:40 +02:00
Michael Niedermayer 2a54ae9df8 imgconvert: add avcodec_find_best_pix_fmt_of_2()
and deprecate avcodec_find_best_pix_fmt2()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-31 21:35:39 +02:00
Michael Niedermayer c617bed34f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  MSS1 and MSS2: set final pixel format after common stuff has been initialised
  MSS2 decoder
  configure: handle --disable-asm before check_deps
  x86: Split inline and external assembly #ifdefs
  configure: x86: Separate inline from standalone assembler capabilities
  pktdumper: Use a custom define instead of PATH_MAX for buffers
  pktdumper: Use av_strlcpy instead of strncpy
  pktdumper: Use sizeof(variable) instead of the direct buffer length

Conflicts:
	Changelog
	configure
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/codec_desc.c
	libavcodec/dct-test.c
	libavcodec/imgconvert.c
	libavcodec/mss12.c
	libavcodec/version.h
	libavfilter/x86/gradfun.c
	libswscale/x86/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-31 13:34:32 +02:00
Diego Biurrun 17337f54c0 x86: Split inline and external assembly #ifdefs 2012-08-31 01:53:25 +02:00
Michael Niedermayer c581cb4e4f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Fix even more missing includes after the common.h removal
  build: Factor out rangecoder dependencies to CONFIG_RANGECODER
  build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
  x86: avcodec: Consistently name all init files
  Add more missing includes after removing the implicit common.h
  Add some more missing includes after removing the implicit common.h
  Don't include common.h from avutil.h
  rtmp: Automatically compute the hash for SWFVerification

Conflicts:
	configure
	doc/APIchanges
	doc/examples/decoding_encoding.c
	libavcodec/Makefile
	libavcodec/assdec.c
	libavcodec/audio_frame_queue.c
	libavcodec/avpacket.c
	libavcodec/dv_profile.c
	libavcodec/dwt.c
	libavcodec/libtheoraenc.c
	libavcodec/rawdec.c
	libavcodec/rv40dsp.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/v210dec.h
	libavcodec/vc1dsp.c
	libavcodec/x86/Makefile
	libavfilter/asrc_anullsrc.c
	libavfilter/avfilter.c
	libavfilter/buffer.c
	libavfilter/formats.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_select.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/version.h
	libavutil/audioconvert.c
	libavutil/error.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-16 16:20:30 +02:00
Martin Storsjö 1d9c2dc89a Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:32:06 +03:00
Michael Niedermayer 72743aef03 imgconvert: Implement avcodec_find_best_pix_fmt_of_list()
The old avcodec_find_best_pix_fmt() was insufficient due to 64 pix_fmt limit.
In ffmpeg this problem has been solved long ago through avcodec_find_best_pix_fmt2()
Today libav has added a incompatible modified version of avcodec_find_best_pix_fmt2()
under the same name, thus again breaking ABI/API ...

The avcodec_find_best_pix_fmt_of_list() added in this commit here makes the libav
API available to ffmpeg users too.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-25 01:25:28 +02:00
Michael Niedermayer 31a192f387 imgconvert: favor pixel formats without resolution loss
Fixes Ticket1517

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-18 17:22:17 +02:00
Michael Niedermayer 39afcf1d7e Merge remote-tracking branch 'qatar/master'
* qatar/master:
  eval: add gt(), gte(), lt() and lte() fate tests
  eval: fix swapping of lt() and lte()
  imgconvert: deprecate avcodec_find_best_pix_fmt()
  imgconvert: add avcodec_find_best_pix_fmt2()
  imgconvert: avoid undefined left shift in avcodec_find_best_pix_fmt

Conflicts:
	libavcodec/imgconvert.c
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-15 01:23:16 +02:00
Janne Grunau f30260d32a imgconvert: deprecate avcodec_find_best_pix_fmt() 2012-07-13 19:22:46 +02:00
Janne Grunau ac29054fda imgconvert: add avcodec_find_best_pix_fmt2()
The number of pixel formats outgrew the number of available bits in
the bitmask used in avcodec_find_best_pix_fmt().
avcodec_find_best_pix_fmt2() uses a PIX_FMT_NONE terminated list
of pixel formats instead.
2012-07-13 19:22:46 +02:00
Janne Grunau 39bb27bf79 imgconvert: avoid undefined left shift in avcodec_find_best_pix_fmt
CC: libav-stable@libav.org
2012-07-13 17:29:27 +02:00
Michael Niedermayer 4251a0b84c imgconvert: add planar RGB formats to pix_fmt_info
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-03 19:03:26 +02:00
Michael Niedermayer 6ca8ef5189 imgconvert: add yuv 9,10,12,14 bit planar YUV formats to pix_fmt_info
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-03 19:03:26 +02:00
Stefano Sabatini e6674e46ec lavu/imgutils: create misc functions for dealing with buffers
Move the lavc/imgconvert functions and rename them as follows:
avpicture_get_size -> av_image_get_buffer_size()
avpicture_fill     -> av_image_fill_arrays()
avpicture_layout   -> av_image_copy_to_buffer()

The new functions have an align parameter, which allows to define the
linesize alignment assumed in the buffer (which is set or read).

The names of the functions are consistent with the lavu/samples API
(av_samples_get_buffer_size(), av_samples_fill_arrays()).
2012-06-26 13:12:12 +02:00
Stefano Sabatini 18b4404dc3 lavc/imgconvert: fix check on av_image_check_size() return code in avpicture_get_size()
The documentation states that av_image_check_size() will return a
negative value in case of error, while the check is done on ret != 0.

Also return a proper error code rather than -1 in case the check fails.
2012-06-19 01:36:30 +02:00
Stefano Sabatini 0b2ecf8224 lavc/imgconvert: remove pointless switch block from avpicture_fill() 2012-06-19 01:36:23 +02:00
Carl Eugen Hoyos 143a5c55ff Add yuva422p pix_fmt. 2012-05-08 08:39:37 +02:00
Michael Niedermayer 84cd3729ef imgconvert: fix regression with fate-gif colorspaces.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-17 04:05:14 +02:00
Michael Niedermayer 2ec8789eb8 avpicture_layout: use a endian independant format for the palette.
This should fix the failing fate PAL8 tests.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-13 18:21:51 +02:00
Stefano Sabatini 1a3d4b88a4 imgconvert: add macro pixdesc_has_alpha for checking if a pixel format has an alpha component
Reduce redundancy and simplify.
2012-03-10 00:10:09 +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
Carl Eugen Hoyos 6838df0488 Add pix_fmt_info for yuva444.
Reviewed-by: Paul B Mahol
2012-01-30 11:24:02 +01:00
Michael Niedermayer c065255bba Merge remote-tracking branch 'qatar/master'
* qatar/master:
  aacenc: Fix LONG_START windowing.
  aacenc: Fix a bug where deinterleaved samples were stored in the wrong place.
  avplay: use the correct array size for stride.
  lavc: extend doxy for avcodec_alloc_context3().
  APIchanges: mention avcodec_alloc_context()/2/3
  avcodec_align_dimensions2: set only 4 linesizes, not AV_NUM_DATA_POINTERS.
  aacsbr: ARM NEON optimised sbrdsp functions
  aacsbr: align some arrays
  aacsbr: move some simdable loops to function pointers
  cosmetics: Remove extra newlines at EOF

Conflicts:
	libavcodec/utils.c
	libavfilter/formats.c
	libavutil/mem.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-29 00:34:59 +01:00
Michael Niedermayer e37f161e66 Merge remote-tracking branch 'qatar/master'
* qatar/master: (71 commits)
  movenc: Allow writing to a non-seekable output if using empty moov
  movenc: Support adding isml (smooth streaming live) metadata
  libavcodec: Don't crash in avcodec_encode_audio if time_base isn't set
  sunrast: Document the different Sun Raster file format types.
  sunrast: Add a check for experimental type.
  libspeexenc: use AVSampleFormat instead of deprecated/removed SampleFormat
  lavf: remove disabled FF_API_SET_PTS_INFO cruft
  lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft
  lavf: remove disabled FF_API_REORDER_PRIVATE cruft
  lavf: remove disabled FF_API_SEEK_PUBLIC cruft
  lavf: remove disabled FF_API_STREAM_COPY cruft
  lavf: remove disabled FF_API_PRELOAD cruft
  lavf: remove disabled FF_API_NEW_STREAM cruft
  lavf: remove disabled FF_API_RTSP_URL_OPTIONS cruft
  lavf: remove disabled FF_API_MUXRATE cruft
  lavf: remove disabled FF_API_FILESIZE cruft
  lavf: remove disabled FF_API_TIMESTAMP cruft
  lavf: remove disabled FF_API_LOOP_OUTPUT cruft
  lavf: remove disabled FF_API_LOOP_INPUT cruft
  lavf: remove disabled FF_API_AVSTREAM_QUALITY cruft
  ...

Conflicts:
	doc/APIchanges
	libavcodec/8bps.c
	libavcodec/avcodec.h
	libavcodec/libx264.c
	libavcodec/mjpegbdec.c
	libavcodec/options.c
	libavcodec/sunrast.c
	libavcodec/utils.c
	libavcodec/version.h
	libavcodec/x86/h264_deblock.asm
	libavdevice/libdc1394.c
	libavdevice/v4l2.c
	libavformat/avformat.h
	libavformat/avio.c
	libavformat/avio.h
	libavformat/aviobuf.c
	libavformat/dv.c
	libavformat/mov.c
	libavformat/utils.c
	libavformat/version.h
	libavformat/wtv.c
	libavutil/Makefile
	libavutil/file.c
	libswscale/x86/input.asm
	libswscale/x86/swscale_mmx.c
	libswscale/x86/swscale_template.c
	tests/ref/lavf/ffm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-28 07:53:34 +01:00
Alex Converse 7181c4edee cosmetics: Remove extra newlines at EOF 2012-01-27 17:19:09 -08:00
Anton Khirnov 8b9b6041d7 lavc: remove disabled FF_API_GET_ALPHA_INFO cruft. 2012-01-27 10:38:34 +01:00
Anton Khirnov 8e5746d461 lavc: remove disabled FF_API_GET_PIX_FMT_NAME cruft. 2012-01-27 10:38:34 +01:00
Michael Niedermayer e9a6152e17 lavc: fix FF_LOSS_COLORQUANT detection for gray8a->pal8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-22 14:42:53 +01:00
Carl Eugen Hoyos dc2f652ae4 Fix pix_fmt_info for yuva420.
This allows correct output pix_fmt auto-selection
if the input pix_fmt is yuva420.

Fixes ticket #290.
2012-01-17 00:42:17 +01:00
Michael Niedermayer d9816cd5df imgconvert: add PIX_FMT_GRAY8A to pix_fmt_info
Fixes selecting gray8a for PAM

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-15 02:40:18 +01:00
Michael Niedermayer 7d8f115843 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpegenc: use avctx->slices as number of slices
  v410enc: fix undefined signed left shift caused by integer promotion
  Release notes: mention cleaned up header includes
  fix Changelog file
  Fix a bunch of typos.
  Drop some pointless void* return value casts from av_malloc() invocations.
  wavpack: fix typos in previous cosmetic clean-up commit
  wavpack: cosmetics: K&R pretty-printing
  avconv: remove the 'codec framerate is different from stream' warning
  wavpack: determine sample_fmt before requesting a buffer
  bmv audio: implement new audio decoding API
  mpegaudiodec: skip all channels when skipping granules
  mpegenc: simplify muxrate calculation

Conflicts:
	Changelog
	avconv.c
	doc/RELEASE_NOTES
	libavcodec/h264.c
	libavcodec/mpeg12.c
	libavcodec/mpegaudiodec.c
	libavcodec/mpegvideo.c
	libavformat/mpegenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-03 03:06:45 +01:00
Diego Biurrun 44b0edda3f Drop some pointless void* return value casts from av_malloc() invocations. 2012-01-02 16:41:24 +01:00
Michael Niedermayer dd8ffc1925 Merge remote-tracking branch 'qatar/master'
* qatar/master: (47 commits)
  lavc: hide private symbols.
  lavc: deprecate img_get_alpha_info().
  lavc: use avpriv_ prefix for ff_toupper4.
  lavc: use avpriv_ prefix for ff_copy_bits and align_put_bits.
  lavc: use avpriv_ prefix for ff_ac3_parse_header.
  lavc: use avpriv_ prefix for ff_frame_rate_tab.
  lavc: rename ff_find_start_code to avpriv_mpv_find_start_code
  lavc: use avpriv_ prefix for ff_split_xiph_headers.
  lavc: use avpriv_ prefix for ff_dirac_parse_sequence_header.
  lavc: use avpriv_ prefix for some dv symbols used in lavf.
  lavc: use avpriv_ prefix for some flac symbols used in lavf.
  lavc: use avpriv_ prefix for some mpeg4audio symbols used in lavf.
  lavc: use avpriv_ prefix for some mpegaudio symbols used in lavf.
  lavc: use avpriv_ prefix for ff_aac_parse_header().
  lavf: hide private symbols.
  lavf: use avpriv_ prefix for some dv functions.
  lavf: use avpriv_ prefix for ff_new_chapter().
  avcodec: add CODEC_CAP_DELAY note to avcodec_decode_audio3() documentation
  avcodec: clarify the CODEC_CAP_DELAY note in avcodec_decode_video2()
  avcodec: clarify documentation of CODEC_CAP_DELAY
  ...

Conflicts:
	configure
	doc/general.texi
	libavcodec/Makefile
	libavcodec/aacdec.c
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/dv.c
	libavcodec/dvdata.c
	libavcodec/dvdata.h
	libavcodec/libspeexenc.c
	libavcodec/mpegvideo.c
	libavcodec/version.h
	libavformat/avidec.c
	libavformat/dv.c
	libavformat/dv.h
	libavformat/flvenc.c
	libavformat/mov.c
	libavformat/mp3enc.c
	libavformat/oggparsespeex.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-21 02:01:26 +02:00
Anton Khirnov 586657c20a lavc: deprecate img_get_alpha_info().
It's never been touched or used in any way since it was added in 2003
and only works for PIX_FMT_PAL8, which makes me conclude that nobody's
ever used it.
2011-10-20 21:06:58 +02:00
Matthew Einhorn e662b263d9 Fixes avpicture_layout to not write past buffer end.
avpicture_get_size() returns the size of buffer required for avpicture_layout.
For pseudo-paletted formats (gray8...) this size does not include the palette.
However, avpicture_layout doesn't know this and still writes the palette. Consequently,
avpicture_layout writes passed the length of the buffer. This fixes it
by fixing avpicture_layout so that it doesn't write the palette for these formats.

Signed-off-by: Matthew Einhorn <moiein2000@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-19 23:28:04 +02:00
Jean First 9569a3c9f4 Add new pix_fmt RGBA64 2011-09-24 06:01:45 +02:00
Clément Bœsch f067d8a618 imgconvert: avoid mixed declarations and code. 2011-09-01 20:23:40 +02:00
Matthew Einhorn 1d6eca2d27 Removes the internal avcodec_find_best_pix_fmt1()function previously used by avcodec_find_best_pix_fmt() and not used anymore.
Signed-off-by: Matthew Einhorn <moiein2000@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-27 05:09:48 +02:00
Michael Niedermayer 1287c81d65 imgconvert: make avcodec_find_best_pix_fmt2() more bug robust against future changes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-27 01:07:00 +02:00
Matthew Einhorn adfe59407e Adds a new pix fmt function that selects the best dest fmt from among 2 formats to convert to, given a certain src format.
Similar to avcodec_find_best_pix_fmt(), but instead only compares two destination
pix fmts and selects one of these fmts as the best dest format when converting from
a given source format. Also, as opposed to avcodec_find_best_pix_fmt() which supports
only the first 64 defined pixel formats, this supports as input any of the defined
pixel formats.

Also replaces the old function to rely on the new function.

Signed-off-by: Matthew Einhorn <moiein2000@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-27 00:57:46 +02:00
Matthew Einhorn 27667d28a6 Updates avcodec_get_pix_fmt_loss to return maximum loss for an invalid destination pixel format.
Signed-off-by: Matthew Einhorn <moiein2000@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-21 20:33:02 +02:00
Matthew Einhorn 39f9601c10 lavc: fix avcodec_find_best_pix_fmt() when there's more than 64 pixel formats
This fixed the problem where if there's more than 64 pixel formats
defined avcodec_find_best_pix_fmt() returns the wrong pixel format.

Signed-off-by: Matthew Einhorn <moiein2000@gmail.com>
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
2011-08-18 01:02:34 +02:00
Stefano Sabatini 539940d42f imgconvert: remove unused and inconsistent PixFmtInfo.depth field 2011-07-28 10:27:51 +02:00
Stefano Sabatini e324619ca9 imgconvert: change logic in avcodec_get_pix_fmt_loss()
Avoid the use of the brittle/inconsistent information in
PixFmtInfo.depth, and implement a possibly more robust logic which
exposes the information in pixdesc.

Also allow the removal of PixFmtInfo.depth, since this is the only use
of it.
2011-07-27 01:52:09 +02:00
Stefano Sabatini d7e14c0d10 imgconvert: remove PixFmtInfo.pixel_type field
The field is only used for checking if a format is YUV planar
and if the format is paletted.

This patch replaces the current is_planar_yuv() code with a function
which uses the pixdesc information. The new implementation is less
efficient, but this should not be an issue as the functions which use
it (av_picture_crop/pad()) are deprecated and currently never used in
the codebase.
2011-07-25 11:11:54 +02:00
Stefano Sabatini 3b8bb503ee imgconvert: store padded size information in PixFmtInfo, simplify avg_bits_per_pixel()
Prefer data-driven over procedural logic in avg_bits_per_pixel(),
simplify and improve robustness, as it is easy to miss a function
update when a new format is added.
2011-07-23 17:01:27 +02:00
Stefano Sabatini 49f612ee29 imgconvert: remove useless PixFmtInfo.nb_channels field 2011-07-23 17:01:27 +02:00