summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
...
* avcodec/avcodec: Move initializing frame-thrd encoder to encode_preinitAndreas Rheinhardt2022-08-15
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* configure: always enable gnu_windres if availableTimo Rothenpieler2022-08-13
| | | | | Use the appropiate Makefile variable to ensure the resource file is only built into shared libraries instead.
* avcodec/mimic: Fix undefined pointer arithmeticAndreas Rheinhardt2022-08-12
| | | | | | | NULL + anything is UB. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/qsv: create mfx session using oneVPL for decoding/encodingHaihao Xiang2022-08-12
| | | | | | | | If qsv hwdevice is available, use the mfxLoader handle in qsv hwdevice to create mfx session. Otherwise create mfx session with a new mfxLoader handle. This is in preparation for oneVPL support
* qsv: restrict OPAQUE memory to MFX_VERSION < 2.0Haihao Xiang2022-08-12
| | | | | | | | OPAQUE memory isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2] https://github.com/oneapi-src/oneVPL
* qsvenc: restrict MFX_RATECONTROL_LA_EXT to MFX_VERSION < 2.0Haihao Xiang2022-08-12
| | | | | | | | MFX_RATECONTROL_LA_EXT isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2] https://github.com/oneapi-src/oneVPL
* qsvenc: restrict multi-frame encode to MFX_VERSION < 2.0Haihao Xiang2022-08-12
| | | | | | | | Multi-frame encode isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2] https://github.com/oneapi-src/oneVPL
* qsv: restrict audio related code to MFX_VERSION < 2.0Haihao Xiang2022-08-12
| | | | | | | | Audio isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL support [1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2] https://github.com/oneapi-src/oneVPL
* qsv: restrict user plugin to MFX_VERSION < 2.0Haihao Xiang2022-08-12
| | | | | | | | User plugin isn't supported for MFX_VERSION >= 2.0[1][2]. This is in preparation for oneVPL Support [1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#msdk-full-name-feature-removals [2] https://github.com/oneapi-src/oneVPL
* qsv: remove mfx/ prefix from mfx headersHaihao Xiang2022-08-12
| | | | | | | | | | | | | | | | | | | | | | | | The following Cflags has been added to libmfx.pc, so mfx/ prefix is no longer needed when including mfx headers in FFmpeg. Cflags: -I${includedir} -I${includedir}/mfx Some old versions of libmfx have the following Cflags in libmfx.pc Cflags: -I${includedir} We may add -I${includedir}/mfx to CFLAGS when running 'configure --enable-libmfx' for old versions of libmfx, if so, mfx headers without mfx/ prefix can be included too. If libmfx comes without pkg-config support, we may do a small change to the settings of the environment(e.g. set -I/opt/intel/mediasdk/include/mfx instead of -I/opt/intel/mediasdk/include to CFLAGS), then the build can find the mfx headers without mfx/ prefix After applying this change, we won't need to change #include for mfx headers when mfx headers are installed under a new directory. This is in preparation for oneVPL support (mfx headers in oneVPL are installed under vpl directory)
* avcodec/mpegvideo: Move setting mb_height to ff_mpv_init_context_frameAndreas Rheinhardt2022-08-10
| | | | | | | | | | | It is the proper place to set it, directly besides mb_width and mb_stride. The reason for doing it the way it is done now seems to be that the code does not create more slice contexts than necessary (i.e. not more than one per row), so that this number needs to be known before setting the number of slices. But this can always be arranged by just moving the code that sets the number of slices. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Remove redundant castAndreas Rheinhardt2022-08-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Remove redundant checkAndreas Rheinhardt2022-08-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_enc: Don't copy Picture unnecessarilyAndreas Rheinhardt2022-08-10
| | | | | | Also add const where possible. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Move encoding_error and mb_var_sum to MpegEncCtxAndreas Rheinhardt2022-08-10
| | | | | | | | These fields are only ever set by the encoder for the current picture and for no other picture. So only one set of these values needs to exist, so move them to MpegEncContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Remove always-true checksAndreas Rheinhardt2022-08-10
| | | | | | | | Of all the buffers that are made writable, three are always allocated and the other four are allocated iff any one of them is allocated; so one can replace the seven checks for existence with one. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegutils: Constify ff_print_debug_info2, ff_draw_horiz_bandAndreas Rheinhardt2022-08-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegutils: Combine multiple av_log statementsAndreas Rheinhardt2022-08-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/wmv2dec: Zero mb_type array for I picturesAndreas Rheinhardt2022-08-10
| | | | | | | | | | | | | | | | | | | | Up until now, ff_wmv2_decode_secondary_picture_header() only set the mb_type array for non I-pictures, so that the decoding process uses the earlier values of this array; this affects the output of the wmv8-x8intra FATE-test (which this patch therefore updates). These earlier values were set when decoding earlier frames or when the buffer was initially zero-allocated. A consequence of this is that the output of this test would be random if ff_find_unused_picture() would select the unused picture to return at random. Furthermore decoding from a keyframe onwards depends upon the earlier state of the decoder. This patch therefore zeroes said array when decoding an I picture. (It is not claimed that zero is the right value to fill the array with. I just don't know.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Remove redundant reporting of progress on errorAndreas Rheinhardt2022-08-10
| | | | | | Redundant since 5e03eea673a9da2253ed15152e46b1422b35d145. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/pthread_frame: Fix compiling with thread-unsafe-callbacks disabledAndreas Rheinhardt2022-08-10
| | | | | | Forgotten in 02220b88fc38ef9dd4f2d519f5d3e4151258b60c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Move mb_var, mc_mb_var and mb_mean to MpegEncCtxAndreas Rheinhardt2022-08-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tables are only used by encoders and only for the current picture; ergo they need not be put into the picture at all, but rather into the encoder's context. They also don't need to be refcounted, because there is only one owner. In contrast to this, the earlier code refcounts them which incurs unnecessary overhead. These references are not unreferenced in ff_mpeg_unref_picture() (they are kept in order to have something like a buffer pool), so that several buffers are kept at the same time, although only one is needed, thereby wasting memory. The code also propagates references to other pictures not part of the pictures array (namely the copy of the current/next/last picture in the MpegEncContext which get references of their own). These references are not unreferenced in ff_mpeg_unref_picture() (the buffers are probably kept in order to have something like a pool), yet if the current picture is a B-frame, it gets unreferenced at the end of ff_mpv_encode_picture() and its slot in the picture array will therefore be reused the next time; but the copy of the current picture also still has its references and therefore these buffers will be made duplicated in order to make them writable in the next call to ff_mpv_encode_picture(). This is of course unnecessary. Finally, ff_find_unused_picture() is supposed to just return any unused picture and the code is supposed to work with it; yet for the vsynth*-mpeg4-adap tests the result depends upon the content of these buffers; given that this patchset changes the content of these buffers (the initial content is now the state of these buffers after encoding the last frame; before this patch the buffers used came from the last picture that occupied the same slot in the picture array) their ref-files needed to be changed. This points to a bug somewhere (if one removes the initialization, one gets uninitialized reads in adaptive_quantization in ratecontrol.c). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/vaapi_encode: enable 8bit 4:4:4 encoding for HEVC and VP9Philip Langdale2022-08-09
| | | | | | | | | | Sufficiently recent Intel hardware is able to do encoding of 8bit 4:4:4 content in HEVC and VP9. The main requirement here is that the frames must be provided in the AYUV format. Enabling support is done by adding the appropriate encoding profiles and noting that AYUV is officially a four channel format with alpha so we must state that we expect all four channels.
* lavc/vaapi_decode: add missing flag when picking best pixel formatPhilip Langdale2022-08-09
| | | | | | | | | | | | | | | | | | | | | vaapi_decode_find_best_format currently does not set the VA_SURFACE_ATTRIB_SETTABLE flag on the pixel format attribute that it returns. Without this flag, the attribute will be ignored by vaCreateSurfaces, meaning that the driver's default logic for picking a pixel format will kick in. So far, this hasn't produced visible problems, but when trying to decode 4:4:4 content, at least on Intel, the driver will pick the 444P planar format, even though the decoder can only return the AYUV packed format. The hwcontext_vaapi code that sets surface attributes when picking formats does not have this bug. Applications may use their own logic for finding the best format, and so may not hit this bug. eg: mpv is unaffected.
* avcodec/nvdec: Use av_buffer_replace() where appropriateAndreas Rheinhardt2022-08-08
| | | | | Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/nvdec: Check av_buffer_ref()Andreas Rheinhardt2022-08-08
| | | | | | | It (unfortunately) involves an allocation and can therefore fail. Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libspeexdec: Fix use of uninitialized valueAndreas Rheinhardt2022-08-08
| | | | | | | Regression since 97d9a3293854eda84f05c22e2eaefae7406ac969. Fixes Coverity issue #1503072. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs_h2645: Remove always-false checkAndreas Rheinhardt2022-08-08
| | | | | | | | | | The functions to replace parameter sets are only called after the respective parameter set has just been read or has just been written; all of these functions check that the id field is within the appropriate range. So the checks in the replace-functions can be removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs: Remove ff_cbs_alloc_unit_contentAndreas Rheinhardt2022-08-08
| | | | | | | It is no longer used. Also rename ff_cbs_alloc_unit_content2 to ff_cbs_alloc_unit_content. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs_jpeg: Use table-based alloc/freeAndreas Rheinhardt2022-08-08
| | | | | | | cbs_jpeg was the last user of CBS that didn't use CodedBitstreamUnitTypeDescriptors. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs_internal: Use unions to shrink size of descriptorsAndreas Rheinhardt2022-08-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs_internal, cbs_h2645: Add and use new descriptor macrosAndreas Rheinhardt2022-08-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs: Use smaller scope for variables, add constAndreas Rheinhardt2022-08-08
| | | | | | And also avoid an unnecessary indirection for src_buf. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs: Remove redundant assignmentAndreas Rheinhardt2022-08-08
| | | | | | | | | | | The code just creates new references without allocating new buffers for the subobjects; therefore the actual data pointer stays valid and need not be updated. Also remove an assert that ensured that the calculation for updating the pointer makes sense. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/cbs: Avoid code duplication for making unit refcounted/writableAndreas Rheinhardt2022-08-08
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/error_resilience: Avoid overhead of AVBuffer APIAndreas Rheinhardt2022-08-08
| | | | | | These buffers are not shared in any way. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/jpeg2000: Fast fail if HTJ2K codeblocks are present.caleb2022-08-07
| | | | | Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/riff: map AYUV fourcc to RAWVIDEO decoderJames Almer2022-08-07
| | | | | | There's no need to keep using a custom decoder for this pixel format. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: WBMP (Wireless Application Protocol Bitmap) image formatPeter Ross2022-08-07
| | | | | Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Peter Ross <pross@xvid.org>
* avcodec/nvenc: hardcode color characteristics for internal RGB2YUV conversionTimo Rothenpieler2022-08-06
| | | | | | | | nvenc does not appear to use these values as inputs for its built in RGB to YUV conversion, but instead sets them on the output as-is. Testing indicates the input is expected to be sRGB, with the output ending up as limited range bt.470.
* avcodec/nvdec_hevc: Fix off-by-one errorAndreas Rheinhardt2022-08-06
| | | | | | | Fixes Coverity issues #1442912, #1442913, #1442916 and #1442917. Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/acelp_*: Remove unnecessary headersAndreas Rheinhardt2022-08-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Remove legacy cruftAndreas Rheinhardt2022-08-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacenc_quantization: Deduplicate quantization functionsAndreas Rheinhardt2022-08-05
| | | | | | | | | | | | | | | | | | Up until now, there were four copies of quantize_and_encode_band_cost_(ZERO|[SU]QUAD|[SU]PAIR|ESC|NONE|NOISE|STEREO) (namely in aaccoder.o, aacenc_is.o, aacenc_ltp.o, aacenc_pred.o). As 43b378a0d321e3d01f196cec95e13acfac80d464 says, this is meant to enable more optimizations. Yet neither GCC nor Clang performed such optimizations: The functions in the aforementioned files are not optimized according to the specifics of the calls in the respective file. Therefore duplicating them is a waste of space; this commit therefore stops doing so. The remaining copy is placed into aaccoder.c (which is the only place where the "round to zero" variant of quantize_and_encode_band() is used, so that this can be completely internal to aaccoder.c). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacenc_tns: Remove unused headerAndreas Rheinhardt2022-08-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacenc_quantization: Remove always-zero function parameterAndreas Rheinhardt2022-08-05
| | | | | | rtz is only ever nonzero for quantize_and_encode_band(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/sbrdsp: Remove unnecessary headersAndreas Rheinhardt2022-08-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/aacenc: Move aac_pce_configs to its only userAndreas Rheinhardt2022-08-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move ff_thread_can_start_frame() to threadframe.hAndreas Rheinhardt2022-08-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/flacdsp: Split encoder-only parts into a ctx of its ownAndreas Rheinhardt2022-08-05
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>