summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
Commit message (Collapse)AuthorAge
* Revert "libavcodec/utils: av_get_exact_bits_per_sample fixed to return "1" ↵Michael Niedermayer2015-08-01
| | | | | | | for DSD codecs." Requested-by: Ganesh Ajjanagadde <gajjanag@mit.edu> (original patch reviewer) This reverts commit 293e25be615d43c9b611c4b04920ec0d245a7145.
* libavcodec/utils: av_get_exact_bits_per_sample fixed to return "1" for DSD ↵Ihar A. Tumashyk2015-08-01
| | | | | | | | | | | codecs. All DSD codes have 1 bit per sample. https://en.wikipedia.org/wiki/Direct_Stream_Digital Signed-off-by: Ihar A. Tumashyk <itumashyk@gmail.com> Reviewed-by: Ganesh Ajjanagadde <gajjanag@mit.edu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/utils: Set coded_frame.pict_type in generic codeMichael Niedermayer2015-07-29
| | | | | | | This makes it possible to remove more coded_frame usage without breaking the publically visible coded_frame Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-27
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec flagsVittorio Giovara2015-07-27
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/utils: do not use internal->byte_buffer when little downsizing is ↵Michael Niedermayer2015-07-27
| | | | | | | | | | | | expected Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec: Add a min size parameter to ff_alloc_packet2()Michael Niedermayer2015-07-27
| | | | | | | | | | | | | | | | This parameter can be used to inform the allocation code about how much downsizing might occur, and can be used to optimize how to allocate the packet Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: silence some deprecation warningsJames Almer2015-07-21
| | | | | | | | | | | | | | | | And prevent eventual compilation failures once the relevant functions and fields are removed. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370'Michael Niedermayer2015-07-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370': Deprecate avctx.coded_frame Conflicts: ffmpeg.c libavcodec/a64multienc.c libavcodec/asvenc.c libavcodec/cljrenc.c libavcodec/dpxenc.c libavcodec/gif.c libavcodec/mpegvideo_enc.c libavcodec/nvenc.c libavcodec/proresenc_kostya.c libavcodec/pthread_frame.c libavcodec/rawenc.c libavcodec/sunrastenc.c libavcodec/tiffenc.c libavcodec/version.h libavcodec/xbmenc.c libavcodec/xwdenc.c libavdevice/v4l2.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * Deprecate avctx.coded_frameVittorio Giovara2015-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rationale is that coded_frame was only used to communicate key_frame, pict_type and quality to the caller, as well as a few other random fields, in a non predictable, let alone consistent way. There was agreement that there was no use case for coded_frame, as it is a full-sized AVFrame container used for just 2-3 int-sized properties, which shouldn't even belong into the AVCodecContext in the first place. The appropriate AVPacket flag can be used instead of key_frame, while quality is exported with the new AVPacketSideData quality factor. There is no replacement for the other fields as they were unreliable, mishandled or just not used at all. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/utils: Do not merge side data for encodersMichael Niedermayer2015-07-21
| | | | | | | | | | | | | | | | | | With side data now being added to every MPEG*/H26* video encoder in the form of a quality scalar, software which simply stores the pkt->data to get an ES stream would break. This also as a side-effect makes the code faster Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'd6604b29ef544793479d7fb4e05ef6622bb3e534'Michael Niedermayer2015-07-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd6604b29ef544793479d7fb4e05ef6622bb3e534': Gather all coded_frame allocations and free functions to a single place Conflicts: libavcodec/a64multienc.c libavcodec/asvenc.c libavcodec/cljrenc.c libavcodec/dpxenc.c libavcodec/dvenc.c libavcodec/gif.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libopenjpegenc.c libavcodec/libtheoraenc.c libavcodec/libvpxenc.c libavcodec/mpegvideo_enc.c libavcodec/nvenc.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/sunrastenc.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/v210enc.c libavcodec/v410enc.c libavcodec/xbmenc.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * Gather all coded_frame allocations and free functions to a single placeVittorio Giovara2015-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Allocating coded_frame is what most encoders do anyway, so it makes sense to always allocate and free it in a single place. Moreover a lot of encoders freed the frame with av_freep() instead of the correct API av_frame_free(). This bring uniformity to encoder behaviour and prevents applications from erroneusly accessing this field when not allocated. Additionally this helps isolating encoders that export information with coded_frame, and heavily simplifies its deprecation. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * PCM signed 16-bit big-endian planar decoderPaul B Mahol2015-06-24
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/utils: Check that channel count is valid in avcodec_open2();Michael Niedermayer2015-07-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc: Add properties field to AVCodecContext.Carl Eugen Hoyos2015-07-16
| | | | | | | | The new field can hold information about losslessness and closed captions for now.
* | avcodec/utils: Check that the sample rate is not negative when opening an ↵Michael Niedermayer2015-07-13
| | | | | | | | | | | | encoder Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Factor duplicated ff_fast_malloc() out into mem_internal.hMichael Niedermayer2015-07-13
| | | | | | | | | | | | | | | | internal.h is difficult to use due to circular dependancies mem.h is a public header ff_* is not public Alternative solutions probably are possible too Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Assert that the pointer is set when size is in ff_fast_malloc()Michael Niedermayer2015-07-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Avoid undefined void casts in ff_fast_malloc()Michael Niedermayer2015-07-11
| | | | | | | | | | | | based on code from libavutil/mem.c Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Fix potential overflow in overallocation codeMichael Niedermayer2015-07-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: Document 32 min for h264 widthMichael Niedermayer2015-07-10
| | | | | | | | | | Suggested-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() ↵Michael Niedermayer2015-07-10
| | | | | | | | | | | | | | | | for H.264 Fixes Assertion failure Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/utils: Check values in apply_param_change()Michael Niedermayer2015-07-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc/utils: get rid of add_metadata_from_side_data forward declarationMarton Balint2015-07-06
| | | | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc/utils: call add_metadata_from_side_data in ff_init_buffer_infoMarton Balint2015-07-06
| | | | | | | | | | | | | | | | This should ensure that each frame get its metadata from its proper packet regardless of frame delays caused by reordering or threading. Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc/utils: change add_metadata_from_side_data to accept avpacketMarton Balint2015-07-06
| | | | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc/utils: remove redundant call to ff_init_buffer_infoMarton Balint2015-07-06
| | | | | | | | | | | | | | It does the same as calling ff_decode_frame_props. Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/utils: Replace ENOTSUP by AVERROR_PATCHWELCOMEMichael Niedermayer2015-06-27
| | | | | | | | | | | | ENOTSUP is not available on all platforms Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec: Add flag for experimental HWAccels and use it for VDPAU/HEVCPhilip Langdale2015-06-26
| | | | | | | | | | | | | | | | This HWAccel isn't really usable right now due to an nvidia driver bug, so we don't want it selected by default. HWAccels have a capabilities field and there's a comment about flags, but no flags exist today, so let's add one for experimental hwaccels.
* | avcodec: Add codec_desc and remapping for ↵Michael Niedermayer2015-06-24
| | | | | | | | | | | | AV_CODEC_ID_PCM_S16BE_PLANAR_DEPRECATED Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc: add little-endian ADPCM_THP decoderRodger Combs2015-06-20
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/brstm: add support for BFSTM filesRodger Combs2015-06-17
| | | | | | | | | | Previous version reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/utils: Assert that audio decoders do not report using more data than ↵Michael Niedermayer2015-06-04
| | | | | | | | | | | | was input Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc: Print a warning if gray decoding was requested but not enabled.Carl Eugen Hoyos2015-05-17
| |
* | lavc: add yuv440p10/12 formats to aligned pixfmt list.Ronald S. Bultje2015-05-06
| |
* | Merge commit 'a78f5548d94f23ce23cece41edf0fe9d18926de6'Michael Niedermayer2015-04-23
|\| | | | | | | | | | | | | | | * commit 'a78f5548d94f23ce23cece41edf0fe9d18926de6': avcodec: Free the default avoptions on init failure See: 1907ff0a67edeb98d9153aac79f35961837ba3f6 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: Free the default avoptions on init failureLuca Barbato2015-04-22
| |
* | Merge commit 'aef0be08756e00f363c524453c948a6e2a348614'Michael Niedermayer2015-04-23
|\| | | | | | | | | | | | | * commit 'aef0be08756e00f363c524453c948a6e2a348614': avcodec: Unref the dummy buffer on the fail path Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: Unref the dummy buffer on the fail pathLuca Barbato2015-04-22
| |
* | lavc: use correct type for printf() argumentwm42015-04-14
| | | | | | | | | | | | This was passing uint32_t for %d. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat, avcodec: log discard paddingwm42015-04-14
| | | | | | | | | | | | Useful for debugging. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/utils: mark codec argument as const in ff_lock_avcodec()Michael Niedermayer2015-03-14
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/utils: use atomic operations on entangled_thread_counterMichael Niedermayer2015-03-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '117b432748ca87de4cd0f09d9b1495545e264733'Michael Niedermayer2015-03-13
|\| | | | | | | | | | | | | | | | | | | * commit '117b432748ca87de4cd0f09d9b1495545e264733': lavc: Introduce AVCodec internal capabilities Conflicts: libavcodec/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: Introduce AVCodec internal capabilitiesVittorio Giovara2015-03-13
| | | | | | | | | | | | | | This field is designed for marking codec properties useful to lavc internals. Two internal capabilities are added: - FF_CODEC_CAP_INIT_THREADSAFE: codec can be opened without locks; - FF_CODEC_CAP_INIT_CLEANUP: codec frees memory if initialization fails.