summaryrefslogtreecommitdiff
path: root/libavcodec/eac3enc.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec: add AVCodecContext.frame_num as 64 bit variant to frame_numberMarton Balint2023-02-131-1/+1
| | | | | | | | | | Frame counters can overflow relatively easily (INT_MAX number of frames is slightly more than 1 year for 60 fps content), so make sure we use 64 bit values for them. Also deprecate the old 32 bit frame_number attribute. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavc: support AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE in all no-delay encodersAnton Khirnov2023-01-291-1/+1
| | | | Including fake-delay encoders marked with FF_CODEC_CAP_EOF_FLUSH.
* avcodec/codec_internal: Avoid deprecation warnings for channel_layoutsAndreas Rheinhardt2022-09-281-5/+1
| | | | | | | | | | | | | | | | | | AVCodec.channel_layouts is deprecated and Clang (unlike GCC) warns when setting this field in a codec definition. Fortunately, Clang (unlike GCC) allows to use FF_DISABLE_DEPRECATION_WARNINGS inside a definition (of an FFCodec), so that one can create simple macros to set AVCodec.channel_layouts that also suppress deprecation warnings for Clang. (Notice that some of the codec definitions were already inside FF_DISABLE/ENABLE_DEPRECATION_WARNINGS (that were not guarded by FF_API_OLD_CHANNEL_LAYOUT); these have been removed. Also notice that setting AVCodec.channel_layouts was not guarded by FF_API_OLD_CHANNEL_LAYOUT either, so testing disabling it it without removing all the codeblocks would not have worked.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-031-1/+1
| | | | | | | | It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-181-1/+1
| | | | | | | | | | | 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-051-1/+1
| | | | | | | | | | | 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-211-11/+11
| | | | | | | | | | | | | | | | 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-211-0/+1
| | | | | | | | | | 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>
* ac3: convert to new channel layout APIVittorio Giovara2022-03-151-0/+5
| | | | | | 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/[e]ac3enc: Allow user-supplied buffersAndreas Rheinhardt2021-05-051-0/+1
| | | | | | | | The size of the output buffer is always known in advance and the code has no alignment requirement (it uses mostly the PutBits API), so allowing user-supplied buffers is trivial. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | | | | 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/[e]ac3enc: Fix indentationAndreas Rheinhardt2021-04-021-8/+8
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ac3enc: Share options and defaultsAndreas Rheinhardt2021-02-071-5/+2
| | | | | | | | | | Both AC-3 encoder share the same options, yet they are nevertheless duplicated in the binary; and the options applying to the EAC-3 encoder are a proper subset of the options for the AC-3 encoders, so that it can use the same options as the former by putting the options specific to AC-3 at the front. This commit implements this. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/[e]ac3enc: Don't invade CONFIG_ namespaceAndreas Rheinhardt2021-01-091-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/[e]ac3enc: Make encoders init-threadsafe, fix raceAndreas Rheinhardt2021-01-091-1/+1
| | | | | | | | | | | ff_eac3_exponent_init() set values twice when initializing a static table; ergo the initialization code must not run concurrently with a running EAC-3 encoder. Yet this code is executed every time an EAC-3 encoder is initialized. So use ff_thread_once() for this and also for a similar initialization performed for all AC-3 encoders to make them all init-threadsafe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/ac3enc_float, eac3enc: Fix leaks on init errorAndreas Rheinhardt2020-09-181-0/+1
| | | | | | | | | | | | | | | | | The AC-3 encoders (both floating- as well as fixed-point) as well as the EAC-3 encoder share code: All use ff_ac3_encode_init() as well as ff_ac3_encode_close(). Until ee726e777b851cdd4e28cdab36b38f0c39e35ea9 ff_ac3_encode_init() called ff_ac3_encode_close() to clean up on error. Said commit removed this and instead set the FF_CODEC_CAP_INIT_CLEANUP flag; but it did the latter only for the fixed-point AC-3 encoder and not for the other two users of ff_ac3_encode_init(). This caused any already allocated buffer to leak upon a subsequent error for the two other encoders. This commit fixes this by adding the FF_CODEC_CAP_INIT_CLEANUP flag to the other two encoders using ff_ac3_encode_init(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavc: Use supported_samplerates for Dolby Digital encoders.Carl Eugen Hoyos2020-04-041-0/+1
| | | | Fixes ticket #8518.
* Merge commit '27631796c9d1b8146ad4a16e6539ecc08afa7565'Michael Niedermayer2014-06-131-1/+1
|\ | | | | | | | | | | | | * commit '27631796c9d1b8146ad4a16e6539ecc08afa7565': ac3: Only initialize float_dsp for the float encoder variant Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ac3: Only initialize float_dsp for the float encoder variantDiego Biurrun2014-06-131-1/+1
| |
* | Merge commit 'dca7ba4bffe3e4aeb620cb62955256a0d87561f4'Michael Niedermayer2014-06-121-2/+0
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'dca7ba4bffe3e4aeb620cb62955256a0d87561f4': Remove some unnecessary CONFIG_FOO_COMPONENT ifdefs Conflicts: libavcodec/ac3enc_float.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove some unnecessary CONFIG_FOO_COMPONENT ifdefsDiego Biurrun2014-06-121-2/+0
| | | | | | | | The files are only ever compiled if that condition is true.
* | Merge commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2'Michael Niedermayer2013-10-041-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-031-1/+1
| |
* | Reinstate proper FFmpeg license for all files.Thilo Borgmann2013-08-301-4/+4
| |
* | Merge commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487'Michael Niedermayer2013-05-051-1/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6fee1b90ce3bf4fbdfde7016e0890057c9000487': avcodec: Add av_cold attributes to init functions missing them Conflicts: libavcodec/aacpsy.c libavcodec/atrac3.c libavcodec/dvdsubdec.c libavcodec/ffv1.c libavcodec/ffv1enc.c libavcodec/h261enc.c libavcodec/h264_parser.c libavcodec/h264dsp.c libavcodec/h264pred.c libavcodec/libschroedingerenc.c libavcodec/libxvid_rc.c libavcodec/mpeg12.c libavcodec/mpeg12enc.c libavcodec/proresdsp.c libavcodec/rangecoder.c libavcodec/videodsp.c libavcodec/x86/proresdsp_init.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avcodec: Add av_cold attributes to init functions missing themDiego Biurrun2013-05-041-1/+3
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-10-071-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: wmaenc: use float planar sample format (e)ac3enc: use planar sample format aacenc: use planar sample format adpcmenc: use planar sample format for adpcm_ima_wav and adpcm_ima_qt adpcmenc: move 'ch' variable to higher scope adpcmenc: fix 3 instances of variable shadowing adpcm_ima_wav: simplify encoding libvorbis: use planar sample format libmp3lame: use planar sample formats vorbisenc: use float planar sample format ffm: do not write or read the audio sample format parseutils: fix parsing of invalid alpha values doc/RELEASE_NOTES: update for the 9 release. smoothstreamingenc: Add a more verbose error message smoothstreamingenc: Ignore the return value from mkdir smoothstreamingenc: Try writing a manifest when opening the muxer smoothstreamingenc: Move the output_chunk_list and write_manifest functions up smoothstreamingenc: Properly return errors from ism_flush to the caller smoothstreamingenc: Check the output UrlContext before accessing it Conflicts: doc/RELEASE_NOTES libavcodec/aacenc.c libavcodec/ac3enc_template.c libavcodec/wmaenc.c tests/ref/lavf/ffm Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * (e)ac3enc: use planar sample formatJustin Ruggles2012-10-061-1/+1
| |
* | Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'Michael Niedermayer2012-08-071-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '36ef5369ee9b336febc2c270f8718cec4476cb85': Replace all CODEC_ID_* with AV_CODEC_ID_* lavc: add AV prefix to codec ids. Conflicts: doc/APIchanges doc/examples/decoding_encoding.c doc/examples/muxing.c ffmpeg.c ffprobe.c ffserver.c libavcodec/8svx.c libavcodec/avcodec.h libavcodec/dnxhd_parser.c libavcodec/dvdsubdec.c libavcodec/error_resilience.c libavcodec/h263dec.c libavcodec/libvorbisenc.c libavcodec/mjpeg_parser.c libavcodec/mjpegenc.c libavcodec/mpeg12.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/pcm.c libavcodec/r210dec.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/version.h libavdevice/alsa-audio-dec.c libavdevice/bktr.c libavdevice/v4l2.c libavformat/asfdec.c libavformat/asfenc.c libavformat/avformat.h libavformat/avidec.c libavformat/caf.c libavformat/electronicarts.c libavformat/flacdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/framecrcenc.c libavformat/img2.c libavformat/img2dec.c libavformat/img2enc.c libavformat/ipmovie.c libavformat/isom.c libavformat/matroska.c libavformat/matroskadec.c libavformat/matroskaenc.c libavformat/mov.c libavformat/movenc.c libavformat/mp3dec.c libavformat/mpeg.c libavformat/mpegts.c libavformat/mxf.c libavformat/mxfdec.c libavformat/mxfenc.c libavformat/nsvdec.c libavformat/nut.c libavformat/oggenc.c libavformat/pmpdec.c libavformat/rawdec.c libavformat/rawenc.c libavformat/riff.c libavformat/sdp.c libavformat/utils.c libavformat/vocenc.c libavformat/wtv.c libavformat/xmv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-071-1/+1
| |
* | Merge commit '1470ce21cec5ee26e106e2a884c26bbf84e5aaea'Michael Niedermayer2012-07-221-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1470ce21cec5ee26e106e2a884c26bbf84e5aaea': Bump libavcodec and libavformat minor versions for G.723.1 decoder and demuxer G.723.1 demuxer and decoder Add a shift parameter to celp_lp_synthesis_filter() libopenjpeg: K&R formatting cosmetics yadif: use emms_c() instead of inline assembly for emms invocations. ac3: don't use different names for option tables in the template file. lavfi: use const for AVFilterPad declarations in all filters. adpcm: don't duplicate identical AVSampleFmt array for each encoder. configure: cosmetics: Group test dependencies together configure: add more passthrough flags in tms470 filter configure: move flag filtering functions out of if/else blocks Conflicts: Changelog configure doc/general.texi libavcodec/Makefile libavcodec/ac3enc_fixed.c libavcodec/allcodecs.c libavcodec/eac3enc.c libavcodec/g723_1.c libavcodec/g723_1_data.h libavcodec/libopenjpegdec.c libavcodec/libopenjpegenc.c libavcodec/v210dec.h libavcodec/version.h libavfilter/af_anull.c libavfilter/asrc_anullsrc.c libavfilter/f_settb.c libavfilter/fifo.c libavfilter/split.c libavfilter/src_movie.c libavfilter/vf_aspect.c libavfilter/vf_blackframe.c libavfilter/vf_boxblur.c libavfilter/vf_copy.c libavfilter/vf_crop.c libavfilter/vf_cropdetect.c libavfilter/vf_delogo.c libavfilter/vf_drawbox.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_fieldorder.c libavfilter/vf_format.c libavfilter/vf_frei0r.c libavfilter/vf_gradfun.c libavfilter/vf_hflip.c libavfilter/vf_hqdn3d.c libavfilter/vf_libopencv.c libavfilter/vf_lut.c libavfilter/vf_null.c libavfilter/vf_overlay.c libavfilter/vf_pad.c libavfilter/vf_pixdesctest.c libavfilter/vf_scale.c libavfilter/vf_select.c libavfilter/vf_setpts.c libavfilter/vf_showinfo.c libavfilter/vf_slicify.c libavfilter/vf_transpose.c libavfilter/vf_unsharp.c libavfilter/vf_vflip.c libavfilter/vf_yadif.c libavfilter/vsrc_color.c libavfilter/vsrc_testsrc.c libavformat/Makefile libavformat/allformats.c libavformat/g723_1.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ac3: don't use different names for option tables in the template file.Ronald S. Bultje2012-07-211-1/+1
| | | | | | | | | | The variables which are declared in the teplate file are static and therefore there is no symbol clash.
* | lavc: use designated initializers for AVClassesPaul B Mahol2012-06-231-2/+6
|/ | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* cosmetics: Align codec declarationsMartin Storsjö2012-04-061-1/+2
| | | | | | | Also break some long lines, remove codec function placeholder comments and add spaces in sample/pixel format lists. Signed-off-by: Martin Storsjö <martin@martin.st>
* ac3enc: update to AVCodec.encode2()Justin Ruggles2012-03-201-1/+1
| | | | Update FATE references due to encoder delay.
* (e)ac3enc: select a default bit rate based on the channel layoutJustin Ruggles2012-02-291-0/+1
|
* ac3enc: allow new coupling coordinates to be sent independently for eachJustin Ruggles2011-08-091-1/+1
| | | | channel.
* eac3enc: support writing of basic mixing and info metadataJustin Ruggles2011-07-271-4/+42
|
* eac3enc: use different numbers of blocks per frame to allow higher bitratesJustin Ruggles2011-07-211-8/+22
|
* cosmetics: indentationJustin Ruggles2011-07-191-3/+3
|
* eac3enc: use frame exponent strategy when applicable.Justin Ruggles2011-07-191-3/+58
| | | | | | | This checks if the set of selected exponent strategies for all blocks in a channel are in the frame exponent strategy table, and if so, writes the table index instead of each strategy. This saves up to 7 bits per channel per frame, so the overall effect on quality is small.
* ac3enc: Mark AVClasses constMartin Storsjö2011-07-151-2/+2
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* ac3enc: move ff_ac3_encode_frame() to ac3enc_template.cJustin Ruggles2011-06-271-1/+1
| | | | | This avoids using function pointers for quite a few small functions, most of which just call DSP functions.
* ac3enc: split templated float vs. fixed functions into a separate file.Justin Ruggles2011-06-131-0/+24
| | | | | Function pointers are used for templated functions instead of needlessly duplicating many functions.
* Move E-AC-3 encoder functions to a separate eac3enc.c file.Justin Ruggles2011-06-071-0/+131