summaryrefslogtreecommitdiff
path: root/libavcodec/libx265.c
Commit message (Collapse)AuthorAge
* avcodec: Add FF_CODEC_CAP_NOT_INIT_THREADSAFEAndreas Rheinhardt2022-07-18
| | | | | | | This is in preparation of switching the default init-thread-safety to a codec being init-thread-safe. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libx265: make X265 CSP selection pixel format independentJan Ekström2022-06-27
| | | | | | | | Currently the format listing misses the J formats completely, yet they are marked as supported in the encoder. Thus to make the logic support them while not explicitly listing them, make the logic utilize chroma subsampling information in both width and height available through the pixel format descriptor.
* 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/libx26[45]: reindent after last commitLimin Wang2021-12-28
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/libx26[45]: add udu_sei option to import user data unregistered SEIsLimin Wang2021-12-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Most of user data unregistered SEIs are privated data which defined by user/ encoder. currently, the user data unregistered SEIs found in input are forwarded as side-data to encoders directly, it'll cause the reencoded output including some useless UDU SEIs. I prefer to add one option to enable/disable it and default is off after I saw the patch by Andreas Rheinhardt: https://patchwork.ffmpeg.org/project/ffmpeg/patch/AM7PR03MB66607C2DB65E1AD49D975CF18F7B9@AM7PR03MB6660.eurprd03.prod.outlook.com/ How to test by cli: ffmpeg -y -f lavfi -i testsrc -c:v libx264 -frames:v 1 a.ts ffmpeg -y -i a.ts -c:v libx264 -udu_sei 1 b.ts ffmpeg -y -i a.ts -c:v libx264 -udu_sei 0 c.ts # check the user data unregistered SEIs, you'll see two UDU SEIs for b.ts. # and mediainfo will show with wrong encoding setting info ffmpeg -i b.ts -vf showinfo -f null - ffmpeg -i c.ts -vf showinfo -f null - This fixes tickets #9500 and #9557. Reviewed-by: "zhilizhao(赵志立)" <quinkblack@foxmail.com> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/libx265: add support for setting chroma sample locationJan Ekström2021-09-01
| | | | | | | Unlike libx264, libx265 does not handle the chroma format check on its own side, so in order to not write out values which are supposed to be ignored according to the specification, we limit the writing out of chroma sample location to 4:2:0 only.
* avcodec/libx265: only call av_pix_fmt_desc_get once in initJan Ekström2021-08-29
| | | | Now both current usages utilize an already found descriptor.
* avcodec/libx265: improve full range flag setting logicJan Ekström2021-08-18
| | | | | | | | | | | | | Unlike libx264, libx265 does not have a separate "unspecified"/"auto" default for color range, so we do always have to specify it. Thus, we are required to handle the RGB case on the libavcodec side to enable the correct value to be written out in in case of RGB content with unspecified color range being received. In other words: 1. If the user has set color range specifically, follow that. 2. If the user has not set color range specifically, set full range by default in case of RGB and YUVJ pixel formats.
* libavcodec/libx265: add user data unregistered SEI encodingBrad Hards2021-08-01
| | | | | | | | | | | | | MISB ST 0604 and ST 2101 require user data unregistered SEI messages (precision timestamps and sensor identifiers) to be included. That currently isn't supported for libx265. This patch adds support for user data unregistered SEI messages in accordance with ISO/IEC 23008-2:2020 Section D.2.7 The design is based on nvenc, with support finished up at 57de80673cb Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avcodec/libx265: 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 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/libx265: Fix integer overflow in computation of max and avg bitrateLimin Wang2020-06-19
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/internal: move packet related functions to their own headerJames Almer2020-06-02
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libx265: add support for reordered_opaqueJames Almer2020-05-19
| | | | | Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libx265: Fix Uninitialized scalar variableLimin Wang2020-05-08
| | | | | | | return error if unknown picture type encountered Fixes CID 1457234 Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec/libx265: zero the padding bytes in extradataJames Almer2020-01-18
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libx265: use AV_OPT_TYPE_DICT for x265-paramsMarton Balint2020-01-01
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/libx265: export encoded frame statsJames Almer2020-01-01
| | | | | Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 66b6005301894823052b437a950003ffbe3ba6de)
* avcodec/libx265: add a qp option and apply the relevant global ↵James Almer2020-01-01
| | | | | | AVCodecContext settings to the encoder context Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libx265: apply some global AVCodecContext settings to the encoder ↵James Almer2020-01-01
| | | | | | | | context There's no reason to ignore them if set. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/x265: set preferred_transfer_characteristics for HLGZhong Li2019-12-12
| | | | | | | | | | | "HEVC HDR UHDTV Bitstreams using HLG10 shall also contain the alternative_transfer_characteristics SEI message. The alternative_transfer_characteristics SEI message shall be inserted on the HEVC DVB_RAP, and preferred_transfer_characteristics shall be set equal to "18", indicating Recommendation ITU-R BT. 2100 [45] HLG system." Signed-off-by: Zhong Li <zhongli_dev@126.com>
* libavcodec/libx265: add a flag to output ROI warnings only once.Guo, Yejun2019-09-24
| | | | Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
* libx265: Update ROI behaviour to match documentationMark Thompson2019-07-07
| | | | Equivalent to the previous patch for libx264.
* avcodec/libx265: Support full range videosDerek Buitenhuis2019-05-26
| | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* lavc/libx265: Use avctx->framerate first for frame rate settingJun Zhao2019-05-11
| | | | | | | | | perfer avctx->framerate first than use avctx->time_base when setting the frame rate to encoder. 1/time_base is not the average frame rate if the frame rate is not constant, so use avctx->framerate if the value is not zero. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavc/libx265: signal CPB properties through side dataJan Ekström2019-03-03
| | | | | This way values such as maxrate/bufsize can be utilized further down the chain.
* avcodec/libx265: add support for ROI-based encodingGuo, Yejun2019-01-24
| | | | | Signed-off-by: Guo, Yejun <yejun.guo@intel.com> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avcodec/libx265: apply lavc maxrate, bufsize & rc_init_occupancyGyan Doshi2018-06-19
| | | | | | CLI options -maxrate, -bufsize and -rc_init_occupancy can now be picked up by the x265 wrapper. Min. rc init has to be 1001 to avoid x265 setting it to vbv-bufsize.
* lavc/libx265: allow users to set closed GOP via generic lavc flagGyan Doshi2018-06-02
| | | | | | lavc flag 'cgop' can be used to set closed GOP. Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Merge commit 'cc06f7bd10c236539b4f6f87b795c459dd873770'James Almer2018-04-13
|\ | | | | | | | | | | | | * commit 'cc06f7bd10c236539b4f6f87b795c459dd873770': libx265: Support tiny video sizes Merged-by: James Almer <jamrial@gmail.com>
| * libx265: Support tiny video sizesVittorio Giovara2018-04-09
| | | | | | | | | | | | Where tiny is less than the default CTU size. Signed-off-by: Vittorio Giovara <vittorio.giovara@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>. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * libx265: Add option to force IDR framesDerek Buitenhuis2016-11-07
| | | | | | | | | | | | | | This is in the same the same vein as 380146924ecad2e05e9dcc5c3c2e1b5ba47c51e8. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* | lavc/libx265: support all color parameters that x265 doesRodger Combs2018-01-12
| |
* | 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/libx265: mark disposable framesJohn Stebbins2017-12-07
| | | | | | | | | | | | Used by movenc to fill sdtp box Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/libx265 - Add named option to set profileGyan Doshi2017-12-06
| | | | | | | | | | | | | | | | | | | | | | Adds call to x265_param_apply_profile after x265_param_parse. Added as private option since HEVC profiles other than Main, Main 10 and MSP in AVCodecContext are consolidated in a single constant. Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Reviewed-by: Lou Logan <lou@lrcd.com>
* | lavc/libx265: switch to ff_alloc_packet2Jun Zhao2017-11-10
| | | | | | | | | | | | | | | | | | ff_alloc_packet have been deprecated, switch to use ff_alloc_packet2. Signed-off-by: Jun Zhao <jun.zhao@intel.com> Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/libx265: Add gray10 and gray12 encoding support.Carl Eugen Hoyos2017-03-08
| |
* | libx265: Add option to force IDR framesDerek Buitenhuis2016-11-04
| | | | | | | | | | | | | | This is in the same the same vein as c981b1145a857c8f962c93b8eecb1c613b20ffe9. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc/libx265: Support gray encoding.Carl Eugen Hoyos2016-07-06
| | | | | | | | Gray encoding crashes with libx265 <= 84, so check the library version.
* | lavc/libx265: Support GBR encoding.Carl Eugen Hoyos2016-03-13
| |
* | libx265: Enable 12-bit encodingStephen Hutchinson2016-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The configure detection is bumped to X265_BUILD >= 68, since API version 68 corresponds with the x265 1.8 release tarball. The warnings inside x265 about 12-bit being experimental were removed prior to API version 72 a short time later. At this time of writing, X265_BUILD is at version 80. 12-bit support in the HEVC standard was approved in October 2014 as part of HEVC Version 2 and published in January 2015: http://www.itu.int/ITU-T/recommendations/rec.aspx?rec=12296 http://www.itu.int/rec/T-REC-H.265-201410-S https://hevc.hhi.fraunhofer.de/rext Reveiwed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libx265: Remove experimental flag when encoding 4:2:2 and 4:4:4Stephen Hutchinson2016-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | 4:2:2 and 4:4:4 support in the HEVC standard was approved in October 2014 as part of HEVC Version 2 and published in January 2015: http://www.itu.int/ITU-T/recommendations/rec.aspx?rec=12296 http://www.itu.int/rec/T-REC-H.265-201410-S https://hevc.hhi.fraunhofer.de/rext Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>