summaryrefslogtreecommitdiff
path: root/libavcodec/libopusenc.c
Commit message (Collapse)AuthorAge
* avcodec: Add FF_CODEC_CAP_NOT_INIT_THREADSAFEAndreas Rheinhardt2022-07-18
| | | | | | | This is in preparation of switching the default init-thread-safety to a codec being init-thread-safe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-05
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Rename AVCodecDefault->FFCodecDefaultAndreas Rheinhardt2022-03-21
| | | | | | | This structure is no longer declared in a public header, so using an FF-prefix is more appropriate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-21
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-21
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libopus: convert to new channel layout APIAnton Khirnov2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Stop including channel_layout.h in avcodec.hAndreas Rheinhardt2021-07-22
| | | | | | Also include channel_layout.h directly wherever used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/encode: Always use intermediate buffer in ff_alloc_packet2()Andreas Rheinhardt2021-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, ff_alloc_packet2() has a min_size parameter: It is supposed to be a lower bound on the final size of the packet to allocate. If it is not too far from the upper bound (namely, if it is at least half the upper bound), then ff_alloc_packet2() already allocates the final, already refcounted packet; if it is not, then the packet is not refcounted and its data only points to a buffer owned by the AVCodecContext (in this case, the packet will be made refcounted in encode_simple_internal() in libavcodec/encode.c). The goal of this was to avoid data copies and intermediate buffers if one has a precise lower bound. Yet those encoders for which precise lower bounds exist have recently been switched to ff_get_encode_buffer() (which automatically allocates final buffers), leaving only two encoders to actually set the min_size to something else than zero (namely aliaspixenc and hapenc). Both of these encoders use a very low lower bound that is not helpful in any nontrivial case. This commit therefore removes the min_size parameter as well as the codepath in ff_alloc_packet2() for the allocation of final buffers. Furthermore, the function has been renamed to ff_alloc_packet() and moved to encode.h alongside ff_get_encode_buffer(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Remove redundant freeing of extradata of encodersAndreas Rheinhardt2021-04-28
| | | | | | | | AVCodecContext.extradata is freed generically by libavcodec for encoders, so it is unnecessary for an encoder to do it on its own. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libopusenc: Fix for header pre-skip valueArthur Taylor2021-01-07
| | | | | | | | | The Opus header initial padding preskip amount is always to be expressed relative to 48kHz. However, the encoder delay returned from querying libopus is relative to the encoding samplerate. Multiply by the samplerate conversion factor to correct. Signed-off-by: Arthur Taylor <art@ified.ca>
* avcodec/libopusenc: add option to set inband FECGyan Doshi2020-09-09
|
* avcodec/libopusenc: Don't free user-provided AVPacketAndreas Rheinhardt2020-05-23
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Revert "avcodec/libopusenc: Fix warning when encoding ambisonics with ↵Rostislav Pehlivanov2018-11-28
| | | | | | channel mapping 2" This reverts commit 4cd6f08d2005c20a03ccd53a0a6f8a115c5ebe2e.
* avcodec/libopusenc: Fix warning when encoding ambisonics with channel mapping 2Felicia Lim2018-11-29
| | | | | | Also adds checks on the number of channels. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/libopusenc: support encoding packets of sizes bigger than 60msJames Almer2018-08-24
| | | | | | | Packets of sizes 80ms, 100ms and 120ms are allowed since libopus 1.2 Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libopus: support disabling phase inversion.Menno2018-02-06
| | | | | Signed-off-by: Menno <mrdegier@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: add metadata to identify wrappers and hardware decoderswm42017-12-14
| | | | | | | | | | | | | | | | | | | | | Explicitly identify decoder/encoder wrappers with a common name. This saves API users from guessing by the name suffix. For example, they don't have to guess that "h264_qsv" is the h264 QSV implementation, and instead they can just check the AVCodec .codec and .wrapper_name fields. Explicitly mark AVCodec entries that are hardware decoders or most likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing API users listing hardware decoders in a more generic way. The proposed AVCodecHWConfig does not provide this information fully, because it's concerned with decoder configuration, not information about the fact whether the hardware is used or not. AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software implementations in case the hardware is not capable. Based on a patch by Philip Langdale <philipl@overt.org>. Merges Libav commit 47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1.
* Remove some unneeded casts of bit_rate.Carl Eugen Hoyos2017-09-22
|
* avocdec/libopus: fix typopkviet2017-09-01
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libopusenc: Add channel mapping family argumentMichael Graczyk2016-07-02
| | | | | | | | | The default value of -1 indicates that ffmpeg should determine the channel mapping automatically, which was the behavior before this commit. Unless the -mapping_family argument is provided, behavior is unchanged. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libopusenc: Refactor to simplify forthcoming mapping_family parameterMichael Graczyk2016-07-02
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-27
|
* lavc: Switch bitrate to 64bit unless compatibility with avconv was requested.Michael Niedermayer2015-09-15
|
* avcodec/libopusenc: Fix infinite loop on flushing after 0 inputMichael Niedermayer2015-08-27
| | | | 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>
* | 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/libopusenc: Use av_mallocz_array()Michael Niedermayer2015-01-17
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '8dd0a2c5cf40a8a49faae985adc11750b6429132'Michael Niedermayer2014-11-13
|\| | | | | | | | | | | | | * commit '8dd0a2c5cf40a8a49faae985adc11750b6429132': libopusenc: prevent an out-of-bounds read by returning early Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libopusenc: prevent an out-of-bounds read by returning earlyVittorio Giovara2014-11-13
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: CID 1244188
* | Merge commit 'b09cf8afc5199d359ac985ad7cea72a6a9f20e4e'Michael Niedermayer2014-11-13
|\| | | | | | | | | | | | | * commit 'b09cf8afc5199d359ac985ad7cea72a6a9f20e4e': libopusenc: check return value Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libopusenc: check return valueVittorio Giovara2014-11-13
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: CID 739870
* | Merge commit '2df0c32ea12ddfa72ba88309812bfb13b674130f'Michael Niedermayer2014-10-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '2df0c32ea12ddfa72ba88309812bfb13b674130f': lavc: use a separate field for exporting audio encoder padding Conflicts: libavcodec/audio_frame_queue.c libavcodec/avcodec.h libavcodec/libvorbisenc.c libavcodec/utils.c libavcodec/version.h libavcodec/wmaenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: use a separate field for exporting audio encoder paddingAnton Khirnov2014-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the amount of padding inserted at the beginning by some audio encoders, is exported through AVCodecContext.delay. However - the term 'delay' is heavily overloaded and can have multiple different meanings even in the case of audio encoding. - this field has entirely different meanings, depending on whether the codec context is used for encoding or decoding (and has yet another different meaning for video), preventing generic handling of the codec context. Therefore, add a new field -- AVCodecContext.initial_padding. It could conceivably be used for decoding as well at a later point.
* | Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libopusenc: Change default frame duration to 20 msPaul B Mahol2014-01-06
| | | | | | | | | | | | | | 20 ms is the default in the libopus encoder, and gives better quality than 10 ms. Signed-off-by: Martin Storsjö <martin@martin.st>
* | avcodec/libopusenc: change default frame duration to 20 msPaul B Mahol2013-11-18
| | | | | | | | | | | | 20 ms is used by libopus encoder. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2'Michael Niedermayer2013-10-04
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2': cosmetics: Group .name and .long_name together in codec/format declarations Conflicts: libavcodec/8svx.c libavcodec/alac.c libavcodec/cljr.c libavcodec/dnxhddec.c libavcodec/dnxhdenc.c libavcodec/dpxenc.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/ffv1dec.c libavcodec/flacdec.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/g726.c libavcodec/gif.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/h263dec.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopencore-amr.c libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/libspeexenc.c libavcodec/libvo-amrwbenc.c libavcodec/libvorbisenc.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/ljpegenc.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpeg4videodec.c libavcodec/msmpeg4dec.c libavcodec/pgssubdec.c libavcodec/pngdec.c libavcodec/pngenc.c libavcodec/proresdec_lgpl.c libavcodec/proresenc_kostya.c libavcodec/ra144enc.c libavcodec/rawdec.c libavcodec/rv10.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tta.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/wavpack.c libavcodec/xbmenc.c libavcodec/yop.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Group .name and .long_name together in codec/format declarationsDiego Biurrun2013-10-03
| |
* | lavcodec: Adding support for End Trimming in Opus encoderVignesh Venkatasubramanian2013-09-11
| | | | | | | | | | | | | | | | | | Adds the end trimming value (duration to be trimmed from the end of the file due to padding) to the packet's side data. This is then made use by the muxer to put the value in the container. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | make the ordering of the return type and av_cold consistentMichael Niedermayer2013-05-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | libopusenc: use ff_alloc_packet2James Zern2013-03-06
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | lavc/libopusenc: report an error if global_quality is set.Nicolas George2013-02-27
| |
* | libopusenc: use more specific and correct name for the channel orderMichael Niedermayer2012-10-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'fd41cb43702498948ff14ba8c284fd5c15fc729d'Michael Niedermayer2012-10-02
|/ | | | | | | | | | | | | | | | | * commit 'fd41cb43702498948ff14ba8c284fd5c15fc729d': avconv: improve sample format negotiation for decoder request Opus encoder using libopus mpegts: Drop pointless casting of hex_dump_debug arguments avformat: const correctness for av_hex_dump / av_hex_dump_log wmadec: Adjust debug printf argument length modifier Conflicts: Changelog ffmpeg.c libavcodec/libopusdec.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
* Opus encoder using libopusNathan Caldwell2012-10-01
Signed-off-by: Diego Biurrun <diego@biurrun.de>