summaryrefslogtreecommitdiff
path: root/libavcodec/libdavs2.c
Commit message (Collapse)AuthorAge
* avcodec/decoders: Use const uint8_t* to access input packet dataAndreas Rheinhardt2022-07-04
| | | | | | | These packets need not be writable, so we must not modify them. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libdavs2: workaround memory leakZhao Zhili2022-07-04
| | | | | | | | | | | | | | | | | | davs2_decoder_close doesn't free those on the fly frames which don't get output yet. It's a design bug, but easy to workaround. Before the patch: Direct leak of 1198606 byte(s) in 2 object(s) allocated from: #0 0x563af5e1e5f0 in malloc (ffmpeg+0x6675f0) #1 0x563af9765ef3 in davs2_malloc davs2/source/common/common.h:1240 #2 0x563af9765ef3 in davs2_alloc_picture davs2/source/common/header.cc:815 Indirect leak of 3595818 byte(s) in 6 object(s) allocated from: #0 0x563af5e1e5f0 in malloc (ffmpeg+0x6675f0) #1 0x563af9765ef3 in davs2_malloc davs2/source/common/common.h:1240 #2 0x563af9765ef3 in davs2_alloc_picture davs2/source/common/header.cc:815 Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/libdavs2: use frame rate code tableZhao Zhili2022-06-24
| | | | | | It's more natural than the floating to fraction conversion. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avcodec/libdavs2: export has_b_frames infoZhao Zhili2022-05-24
| | | | | | | More precisely, we should use picture_reorder_delay, but it's unavailable yet. Signed-off-by: Zhao Zhili <zhilizhao@tencent.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: Make FFCodec.decode use AVFrame*Andreas Rheinhardt2022-04-05
| | | | | | | | This increases type-safety by avoiding conversions from/through void*. It also avoids the boilerplate "AVFrame *frame = data;" line for non-subtitle decoders. 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/avcodec: Don't include cpu.hAndreas Rheinhardt2021-07-22
| | | | | | | It is not used here at all; instead, add it where it is used without including it or any of the arch-specific CPU headers. 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/libdavs2: unbreak compilation failureGyan Doshi2021-03-17
| | | | | | FF_CODEC_CAP_AUTO_THREADS added in 8a129077cc requires internal.h Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* 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.
* lavc/libdavs2: fix frame dumping error descriptionhwrenx2019-03-23
| | | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: hwrenx <hwrenx@126.com>
* lavc/libdavs2: add davs2_flushhwrenx2019-03-23
| | | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: hwrenx <hwrenx@126.com>
* lavc/libdavs2: fix parameter setting errorhwren2019-02-19
| | | | Signed-off-by: hwrenx <hwrenx@126.com>
* lavc/libdavs2: Cosmetics: Fix indentation for switch statementJun Zhao2019-01-04
| | | | | | | Cosmetics: Fix indentation for switch statement like the Linux kerenl style. Signed-off-by: Jun Zhao <mypopydev@gmail.com>
* lavc/libdavs2: enable multithreadhwrenx2018-12-26
| | | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: hwrenx <hwrenx@126.com>
* lavc/libdavs2: fix function return value errorhwrenx2018-12-03
| | | | Signed-off-by: hwrenx <hwrenx@126.com>
* lavc/libdavs2: output delayed frameshwrenx2018-12-03
| | | | Signed-off-by: hwrenx <hwrenx@126.com>
* libdavs2: update api version and enable avx optionhwrenx2018-12-03
| | | | Signed-off-by: hwrenx <hwrenx@126.com>
* libavcodec/libdavs2.c: Fix for the wrong line size is usedLimin Wang2018-11-25
| | | | Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
* lavc/libdavs2: correct frame type settinghwren2018-11-18
| | | | Signed-off-by: hwren <hwrenx@126.com>
* lavc/libdavs2: remove unused frame counterhwren2018-11-18
| | | | Signed-off-by: hwren <hwrenx@126.com>
* lavc/libdavs2: Remove yuv420p10le from fromat list.Jun Zhao2018-10-28
| | | | | | | now libdavs2 can't support 10bits mode, so remove the yuv420p10le from fromat list. Signed-off-by: Jun Zhao <jun.zhao@intel.com>
* lavc/libdavs2: fix error return codeshwren2018-09-17
| | | | Signed-off-by: hwren <hwrenx@126.com>
* lavc/libdavs2: remove unused header fileshwren2018-09-17
| | | | Signed-off-by: hwren <hwrenx@126.com>
* avs2: correct avs2 descriptionhwren2018-08-08
| | | | | Signed-off-by: hwren <hwrenx@126.com> Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
* avcodec: add missing files missed in previous commitsJames Almer2018-07-27
Fixes compilation. Signed-off-by: James Almer <jamrial@gmail.com>