summaryrefslogtreecommitdiff
path: root/libavcodec/g722enc.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>
* g722: 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/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/g722enc: Avoid copying packet data, allow user-supplied buffersAndreas Rheinhardt2021-05-05
| | | | | | | | When the packet size is known in advance like here, 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. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/g722enc: Mark encoder as init-threadsafeAndreas Rheinhardt2021-05-02
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.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/g722enc: Validate parameters before using themAndreas Rheinhardt2021-02-08
| | | | | | | | In case trellis is outside of 0..23, an invalid shift and/or a signed integer overflow happens; furthermore, it can lead to the request to allocate nonsense amounts of memory. So validate first. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/g722enc: Cleanup generically on init failureAndreas Rheinhardt2020-09-19
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/g722enc: force mono channel layoutKyle Swanson2017-06-26
| | | | Signed-off-by: Kyle Swanson <k@ylo.ph>
* 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>
* | Merge commit '9abc80f1ed673141326341e26a05c3e1f78576d0'Michael Niedermayer2015-02-21
|\| | | | | | | | | | | | | | | | | | | * commit '9abc80f1ed673141326341e26a05c3e1f78576d0': libavcodec: Make use of av_clip functions Conflicts: libavcodec/takdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavcodec: Make use of av_clip functionsPeter Meerwald2015-02-21
| | | | | | | | | | Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '10f160768b824f00933f33bc69f1fae89a25dfc8'Michael Niedermayer2015-02-16
|\| | | | | | | | | | | | | * commit '10f160768b824f00933f33bc69f1fae89a25dfc8': g722: Reduce number of pointers passed to g722_apply_qmf() function Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * g722: Reduce number of pointers passed to g722_apply_qmf() functionPeter Meerwald2015-02-15
| | | | | | | | | | Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '67690683130faf37dd9d969ced15eba2a1940ade'Michael Niedermayer2015-02-16
|\| | | | | | | | | | | | | * commit '67690683130faf37dd9d969ced15eba2a1940ade': g722: Split out g722_qmf_apply() function into g722dsp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * g722: Split out g722_qmf_apply() function into g722dsp.cPeter Meerwald2015-02-15
| | | | | | | | | | Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Martin Storsjö <martin@martin.st>
* | avcodec/g722enc: Use av_mallocz_array()Michael Niedermayer2015-01-15
| | | | | | | | Signed-off-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>
| * 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 '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
| |
* | Reinstate proper FFmpeg license for all files.Thilo Borgmann2013-08-30
| |
* | Merge commit '0f24a3ca999a702f83af9307f9f47b6fdeb546a5'Michael Niedermayer2013-03-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '0f24a3ca999a702f83af9307f9f47b6fdeb546a5': lavc: remove disabled FF_API_OLD_ENCODE_VIDEO cruft lavc: remove disabled FF_API_OLD_ENCODE_AUDIO cruft lavc: remove disabled FF_API_OLD_DECODE_AUDIO cruft Conflicts: libavcodec/flacenc.c libavcodec/libgsm.c libavcodec/utils.c libavcodec/version.h The compatibility wrapers are left as they likely sre still in wide use. They will be removed when they break or otherwise cause work without an volunteer being available. Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: remove disabled FF_API_OLD_ENCODE_AUDIO cruftAnton Khirnov2013-03-09
| |
* | normalize calls to ff_alloc_packet2James Zern2013-03-06
| | | | | | | | | | | | | | - check ret < 0 - remove excessive error log Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '6d0beefbf6ee6dbf8efb522a9307e54c6ed5f702'Michael Niedermayer2012-10-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6d0beefbf6ee6dbf8efb522a9307e54c6ed5f702': swscale: Do not make ff_ symbols globally visible. rtspdec: use av_strlcpy for writing into fixed size buffer g722enc: fix size argument in memset http: use av_strlcpy instead of strcpy() without size checks avfilter: correct memcpy size avfilter_copy_buf_props() lavc: split asv12 encoder/decoder Conflicts: libavcodec/asvdec.c libavfilter/buffer.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * g722enc: fix size argument in memsetJanne Grunau2012-10-09
| | | | | | | | Fixes CID700725.
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-08-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: Fix even more missing includes after the common.h removal build: Factor out rangecoder dependencies to CONFIG_RANGECODER build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE x86: avcodec: Consistently name all init files Add more missing includes after removing the implicit common.h Add some more missing includes after removing the implicit common.h Don't include common.h from avutil.h rtmp: Automatically compute the hash for SWFVerification Conflicts: configure doc/APIchanges doc/examples/decoding_encoding.c libavcodec/Makefile libavcodec/assdec.c libavcodec/audio_frame_queue.c libavcodec/avpacket.c libavcodec/dv_profile.c libavcodec/dwt.c libavcodec/libtheoraenc.c libavcodec/rawdec.c libavcodec/rv40dsp.c libavcodec/tiff.c libavcodec/tiffenc.c libavcodec/v210dec.h libavcodec/vc1dsp.c libavcodec/x86/Makefile libavfilter/asrc_anullsrc.c libavfilter/avfilter.c libavfilter/buffer.c libavfilter/formats.c libavfilter/vf_ass.c libavfilter/vf_drawtext.c libavfilter/vf_fade.c libavfilter/vf_select.c libavfilter/video.c libavfilter/vsrc_testsrc.c libavformat/version.h libavutil/audioconvert.c libavutil/error.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Don't include common.h from avutil.hMartin Storsjö2012-08-15
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'Michael Niedermayer2012-08-07
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-07
| |
* | g722enc: switch to av_assertMichael Niedermayer2012-08-01
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-04-07
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: rtpdec_asf: Set the no_resync_search option for the chained asf demuxer asfdec: Add an option for not searching for the packet markers cosmetics: Clean up the tiffenc pix_fmts declaration to match the style of others cosmetics: Align codec declarations cosmetics: Convert mimic.c to utf-8 avconv: remove an unused function parameter. avconv: remove now pointless variables. avconv: drop support for building without libavfilter. nellymoserenc: fix crash due to memsetting the wrong area. libavformat: Only require first packet to be known for audio/video streams avplay: Don't try to scale timestamps if the tb isn't set Conflicts: Changelog configure ffmpeg.c libavcodec/aacenc.c libavcodec/bmpenc.c libavcodec/dnxhddec.c libavcodec/dnxhdenc.c libavcodec/ffv1.c libavcodec/flacenc.c libavcodec/fraps.c libavcodec/huffyuv.c libavcodec/libopenjpegdec.c libavcodec/mpeg12enc.c libavcodec/mpeg4videodec.c libavcodec/pamenc.c libavcodec/pgssubdec.c libavcodec/pngenc.c libavcodec/qtrleenc.c libavcodec/rawdec.c libavcodec/sgienc.c libavcodec/tiffenc.c libavcodec/v210dec.c libavcodec/wmv2dec.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Align codec declarationsMartin Storsjö2012-04-06
| | | | | | | | | | | | | | 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>
* | cosmetics: remove superfluous curly bracketsPaul B Mahol2012-03-23
| | | | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | g722enc: switch to ff_alloc_packet2()Michael Niedermayer2012-03-22
|/ | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* g722enc: use AVCodec.encode2()Justin Ruggles2012-03-20
| | | | | FATE reference updated due timestamp rounding because of resampling from 44100 Hz to 16000 Hz in avconv.
* g722: Fix the QMF scalingMartin Storsjö2012-03-02
| | | | | | | | | | | | | | | This fixes clipping if the encoder input used the full 16 bit input range (samples with a magnitude below 16383 worked fine). The filtered subband samples should be 15 bit maximum, while the code earlier produced them scaled to 16 bit. This makes the decoder output have double the magnitude compared to before. The spec reference samples doesn't test the QMF at all, which was why this part slipped past initially. Signed-off-by: Martin Storsjö <martin@martin.st>
* g722enc: check for trellis data allocation errorJustin Ruggles2012-02-25
|
* g722enc: validate AVCodecContext.trellisJustin Ruggles2012-01-07
|
* g722enc: set frame_size, and also handle an odd number of input samplesJustin Ruggles2012-01-07
| | | | | The fate reference is updated because the previous test skipped a sample in each encode() call due each input frame having an odd number of samples.
* g722enc: split encoding into separate functions for trellis vs. no trellisJustin Ruggles2012-01-07
|
* Fix a bunch of common typos.Diego Biurrun2011-12-11
|
* g722: Change bits per sample to 4Sjoerd Simons2011-12-05
| | | | | | | | | | | | | | | Earlier, bits per sample was defined as 8, since bits_per_coded_sample was used to indicate whether to ignore the lower bits of the codeword, having values 6, 7 or 8. g722 encodes 2 samples into one byte codeword, therefore the bits per sample is 4. By changing this, the generated timestamps for streams encoded with g722 become correct. This makes timestamp generation for g722 data correct (both when encoding and when demuxing from raw g722 files). Signed-off-by: Martin Storsjö <martin@martin.st>
* g722: split decoder and encoder into separate filesJustin Ruggles2011-10-23