summaryrefslogtreecommitdiff
path: root/libavcodec/libkvazaar.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: Rename AVCodecDefault->FFCodecDefaultAndreas Rheinhardt2022-03-21
| | | | | | | This structure is no longer declared in a public header, so using an FF-prefix is more appropriate. 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>
* avcodec/libkvazaar: Increase array sizeAndreas Rheinhardt2021-12-08
| | | | | | | | | | | | av_image_copy() expects an array of four pointers according to its declaration; although it currently only touches pointers that are actually in use (depending upon the pixel format) this might change at any time (as has already happened for the linesizes in d7bc52bf456deba0f32d9fe5c288ec441f1ebef5). This fixes a -Wstringop-overflow= warning with GCC 11.2. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libkvazaar: Allow user-supplied buffersAndreas Rheinhardt2021-05-23
| | | | | | | | Here the packet size is known before allocating the packet, so that supporting user-supplied buffers is trivial. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Remove redundant freeing of extradata of encodersAndreas Rheinhardt2021-04-28
| | | | | | | | AVCodecContext.extradata is freed generically by libavcodec for encoders, so it is unnecessary for an encoder to do it on its own. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.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: Remove deprecated AVCodecContext.coded_frameAndreas Rheinhardt2021-04-27
| | | | | | | | | | Deprecated in 40cf1bbacc6220a0aa6bed5c331871d43f9ce370. (The currently disabled filter vf_mcdeint and vf_uspp were users of this field; they have not been changed, so that whoever wants to fix them can see the state of these filters when they were disabled.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: rename AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADSAnton Khirnov2021-03-16
| | | | | | | | | | This cap is currently used to mark multithreading-capable codecs that wrap external libraries with their own multithreading code. The name is highly confusing for our API users, since libavcodec ALWAYS handles thread_count=0 (see commit message in previous commit). Therefore rename the cap and update its documentation to make its meaning clear. The old name is kept deprecated until next+1 major bump.
* lavc: replace internal use of AV_CODEC_CAP_AUTO_THREADS with an internal capAnton Khirnov2021-03-16
| | | | | | | | | | | | | | | | AV_CODEC_CAP_AUTO_THREADS was originally added in b4d44a45f9a to mark codecs that spawn threads internally and are able to select an optimal threads count by themselves (all such codecs are wrappers around external libraries). It is used by lavc generic code to check whether it should handle thread_count=0 itself or pass the zero directly to the codec implementation. Within this meaning, it is clearly supposed to be an internal cap rather than a public one, since from the viewpoint of a libavcodec user, lavc ALWAYS handles thread_count=0. Whether it happens in the generic code or within the codec internals is not a meaningful difference for the caller. External aspects of this flag will be dealt with in the following commit.
* avcodec/libkvazaar: Set default ratecontrol algorithm for libkvazaarJoose Sainio2021-01-04
| | | | | | | | The standalone version of Kvazaar sets a default ratecontrol algorithm when bitrate is set. Mirror this behaviour. Signed-off-by: Joose Sainio <joose.sainio@tuni.fi> Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
* lavc/libkvazaar: export encoded frame statsJun Zhao2020-08-20
| | | | | | Export choosen pict_type and qp. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavc/libkvazaar: fix framerate settingJun Zhao2020-08-02
| | | | | | fix framerate setting. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavc/libkvazaar: fix memory leak after av_dict_parse_string failJun Zhao2020-01-04
| | | | | | | | In case of failure, all the successfully set entries are stored in *pm. We need to manually free the created dictionary to avoid memory leak. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavc/libkvazaar: indent the codeJun Zhao2018-12-20
| | | | | | indent the code to follow FFmpeg's coding style Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* lavc/libkvazaar: Use avctx->frame_rate first for framerate settingJun Zhao2018-12-20
| | | | | | | perfer avctx->frame_rate first than use avctx->time_base when setting the frame rate to encoder. Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* lavc/kvazaar: fix auto thread flag in kvazaar wrapper.Jun Zhao2018-12-02
| | | | | | | Now the kvazaar warpper didn't setting the threads for kvazaar API, and kavzaar will auto selecte the thread number. Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* lavc/libkvazaar: fix incompatible pointer type.Jun Zhao2018-08-22
| | | | | | | | | | | fix the waring: libavcodec/libkvazaar.c:210:27: warning: passing argument 3 of ‘av_image_copy’ from incompatible pointer type [-Wincompatible-pointer-types] frame->data, frame->linesize, ^~~~~ In file included from libavcodec/libkvazaar.c:31:0: ./libavutil/imgutils.h:119:6: note: expected ‘const uint8_t ** {aka const unsigned char **}’ but argument is of type ‘uint8_t * const* {aka unsigned char * const*}’ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* avcodec: add metadata to identify wrappers and hardware decoderswm42017-12-14
| | | | | | | | | | | | | | | | | | | | | Explicitly identify decoder/encoder wrappers with a common name. This saves API users from guessing by the name suffix. For example, they don't have to guess that "h264_qsv" is the h264 QSV implementation, and instead they can just check the AVCodec .codec and .wrapper_name fields. Explicitly mark AVCodec entries that are hardware decoders or most likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing API users listing hardware decoders in a more generic way. The proposed AVCodecHWConfig does not provide this information fully, because it's concerned with decoder configuration, not information about the fact whether the hardware is used or not. AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software implementations in case the hardware is not capable. Based on a patch by Philip Langdale <philipl@overt.org>. Merges Libav commit 47687a2f8aca3f65b6fdd117b1cb66a7409a7fd1.
* lavc/libkvazaar: switch to ff_alloc_packet2.Jun Zhao2017-11-10
| | | | | | | | | ff_alloc_packet have been deprecated, switch to use the ff_alloc_packet2. Signed-off-by: Jun Zhao <jun.zhao@intel.com> Reviewed-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'd5759701a82926059ae3e2530805e900041a5419'James Almer2017-04-13
|\ | | | | | | | | | | | | * commit 'd5759701a82926059ae3e2530805e900041a5419': libkvazaar: Add missing header #includes Merged-by: James Almer <jamrial@gmail.com>
| * libkvazaar: Add missing header #includesDiego Biurrun2016-12-08
| | | | | | | | This fixes compilation after the next version bump.
| * libkvazaar: Set frame rate as a rational numberArttu Ylä-Outinen2016-01-19
| | | | | | | | | | | | | | | | | | | | | | | | Updates libkvazaar to pass the exact frame rate to Kvazaar by setting the numerator and denominator separately instead of a single floating point number. The exact frame rate is needed for writing timing info to the bitstream. Requires Kvazaar version 0.8.1. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | libkvazaar: Set frame rate as a rational numberArttu Ylä-Outinen2016-01-20
| | | | | | | | | | | | | | | | | | | | | | Updates libkvazaar to pass the exact frame rate to Kvazaar by setting the numerator and denominator separately instead of a single floating point number. The exact frame rate is needed for writing timing info to the bitstream. Requires Kvazaar version 0.8.1. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* | Merge commit '233d2fa0443197df12b4f7823d591dad964149b3'Hendrik Leppkes2015-10-27
|\| | | | | | | | | | | | | * commit '233d2fa0443197df12b4f7823d591dad964149b3': kvazaar: Add libkvazaar HEVC encoder Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * kvazaar: Add libkvazaar HEVC encoderArttu Ylä-Outinen2015-10-23
| | | | | Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* doc/encoders: Fix libkvazaar documentationArttu Ylä-Outinen2015-10-07
| | | | | | | | | The -threads option is ignored with libkvazaar since it does not have any of the AV_CODEC_CAP_{FRAME,SLICE,AUTO}_THREADS capabilities. This commit removes the incorrect documentation as well as the no-op of setting the number of threads in libkvazaar encoder. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* libkvazaar: Fix setting framerateArttu Ylä-Outinen2015-10-07
| | | | | | | The divisor and dividend in the equation had been swapped, making the result the inverse of the actual framerate. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* libkvazaar: Use av_image_copy for copying pixelsArttu Ylä-Outinen2015-10-07
| | | | | | Replaces a for loop for copying pixels by a call to av_image_copy. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* libkvazaar: Set pts and dtsArttu Ylä-Outinen2015-10-07
| | | | Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* libkvazaar: Replace asserts with proper errorsArttu Ylä-Outinen2015-10-07
| | | | | | | | Changes function libkvazaar_encode to return proper error codes instead of crashing when the video dimensions or pixel format change in the middle of encoding. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* libkvazaar: Remove unnecessary NULL checksArttu Ylä-Outinen2015-10-07
| | | | Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* libkvazaar: Update to work with the latest versionArttu Ylä-Outinen2015-10-07
| | | | | | | | Function encoder_encode in Kvazaar API was changed to have new output parameters: source picture and frame info. Frame info is used to set the keyframe flag and source picture is ignored. Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
* 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>
* avcodec: add libkvazaar HECV encoderArttu Ylä-Outinen2015-07-14
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>