summaryrefslogtreecommitdiff
path: root/libavfilter/vf_uspp.c
Commit message (Collapse)AuthorAgeFilesLines
* avfilter/vf_uspp: add AV_CODEC_FLAG_RECON_FRAME supportMichael Niedermayer2023-03-261-19/+34
| | | | | | about 50% faster (based on command line fps) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_uspp: about 10x the speed with threadsMichael Niedermayer2023-03-181-82/+101
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_uspp: Support any codecMichael Niedermayer2023-03-181-5/+6
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_uspp: update to new APIsMichael Niedermayer2023-03-181-8/+41
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/qp_table: Stop using FF_QSCALE_TYPE_*Andreas Rheinhardt2022-03-231-1/+2
| | | | | | | | | | | | | | All FF_QSCALE_TYPE values used by libavfilter originate from libavfilter (namely from ff_qp_table_extract()); no value is exchanged between libavcodec and libavutil. The values that are exchanged (and used in libavfilter) are of type enum AVVideoEncParamsType. Therefore this patch stops using said FF_QSCALE_TYPE_* in libavfilter and uses enum AVVideoEncParamsType directly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Reindentation after query_formats changesAndreas Rheinhardt2021-10-051-9/+9
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_uspp: Use formats list instead of query functionAndreas Rheinhardt2021-10-051-6/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Replace query_formats callback with union of list and callbackAndreas Rheinhardt2021-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one looks at the many query_formats callbacks in existence, one will immediately recognize that there is one type of default callback for video and a slightly different default callback for audio: It is "return ff_set_common_formats_from_list(ctx, pix_fmts);" for video with a filter-specific pix_fmts list. For audio, it is the same with a filter-specific sample_fmts list together with ff_set_common_all_samplerates() and ff_set_common_all_channel_counts(). This commit allows to remove the boilerplate query_formats callbacks by replacing said callback with a union consisting the old callback and pointers for pixel and sample format arrays. For the not uncommon case in which these lists only contain a single entry (besides the sentinel) enum AVPixelFormat and enum AVSampleFormat fields are also added to the union to store them directly in the AVFilter, thereby avoiding a relocation. The state of said union will be contained in a new, dedicated AVFilter field (the nb_inputs and nb_outputs fields have been shrunk to uint8_t in order to create a hole for this new field; this is no problem, as the maximum of all the nb_inputs is four; for nb_outputs it is only two). The state's default value coincides with the earlier default of query_formats being unset, namely that the filter accepts all formats (and also sample rates and channel counts/layouts for audio) provided that these properties agree coincide for all inputs and outputs. By using different union members for audio and video filters the type-unsafety of using the same functions for audio and video lists will furthermore be more confined to formats.c than before. When the new fields are used, they will also avoid allocations: Currently something nearly equivalent to ff_default_query_formats() is called after every successful call to a query_formats callback; yet in the common case that the newly allocated AVFilterFormats are not used at all (namely if there are no free links) these newly allocated AVFilterFormats are freed again without ever being used. Filters no longer using the callback will not exhibit this any more. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfilter: Add numbers of (in|out)pads directly to AVFilterAndreas Rheinhardt2021-08-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, an AVFilter's lists of input and output AVFilterPads were terminated by a sentinel and the only way to get the length of these lists was by using avfilter_pad_count(). This has two drawbacks: first, sizeof(AVFilterPad) is not negligible (i.e. 64B on 64bit systems); second, getting the size involves a function call instead of just reading the data. This commit therefore changes this. The sentinels are removed and new private fields nb_inputs and nb_outputs are added to AVFilter that contain the number of elements of the respective AVFilterPad array. Given that AVFilter.(in|out)puts are the only arrays of zero-terminated AVFilterPads an API user has access to (AVFilterContext.(in|out)put_pads are not zero-terminated and they already have a size field) the argument to avfilter_pad_count() is always one of these lists, so it just has to find the filter the list belongs to and read said number. This is slower than before, but a replacement function that just reads the internal numbers that users are expected to switch to will be added soon; and furthermore, avfilter_pad_count() is probably never called in hot loops anyway. This saves about 49KiB from the binary; notice that these sentinels are not in .bss despite being zeroed: they are in .data.rel.ro due to the non-sentinels. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Factor common function combinations outAndreas Rheinhardt2021-08-131-4/+1
| | | | | | | | | | | Several combinations of functions happen quite often in query_format functions; e.g. ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)) is very common. This commit therefore adds functions that are equivalent to commonly used function combinations in order to reduce code duplication. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/internal: Don't include libavcodec/(avcodec|internal).hAndreas Rheinhardt2021-08-051-0/+1
| | | | | | | | | The reasons for including them don't exist any longer: ff_tlog() has been moved to libavutil/internal.h and FF_QSCALE_TYPE_* has been moved to qp_table.h. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: Constify all AVFiltersAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_uspp: use av_packet_alloc() to allocate packetsJames Almer2021-03-171-6/+10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_uspp: Fix leak of packet side dataAndreas Rheinhardt2021-03-121-0/+1
| | | | | | | | | | | The uspp filter uses a special option ("no_bitstream") of the Snow encoder to suppress it from generating output. The filter therefore did not unref the packet after usage, believing it to be blank. But this is wrong, as the Snow encoder attaches quality stats side data to the packet. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_uspp: Fix leak of qp-table on errorAndreas Rheinhardt2021-03-121-0/+2
| | | | | | | Fixes Coverity issue #1473500. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavfi/vf_uspp: convert to the video_enc_params APIAnton Khirnov2021-01-011-31/+22
|
* lavu/mem: move the DECLARE_ALIGNED macro family to mem_internal on next+1 bumpAnton Khirnov2021-01-011-0/+1
| | | | They are not properly namespaced and not intended for public use.
* fftools, libavcodec, libavfilter: Add const to some AVCodec *Andreas Rheinhardt2020-09-111-1/+1
| | | | | | | | The user has no business modifying the underlying AVCodec. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avfilter/vf_uspp: Fix potential leak of dict on errorAndreas Rheinhardt2020-09-111-1/+1
| | | | | Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Remove unnecessary use of avcodec_close().Anton Khirnov2020-06-101-4/+2
| | | | | Replace it with avcodec_free_context() or drop it completely as appropriate.
* avfilter: don't anonymously typedef structsPaul B Mahol2017-05-131-1/+1
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avfilter/vf_uspp: Fix currently unused input frame dimensionsMichael Niedermayer2017-05-101-2/+2
| | | | | Found-by: Nicolas Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter: stop using deprecated codec flagsJames Almer2017-03-251-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_uspp: Check for encoding failureMichael Niedermayer2016-07-131-1/+7
| | | | | | Fixes CID1363015 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPATDerek Buitenhuis2016-01-271-10/+10
| | | | | | | | | | Libav, for some reason, merged this as a public API function. This will aid in future merges. A define is left for backwards compat, just in case some person used it, since it is in a public header. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avfilter/uspp: use AV_OPT_TYPE_BOOL for use_bframe_qp optionClément Bœsch2015-09-091-1/+1
|
* Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter: handle error in query_formats() in bunch of filtersPaul B Mahol2015-04-081-2/+5
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* Replace PixelFormats which sneaked in over time or where forgotten by ↵Michael Niedermayer2015-03-181-1/+1
| | | | | | AVPixelFormats Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: fix gop_sizeMichael Niedermayer2015-01-251-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: Use FF_CEIL_RSHIFT() correct rounding of odd w/hMichael Niedermayer2015-01-251-8/+13
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* lavfi: use ff_norm_qscale(), factorizeStefano Sabatini2015-01-131-14/+1
|
* avfilter/vf_uspp: clear AVPacket to not leave uninitialized memoryMichael Niedermayer2014-12-301-1/+1
| | | | | | Fixes CID1260707 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: use av_malloc_array()Michael Niedermayer2014-12-231-2/+2
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: fix gray pixfmt handlingMichael Niedermayer2014-12-131-0/+3
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: fix used chroma subsampling factorsMichael Niedermayer2014-12-131-11/+21
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: fix used pix_fmtMichael Niedermayer2014-12-131-1/+1
| | | | | Found-by: carl Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: Add grayscale supportMichael Niedermayer2014-12-131-0/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: assert that the qp_type is validMichael Niedermayer2014-12-131-0/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: fix integer overflow in intermediateMichael Niedermayer2014-12-121-2/+2
| | | | | | Fixes Ticket3596 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: remove YUV 411/422/440Michael Niedermayer2014-12-121-5/+5
| | | | | | snow doesnt support 422/411/440 currently, so these do not work yet Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: use the average QP instead of QP[0]Michael Niedermayer2014-12-121-2/+10
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: The qp array width is qp_stride not stride/16Michael Niedermayer2014-12-121-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/vf_uspp: Allocate qp storage after qp_stride is knownMichael Niedermayer2014-12-121-9/+10
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avfilter/uspp: use AVFILTER_DEFINE_CLASS()Clément Bœsch2014-12-121-7/+1
|
* avfilter/uspp: make src const in store_slice_c()Clément Bœsch2014-12-121-1/+1
|
* avfilter/uspp: misc style fixesClément Bœsch2014-12-121-51/+51
|
* lavfi: USPP FilterArwa Arif2014-12-121-0/+490
Previous version reviewed by: Stefano Sabatini <stefasab@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>