aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vaapi_mpeg4.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/mpegvideo: Move fields to {H263Dec,MPVEnc}Context when possibleAndreas Rheinhardt2025-07-031-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Stop using MpegEncContext.gbAndreas Rheinhardt2025-07-031-4/+4
| | | | | | | | Add a GetBitContext to H263DecContext instead. This is in preparation for removing MpegEncContext.gb. Also move last_resync_gb to H263DecContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Add H263DecContextAndreas Rheinhardt2025-07-031-1/+1
| | | | | | | | | This is in preparation for moving the fields only used by H.263-based decoders from MPVContext to H263DecContext. For now only the decode_mb function pointer has been moved (to be able to switch said callback to use an H263DecContext*). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move mpeg_quant to {Mpeg4Dec,MPVEnc}ContextAndreas Rheinhardt2025-05-261-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move [fb]_code to Mpeg4Dec and MPVEncContextAndreas Rheinhardt2025-05-161-2/+2
| | | | | | | | It is only used by the MPEG-4 decoder and the encoders. Notice that this field is a per-frame property and therefore does not need to by synced in mpeg4_update_thread_context(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* FFHWAccel: add buffer_ref argument to start_frameLynne2025-03-171-1/+4
| | | | | | | | This commit adds a reference to the buffer as an argument to start_frame, and adapts all existing code. This allows for asynchronous hardware accelerators to skip copying packet data by referencing it.
* avcodec/mpegvideo: Move quant_precision to Mpeg4DecContextAndreas Rheinhardt2024-06-201-1/+1
| | | | | | | | It is an MPEG-4-only value; it is always five for the MPEG-4 encoder, so just hardcode this value and move the MpegEncContext field to Mpeg4DecContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Split MPVPicture into WorkPicture and ordinary PicAndreas Rheinhardt2024-06-121-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two types of MPVPictures: Three (cur_pic, last_pic, next_pic) that are directly part of MpegEncContext and an array of MPVPictures that are separately allocated and are mostly accessed via pointers (cur|last|next)_pic_ptr; they are also used to store AVFrames in the encoder (necessary due to B-frames). As the name implies, each of the former is directly associated with one of the _ptr pointers: They actually share the same underlying buffers, but the ones that are part of the context can have their data pointers offset and their linesize doubled for field pictures. Up until now, each of these had their own references; in particular, there was an underlying av_frame_ref() to sync cur_pic and cur_pic_ptr etc. This is wasteful. This commit changes this relationship: cur_pic, last_pic and next_pic now become MPVWorkPictures; this structure does not have an AVFrame at all any more, but only the cached values of data and linesize. It also contains a pointer to the corresponding MPVPicture, establishing a more natural relationsship between the two. This already means that creating the context-pictures from the pointers can no longer fail. What has not been changed is the fact that the MPVPicture* pointers are not ownership pointers and that the MPVPictures are part of an array of MPVPictures that is owned by a single AVCodecContext. Doing so will be done in a latter commit. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Shorten variable namesAndreas Rheinhardt2024-06-121-7/+7
| | | | | | | | current_picture->cur_pic, last_picture->last_pic, similarly for new_picture and next_picture. Also rename the corresponding *_ptr fields. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/vaapi_decode: Make it possible to send multiple slice params buffersDavid Rosca2024-05-291-1/+1
| | | | | | Reviewed-by: Neal Gompa <ngompa13@gmail.com> Signed-off-by: David Rosca <nowrep@gmail.com> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* avcodec/avcodec: Add FFHWAccel, hide internals of AVHWAccelAndreas Rheinhardt2023-08-071-10/+10
| | | | | | | | | This commit is the AVHWAccel analogue of commit 20f972701806be20a77f808db332d9489343bb78: It moves the private fields of AVHWAccel to a new struct FFHWAccel extending AVHWAccel in an internal header (namely hwaccel_internal.h). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/hwconfig: Move HWACCEL_CAP_* to a new headerAndreas Rheinhardt2023-08-071-1/+1
| | | | | | | | | | | | | | libavcodec/hwconfig.h currently contains HWACCEL_CAP_* flags as well as the definition of AVCodecHWConfigInternal and some macros to create them. The users of these two are nearly disjoint: The flags are used by files providing AVHWAccels whereas AVCodecHWConfigInternal is used by files providing codecs (for FFCodec.hw_configs). This patch therefore moves these flags to a new file hwaccel_internal.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Move sprite-related fields to Mpeg4DecContextAndreas Rheinhardt2022-10-201-1/+1
| | | | | | Only used there. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-161-0/+2
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/mpegvideo: Move decoder-only stuff to a new headerAndreas Rheinhardt2022-02-131-0/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4video.h: Move decoder-only parts to a new headerAndreas Rheinhardt2022-02-131-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* all: Remove unnecessary libavcodec/internal.h inclusionsAndreas Rheinhardt2022-02-081-1/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc: Rename hwaccel.h to hwconfig.hMark Thompson2020-04-261-1/+1
| | | | | This already applied to decoders as well as hwaccels, and adding encoder support was going to make the name even more inaccurate.
* lavc: Mark all AVHWAccel structures as constMark Thompson2017-11-261-2/+2
|
* Merge commit 'b46a77f19ddc4b2b5fa3187835ceb602a5244e24'James Almer2017-11-111-0/+2
|\ | | | | | | | | | | | | | | | | * commit 'b46a77f19ddc4b2b5fa3187835ceb602a5244e24': lavc: external hardware frame pool initialization Includes the fix from e724bdfffbd3c27aac53d1f32f20f105f37caef0 Merged-by: James Almer <jamrial@gmail.com>
| * lavc: external hardware frame pool initializationwm42017-10-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This adds a new API, which allows the API user to query the required AVHWFramesContext parameters. This also reduces code duplication across the hwaccels by introducing ff_decode_get_hw_frames_ctx(), which uses the new API function. It takes care of initializing the hw_frames_ctx if needed, and does additional error handling and API usage checking. Support for VDA and Cuvid missing. Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * pthread_frame: do not run hwaccel decoding asynchronously unless it's safeAnton Khirnov2016-12-191-0/+3
| | | | | | | | | | | | | | | | | | | | Certain hardware decoding APIs are not guaranteed to be thread-safe, so having the user access decoded hardware surfaces while the decoder is running in another thread can cause failures (this is mainly known to happen with DXVA2). For such hwaccels, only allow the decoding thread to run while the user is inside a lavc decode call (avcodec_send_packet/receive_frame).
| * vaapi_mpeg4: Convert to use the new VAAPI hwaccel codeMark Thompson2016-08-301-82/+133
| |
* | pthread_frame: do not run hwaccel decoding asynchronously unless it's safeAnton Khirnov2017-03-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain hardware decoding APIs are not guaranteed to be thread-safe, so having the user access decoded hardware surfaces while the decoder is running in another thread can cause failures (this is mainly known to happen with DXVA2). For such hwaccels, only allow the decoding thread to run while the user is inside a lavc decode call (avcodec_send_packet/receive_frame). Merges Libav commit d4a91e65. Signed-off-by: wm4 <nfxjfg@googlemail.com> Tested-by: Michael Niedermayer <michael@niedermayer.cc>
* | vaapi_mpeg4: Restore changes overwritten by mergeMark Thompson2017-01-221-12/+1
| | | | | | | | From 2aa8e33d7d86fbc4a4060c363a5733067c160654.
* | vaapi_mpeg4: Convert to use the new VAAPI hwaccel codeMark Thompson2017-01-171-90/+145
| | | | | | | | (cherry picked from commit ccd0316f7cab760a93052206e8150f6b178c1e39)
* | Merge commit '5f1c3cbd524728317bf460259aa8f3ef5ec935c6'Clément Bœsch2016-06-211-4/+0
|\| | | | | | | | | | | | | * commit '5f1c3cbd524728317bf460259aa8f3ef5ec935c6': vaapi: Drop pointless debug output Merged-by: Clément Bœsch <clement@stupeflix.com>
| * vaapi: Drop pointless debug outputDiego Biurrun2016-05-031-4/+0
| |
| * lavu: deprecate AV_PIX_FMT_VAAPI_*, replace with AV_PIX_FMT_VAAPIMark Thompson2016-03-191-2/+2
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'e60a6e7545dd6f5b25e3a65de9c6fdcc6e2e9d6b'Hendrik Leppkes2015-09-161-0/+1
|\| | | | | | | | | | | | | * commit 'e60a6e7545dd6f5b25e3a65de9c6fdcc6e2e9d6b': mpegvideo: Drop mpegvideo.h where not needed Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mpegvideo: Drop mpegvideo.h where not neededVittorio Giovara2015-09-131-0/+1
| | | | | | | | Add necessary headers in .c files.
* | vaapi: streamline public context structure.Gwenole Beauchesne2015-08-191-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | Move libavcodec managed objects from the public struct vaapi_context to a new privately owned FFVAContext. This is done so that to clean up and streamline the public structure, but also to prepare for new codec support, thus requiring new internal data to be added in there. The AVCodecContext.hwaccel_context, that holds the public vaapi_context, shall no longer be accessed from within vaapi_*.c codec support files. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
* | vaapi: define a unique pixel format for VA-API (AV_PIX_FMT_VAAPI).Gwenole Beauchesne2015-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | Deprecate older VA pixel formats (MOCO, IDCT) as it is now very unlikely to ever be useful in the future. Only keep plain AV_PIX_FMT_VAAPI format that is aliased to the older VLD variant. This is an API change. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
* | Merge commit '0c69164f451cc9ca6ce9d6e7568083e2776bc845'Michael Niedermayer2015-04-291-1/+1
|\| | | | | | | | | | | | | | | | | | | * commit '0c69164f451cc9ca6ce9d6e7568083e2776bc845': h263: Convert function to macro Conflicts: libavcodec/h263.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * h263: Convert function to macroVittorio Giovara2015-04-281-1/+1
| |
* | Merge commit '5aed1d4240d411533c102eec6944aa925b7f4964'Michael Niedermayer2015-04-261-1/+1
|\| | | | | | | | | | | | | | | * commit '5aed1d4240d411533c102eec6944aa925b7f4964': vaapi: Fix -Wimplicit-function-declaration for ff_dlog() usage See: 8f7b022c8c2f40bf8ddfd90778a4c91424d3a8e5 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * vaapi: Fix -Wimplicit-function-declaration for ff_dlog() usageRico Tzschichholz2015-04-261-0/+1
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'Michael Niedermayer2015-04-201-2/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavc: Replace av_dlog and tprintf with internal macrosVittorio Giovara2015-04-191-2/+2
| |
* | Merge commit '7ea1b3472a61de4aa4d41b571e99418e4997ad41'Michael Niedermayer2014-10-151-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7ea1b3472a61de4aa4d41b571e99418e4997ad41': lavc: deprecate the use of AVCodecContext.time_base for decoding Conflicts: libavcodec/avcodec.h libavcodec/h264.c libavcodec/mpegvideo_parser.c libavcodec/utils.c libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: deprecate the use of AVCodecContext.time_base for decodingAnton Khirnov2014-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | When decoding, this field holds the inverse of the framerate that can be written in the headers for some codecs. Using a field called 'time_base' for this is very misleading, as there are no timestamps associated with it. Furthermore, this field is used for a very different purpose during encoding. Add a new field, called 'framerate', to replace the use of time_base for decoding.
| * vaapi: Update idct_permutation location after dsputil/idctdsp splitDiego Biurrun2014-07-011-1/+1
| |
* | Merge commit 'e3fcb14347466095839c2a3c47ebecff02da891e'Michael Niedermayer2014-07-011-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e3fcb14347466095839c2a3c47ebecff02da891e': dsputil: Split off IDCT bits into their own context Conflicts: configure libavcodec/aic.c libavcodec/arm/Makefile libavcodec/arm/dsputil_init_arm.c libavcodec/arm/dsputil_init_armv6.c libavcodec/asvdec.c libavcodec/dnxhdenc.c libavcodec/dsputil.c libavcodec/dvdec.c libavcodec/dxva2_mpeg2.c libavcodec/intrax8.c libavcodec/mdec.c libavcodec/mjpegdec.c libavcodec/mjpegenc_common.h libavcodec/mpegvideo.c libavcodec/ppc/dsputil_altivec.h libavcodec/ppc/dsputil_ppc.c libavcodec/ppc/idctdsp.c libavcodec/x86/Makefile libavcodec/x86/dsputil_init.c libavcodec/x86/dsputil_mmx.c libavcodec/x86/dsputil_x86.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2014-04-091-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mpegvideo: operate with pointers to AVFrames instead of whole structs Conflicts: libavcodec/h261dec.c libavcodec/h263dec.c libavcodec/intrax8.c libavcodec/mpeg12enc.c libavcodec/mpegvideo.c libavcodec/mpegvideo.h libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/mpegvideo_xvmc.c libavcodec/msmpeg4.c libavcodec/ratecontrol.c libavcodec/vaapi.c libavcodec/vc1dec.c libavcodec/vdpau_vc1.c See: fc567ac49e17151f00f31b59030cd10f952612ef Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegvideo: operate with pointers to AVFrames instead of whole structswm42014-04-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The most interesting parts are initialization in ff_MPV_common_init() and uninitialization in ff_MPV_common_end(). ff_mpeg_unref_picture and ff_thread_release_buffer have additional NULL checks for Picture.f, because these functions can be called on uninitialized or partially initialized Pictures. NULL pointer checks are added to ff_thread_release_buffer() stub function. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * vaapi: switch ff_vaapi_get_surface_id from Picture to AVFramewm42014-03-201-2/+2
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | avcodec/vaapi: fix pointer types after H264Picture changesMichael Niedermayer2014-03-171-2/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f7d228676cb7669059889c4225c8a8dc56708c24'Michael Niedermayer2013-12-061-2/+2
|\| | | | | | | | | | | | | | | | | | | * commit 'f7d228676cb7669059889c4225c8a8dc56708c24': mpeg4videodec: move intra_dc_threshold from MpegEncContext to Mpeg4DecContext Conflicts: libavcodec/mpeg4videodec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpeg4videodec: move intra_dc_threshold from MpegEncContext to Mpeg4DecContextAnton Khirnov2013-12-051-2/+2
| |
* | Merge commit 'e026ee0446de27fc38e33e98704fada012fdc763'Michael Niedermayer2013-11-301-2/+2
|\| | | | | | | | | | | | | * commit 'e026ee0446de27fc38e33e98704fada012fdc763': mpeg4videodec: move sprite_{shift,traj} from MpegEncContext to Mpeg4DecContext Merged-by: Michael Niedermayer <michaelni@gmx.at>