summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg4_unpack_bframes_bsf.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/mpeg4video: Factor non-codec stuff out into a header of its ownAndreas Rheinhardt2022-09-021-1/+1
| | | | | | This avoids including mpegvideo.h in mpeg4_unpack_bframes_bsf.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/bsf: Add FFBitStreamFilter, hide internals of BSFsAndreas Rheinhardt2022-03-231-3/+3
| | | | | | | | | | This patch is analogous to 20f972701806be20a77f808db332d9489343bb78: It hides the internal part of AVBitStreamFilter by adding a new internal structure FFBitStreamFilter (declared in bsf_internal.h) that has an AVBitStreamFilter as its first member; the internal part of AVBitStreamFilter is moved to this new structure. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal.h: Move avpriv_find_start_code() to startcode.hAndreas Rheinhardt2022-02-081-1/+1
| | | | | | | | This is by definition the appropriate place for it. Remove all the now unnecessary libavcodec/internal.h inclusions; also remove other unnecessary headers from the affected files. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec.h: split bitstream filters API into its own headerAnton Khirnov2020-05-221-1/+1
|
* lavc: rename bsf.h to bsf_internal.hAnton Khirnov2020-05-221-1/+1
| | | | This will allow adding a public header named bsf.h
* mpeg4_unpack_bframes: Merge close and flushAndreas Rheinhardt2019-10-191-9/+3
| | | | | | | They are identical now. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* mpeg4_unpack_bframes: Avoid allocations and copies of packet structuresAndreas Rheinhardt2019-10-171-42/+35
| | | | | | | | | | | | | | | | | | | | | | 1. Since bd90a2ec, mpeg4_unpack_bframes caches whole packets instead of just the pointer to the buffer and the buffer's size in order to be able to make use of refcounting to avoid copying of data; this unfortunately introduced copies of packet structures and side data (if existing), although the only fields that are needed are the buffer-related ones (data, size and buf). This can be changed without compromising the advantages of refcounting by storing a reference to the buffer. 2. This change also makes it easy to use only one packet throughout so that an allocation and free of an AVPacket structure per filtered packet can be saved by switching to ff_bsf_get_packet_ref. 3. Furthermore, this commit also fixes a memleak introduced in bd90a2ec: If a stored b_frame with side data was used for a later frame, the side data would leak when the input frame's properties were copied into the output frame. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4_unpack_bframes_bsf: Use avpriv_find_start_codeAndreas Rheinhardt2019-02-041-24/+10
| | | | | | | | | | | instead of an ad-hoc function to search for start codes in order to remove code duplication and to improve performance. Improved performance of finding startcodes from 52606 decicycles to 9543 decicycles based upon 262144 runs for a 1 Mb/s MPEG4 video. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4_unpack_bframes_bsf: implement a AVBSFContext.flush() callbackJames Almer2018-08-161-0/+7
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpeg4_unpack_bframes: cache input packets directlyJames Almer2018-04-251-37/+19
| | | | | | Avoids unnecessary allocs+copies and makes the code slightly simpler. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpeg4_unpack_bframes: make sure the packet is writable when data ↵James Almer2018-03-221-0/+3
| | | | | | | | | | needs to be changed Nothing currently guarantees that the packet passed to the bsf will be writable. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpeg4_unpack_bframes: reduce code duplicationJames Almer2018-03-201-10/+10
| | | | | | | | Also fixes one potential leak of side data in out if the av_packet_from_data() call fails. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpeg4_unpack_bframes_bsf: Check av_packet_from_data() return valueJan Sebechlebsky2016-07-221-1/+5
| | | | | Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4_unpack_bframes_bsf: Copy packet propsJan Sebechlebsky2016-07-221-0/+6
| | | | | | | | | | | | | | | | mpeg4_unpack_bframes_bsf bitstream filters constructs resulting packet using av_packet_from_data() function. This function however modifies only buffer (data) and leaves other fields untouched, so the content of other fields of the output packet is undefined. It is working with old BSF API, since old API filters just data and the packet fields are copied in av_apply_bitstream_filters from input packet. This change fixes the behaviour for the new BSF API. Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '33d18982fa03feb061c8f744a4f0a9175c1f63ab'Derek Buitenhuis2016-04-171-67/+64
| | | | | | | | | * commit '33d18982fa03feb061c8f744a4f0a9175c1f63ab': lavc: add a new bitstream filtering API Conversions-by: Hendrik Leppkes <h.leppkes@gmail.com> Conversions-by: Derek Buitenguis <derek.buitenhuis@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* avcodec: add unpack packed B-frames bitstream filterAndreas Cadhalpun2015-04-051-0/+194
Fixes Ticket #2913 Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>