summaryrefslogtreecommitdiff
path: root/libavcodec/mpegaudioenc_template.c
Commit message (Collapse)AuthorAge
* 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>
* mpegaudio: convert to new channel layout APIAnton Khirnov2022-03-15
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpegaudiodata: Unavpriv mpa_bitrate and mpa_frequency tabsAndreas Rheinhardt2022-01-04
| | | | | | | | | | | These arrays have a size of 180 resp. six bytes. This does not make it worthwhile to export them due to the overhead this occurs; for x64 Elf/Linux/GNU: 2x2B version, 2x24B .dynsym, 24B .rela.dyn, 8B .got, 4B hash + twice the size of the name (here 20+23B). Therefore these symbols are unavprived and duplicated for shared builds. 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>
* Avoid intermediate bitcount for number of bytes in PutBitContextAndreas Rheinhardt2021-03-30
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegaudioenc_template: fix invalid shift of sampleMichael Niedermayer2020-02-27
| | | | | | Fixes: Ticket8010 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-21
| | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
* avcodec/mpegaudio: use predefined M_SQRT2Ganesh Ajjanagadde2015-11-14
| | | | | | | | | | M_SQRT2 is defined in math.h, or in avutil/mathematics.h for compatibility hacks. This uses this value instead of an ad-hoc define. Fixed point values produced by FIX() remain identical. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@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>
* Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'Michael Niedermayer2015-04-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25': lavc: Replace av_dlog and tprintf with internal macros Conflicts: libavcodec/aacdec.c libavcodec/audio_frame_queue.c libavcodec/bitstream.c libavcodec/dcadec.c libavcodec/dnxhddec.c libavcodec/dvbsubdec.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/get_bits.h libavcodec/gifdec.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_loopfilter.c libavcodec/h264_refs.c libavcodec/imc.c libavcodec/interplayvideo.c libavcodec/jpeglsdec.c libavcodec/libopencore-amr.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_parser.c libavcodec/pngdec.c libavcodec/ratecontrol.c libavcodec/rv10.c libavcodec/svq1dec.c libavcodec/vqavideo.c libavcodec/wmadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* 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>
* avcodec/mpegaudioenc_template: Fix integer overflowMichael Niedermayer2014-04-15
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/mpegaudioenc_template: default to 384k bitrate as defaultMichael Niedermayer2014-04-11
| | | | | | | | If 384k is too high for the samplerate, choose the closest possible Idea to increase the bitrate from: 46439e156219d27f059cf687743ba5aacf238b87 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/mpegaudioenc_template: reorder operations to prevent integer overflowMichael Niedermayer2014-04-09
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/mpegaudioenc_template: dont crash on bitrate=0Michael Niedermayer2014-04-09
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge commit '46439e156219d27f059cf687743ba5aacf238b87'Michael Niedermayer2014-04-09
| | | | | | | | | | * commit '46439e156219d27f059cf687743ba5aacf238b87': mp2: match twolame default options Not merged as the change breaks fate, also forcing resampling to specific sample rate reduces quality, and would be like rescaling every movie to 1080. Merged-by: Michael Niedermayer <michaelni@gmx.at>
* libavcodec/mpegaudio: change CONFIG_FLOAT to USE_FLOATMichael Niedermayer2013-12-03
| | | | | | | | The CONFIG_ name-space is set by configure, so its better to use a different prefix here. This also unifies the encoder & decoder define that is used Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec: split mp2 encoder into float and fixedMichael Niedermayer2013-12-03
This makes the USE_FLOATS == 0 available to the end user More float optimizations can easily be added as well now common code should be factored out into a common file once all fixed point & floating point optimizations are done, this is to avoid having to move code back and forth between files. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>