summaryrefslogtreecommitdiff
path: root/libavcodec/flacenc.c
Commit message (Collapse)AuthorAge
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-18
| | | | | | | | | | | and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> 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: 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>
* flac: convert to new channel layout APIAnton Khirnov2022-03-15
| | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/golomb: Factor writing golomb codes outAndreas Rheinhardt2022-01-06
| | | | | | | | Most users only want to either read or write golomb codes, not both. By splitting these headers one avoids having unnecesssary (get|put)_hits.h inclusions. 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/flacenc: Avoid copying packet data, allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | | The FLAC encoder calculates the size in advance, so one can avoid an intermediate buffer for the packet data by using ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/flacenc: Mark encoder as init-threadsafeAndreas Rheinhardt2021-05-02
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/flacenc: Remove always-true checkAndreas Rheinhardt2021-04-28
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> 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: Remove private options from AVCodecContextAndreas Rheinhardt2021-04-27
| | | | | | | | | Several options that were too codec-specific were deprecated between 0e6c8532215790bbe560a9eea4f3cc82bb55cf92 and 0e9c4fe254073b209970df3e3cb84531bc388e99. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: Remove sidedata-only-packet cruftAndreas Rheinhardt2021-04-27
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/flacenc: Fix memleak upon init errorAndreas Rheinhardt2021-04-02
| | | | | | An AVMD5 struct would leak if an error happened after its allocation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Avoid intermediate bitcount for number of bytes in PutBitContextAndreas Rheinhardt2021-03-30
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: deprecate Lossless and Intra Only encoder capabilitesJames Almer2020-05-21
| | | | | | | Both are codec properties and not encoder capabilities. The relevant AVCodecDescriptor.props flags exist for this purpose. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/flacenc: Replace "return -1" by named constantMichael Niedermayer2017-09-24
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/lpc: Add min_shift parameter in LPCJai Luthra2016-08-28
| | | | | | | The min_shift parameter is needed by the MLP encoder Signed-off-by: Jai Luthra <me@jailuthra.in> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'b7f98659f21dce438c33b512e25fd64b8d07c347'Clément Bœsch2016-06-29
|\ | | | | | | | | | | | | * commit 'b7f98659f21dce438c33b512e25fd64b8d07c347': Remove unnecessary get_bits.h #includes Merged-by: Clément Bœsch <clement@stupeflix.com>
| * Remove unnecessary get_bits.h #includesDiego Biurrun2016-06-07
| |
| * flacenc: Load default prediction_order parameters if none is selectedMichael Niedermayer2016-02-08
| | | | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * flacenc: Restore defaults and range for {min, max}_prediction_orderDerek Buitenhuis2016-02-01
| | | | | | | | | | | | This was broken in 243df1351d2d928caa084a5704ed783f0b83f072. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | avcodec/flacenc: Fix prediction_order parameterMichael Niedermayer2016-01-31
| | | | | | | | | | | | Fixes regression Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | flacenc: Restore defaults and range for {min,max}_prediction_orderDerek Buitenhuis2016-01-31
| | | | | | | | | | | | This was broken in 243df1351d2d928caa084a5704ed783f0b83f072. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit '243df1351d2d928caa084a5704ed783f0b83f072'Derek Buitenhuis2016-01-31
|\| | | | | | | | | | | | | * commit '243df1351d2d928caa084a5704ed783f0b83f072': lavc: Move {min,max}_prediction_order to codec private options Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavc: Move {min,max}_prediction_order to codec private optionsVittorio Giovara2016-01-21
| | | | | | | | | | | | | | These options are only used by alac and flac. They are very codec-specific options, so deprecate the global variants. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec/flacenc: fix calculation of bits required in case of custom sample ratePaul B Mahol2016-01-24
| | | | | | | | | | | | | | | | Sample rate of 11025 takes 16 bits but previous code would pick only 8. Fixes assertion failure. Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec/flacenc: use designated initializers for AVClassPaul B Mahol2015-12-20
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avcodec: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | Merge commit '79d89cf2f4b62eeb653fd8139041c87e75f7ca65'Derek Buitenhuis2015-11-22
|\| | | | | | | | | | | | | | | | | | | * commit '79d89cf2f4b62eeb653fd8139041c87e75f7ca65': flacenc: Clamp user-supplied min/max prediction orders Conflicts: libavcodec/flacenc.c Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * flacenc: Clamp user-supplied min/max prediction ordersVittorio Giovara2015-11-16
| | | | | | | | | | | | This mimics what the code does internally for default order values. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | intmath: remove av_ctz.Ronald S. Bultje2015-10-11
| | | | | | | | | | It's a non-installed header and only used in one place (flacenc). Since ff_ctz is static inline, it's fine to use that instead.
* | Merge commit '6064f697a321174232a3fad351afb21150c3e9e5'Hendrik Leppkes2015-09-12
|\| | | | | | | | | | | | | * commit '6064f697a321174232a3fad351afb21150c3e9e5': lavc: Enable side data only packets by default Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavc: Enable side data only packets by defaultVittorio Giovara2015-09-12
| | | | | | | | | | | | | | | | | | Deprecate the now unused option, but temporarily retain the capability to disable the now default behaviour. Mention this change in the AVPacket documentation. 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/flacenc: Fix Invalid Rice orderGeorge Boyle2015-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes ticket #4628. The problem arose, in the sample file at least, in the last block where the minimum and maximum Rice partition orders were both 0. In that case, and any other where pmax == pmin, the original UINT32_MAX placeholder value for bits[opt_porder] was getting overwritten before the comparison to check if the current partition order is a new optimal, so the correct partition order and RiceContext params were not being set. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacenc: Simplify sizeof()Michael Niedermayer2015-06-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacenc: Support Multi dimensional quantizationMichael Niedermayer2015-05-20
| | | | | | | | | | | | Now with exact bit computations if exact_rice_parameters is enabled Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacenc: Mark pointers/array arguments const which are not changedMichael Niedermayer2015-05-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacenc: Simplify md5 calculation code by using AV_WL24()Michael Niedermayer2015-05-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacenc: Move udata and sums to FlacSubframeMichael Niedermayer2015-05-19
| | | | | | | | | | | | | | | | This significantly reduces the amount of stack space needed and also permits to simply copy the rice context again without speed penalty Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacenc: Support calculating rice parameters exactlyMichael Niedermayer2015-05-19
| | | | | | | | | | | | | | Some files benefit by about 0.3% from this, and speedwise its ok other files do not benefit and encode to the same size Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/flacenc: Do not copy unused udata array -> 5x faster calc_rice_params()Michael Niedermayer2015-05-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc/flac: Fix encoding and decoding with high lpc.Carl Eugen Hoyos2015-05-17
| | | | | | | | | | | | Based on an analysis by trac user lvqcl. Fixes ticket #4421, reported by Chase Walker.
* | Merge commit 'f5ba67ee1342b7741200ff637fc3ea3387b68a1b'Michael Niedermayer2015-04-29
|\| | | | | | | | | | | | | | | | | | | * commit 'f5ba67ee1342b7741200ff637fc3ea3387b68a1b': flacenc: Move a scratch buffer to struct used by the function Conflicts: libavcodec/flacenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * flacenc: Move a scratch buffer to struct used by the functionVittorio Giovara2015-04-28
| | | | | | | | | | This avoids allocating/freeing memory at every function call, checking its return value, and carrying the error around.
| * flacenc: initialize sums matrixVittorio Giovara2015-01-29
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: CID 703821