[FFmpeg-cvslog] avformat/mov: Add avif to list of supported extensions
ffmpeg | branch: master | Vignesh Venkatasubramanian | Sun Apr 24 11:39:51 2022 -0700| [f2724d2b6958a4e62afa10157f2b19566239e12d] | committer: Gyan Doshi avformat/mov: Add avif to list of supported extensions AVIF still and animations are now supported by the MOV parser. Add the "avif" extension to the list of supported extensions to AVInputFormat. Signed-off-by: Vignesh Venkatasubramanian > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f2724d2b6958a4e62afa10157f2b19566239e12d --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 3e83e54a77..26aeeaea0c 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -9036,7 +9036,7 @@ const AVInputFormat ff_mov_demuxer = { .long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"), .priv_class = &mov_class, .priv_data_size = sizeof(MOVContext), -.extensions = "mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v", +.extensions = "mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v,avif", .flags_internal = FF_FMT_INIT_CLEANUP, .read_probe = mov_probe, .read_header= mov_read_header, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] lafi/vf_edgedetect: Move some common functions into seperate file
ffmpeg | branch: master | Thilo Borgmann | Tue Nov 30 00:16:52 2021 +0100| [22df52c444252d1df29244ca99b51911a1e0eb58] | committer: Thilo Borgmann lafi/vf_edgedetect: Move some common functions into seperate file > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=22df52c444252d1df29244ca99b51911a1e0eb58 --- libavfilter/Makefile| 2 +- libavfilter/edge_common.c | 181 +++ libavfilter/edge_common.h | 107 ++ libavfilter/vf_edgedetect.c | 183 ++-- 4 files changed, 296 insertions(+), 177 deletions(-) diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 32521a4836..38ca379e5a 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -266,7 +266,7 @@ OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o OBJS-$(CONFIG_DRAWGRAPH_FILTER) += f_drawgraph.o OBJS-$(CONFIG_DRAWGRID_FILTER) += vf_drawbox.o OBJS-$(CONFIG_DRAWTEXT_FILTER) += vf_drawtext.o -OBJS-$(CONFIG_EDGEDETECT_FILTER) += vf_edgedetect.o +OBJS-$(CONFIG_EDGEDETECT_FILTER) += vf_edgedetect.o edge_common.o OBJS-$(CONFIG_ELBG_FILTER) += vf_elbg.o OBJS-$(CONFIG_ENTROPY_FILTER)+= vf_entropy.o OBJS-$(CONFIG_EPX_FILTER)+= vf_epx.o diff --git a/libavfilter/edge_common.c b/libavfilter/edge_common.c new file mode 100644 index 00..d72e8521cd --- /dev/null +++ b/libavfilter/edge_common.c @@ -0,0 +1,181 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "edge_common.h" + +// Internal helper for ff_sobel() +static int get_rounded_direction(int gx, int gy) +{ +/* reference angles: + * tan( pi/8) = sqrt(2)-1 + * tan(3pi/8) = sqrt(2)+1 + * Gy/Gx is the tangent of the angle (theta), so Gy/Gx is compared against + * , or more simply Gy against *Gx + * + * Gx and Gy bounds = [-1020;1020], using 16-bit arithmetic: + * round((sqrt(2)-1) * (1<<16)) = 27146 + * round((sqrt(2)+1) * (1<<16)) = 158218 + */ +if (gx) { +int tanpi8gx, tan3pi8gx; + +if (gx < 0) +gx = -gx, gy = -gy; +gy *= (1 << 16); +tanpi8gx = 27146 * gx; +tan3pi8gx = 158218 * gx; +if (gy > -tan3pi8gx && gy < -tanpi8gx) return DIRECTION_45UP; +if (gy > -tanpi8gx && gy < tanpi8gx) return DIRECTION_HORIZONTAL; +if (gy > tanpi8gx && gy < tan3pi8gx) return DIRECTION_45DOWN; +} +return DIRECTION_VERTICAL; +} + +// Simple sobel operator to get rounded gradients +void ff_sobel(int w, int h, +uint16_t *dst, int dst_linesize, +int8_t *dir, int dir_linesize, +const uint8_t *src, int src_linesize) +{ +int i, j; + +for (j = 1; j < h - 1; j++) { +dst += dst_linesize; +dir += dir_linesize; +src += src_linesize; +for (i = 1; i < w - 1; i++) { +const int gx = +-1*src[-src_linesize + i-1] + 1*src[-src_linesize + i+1] +-2*src[i-1] + 2*src[i+1] +-1*src[ src_linesize + i-1] + 1*src[ src_linesize + i+1]; +const int gy = +-1*src[-src_linesize + i-1] + 1*src[ src_linesize + i-1] +-2*src[-src_linesize + i ] + 2*src[ src_linesize + i ] +-1*src[-src_linesize + i+1] + 1*src[ src_linesize + i+1]; + +dst[i] = FFABS(gx) + FFABS(gy); +dir[i] = get_rounded_direction(gx, gy); +} +} +} + +// Filters rounded gradients to drop all non-maxima +// Expects gradients generated by ff_sobel() +// Expects zero's destination buffer +void ff_non_maximum_suppression(int w, int h, + uint8_t *dst, int dst_linesize, + const int8_t *dir, int dir_linesize, + const uint16_t *src, int src_linesize) +{ +int i, j; + +#define COPY_MAXIMA(ay, ax, by, bx) do {\ +if (src[i] > src[(ay)*src_linesize + i+(ax)] && \ +src[i] > src[(by)*src_linesize + i+(bx)]) \ +dst[i] = av_clip_
[FFmpeg-cvslog] lavfi: Add blurdetect filter
ffmpeg | branch: master | Thilo Borgmann | Mon Apr 25 00:07:04 2022 +0200| [b23208826bfb9ac2cba9736e066ea6b82f6207b9] | committer: Thilo Borgmann lavfi: Add blurdetect filter > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b23208826bfb9ac2cba9736e066ea6b82f6207b9 --- Changelog | 1 + doc/filters.texi| 52 libavfilter/Makefile| 1 + libavfilter/allfilters.c| 1 + libavfilter/version.h | 2 +- libavfilter/vf_blurdetect.c | 394 tests/fate/filter-video.mak | 3 + tests/ref/fate/filter-refcmp-blurdetect-yuv | 10 + 8 files changed, 463 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 7a63e3d1ee..4d467eb741 100644 --- a/Changelog +++ b/Changelog @@ -13,6 +13,7 @@ version 5.1: - pixelize video filter - colormap video filter - colorchart video source filter +- blurdetect filter version 5.0: diff --git a/doc/filters.texi b/doc/filters.texi index c8699b9099..499f3adcd9 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -7997,6 +7997,58 @@ tblend=all_mode=grainextract @subsection Commands This filter supports same @ref{commands} as options. +@anchor{blurdetect} +@section blurdetect + +Determines blurriness of frames without altering the input frames. + +Based on Marziliano, Pina, et al. "A no-reference perceptual blur metric." +Allows for a block-based abbreviation. + +The filter accepts the following options: + +@table @option +@item low +@item high +Set low and high threshold values used by the Canny thresholding +algorithm. + +The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. + +@var{low} and @var{high} threshold values must be chosen in the range +[0,1], and @var{low} should be lesser or equal to @var{high}. + +Default value for @var{low} is @code{20/255}, and default value for @var{high} +is @code{50/255}. + +@item radius +Define the radius to search around an edge pixel for local maxima. + +@item block_pct +Determine blurriness only for the most significant blocks, given in percentage. + +@item block_width +Determine blurriness for blocks of width @var{block_width}. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of @var{block_height}. + +@item block_height +Determine blurriness for blocks of height @var{block_height}. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of @var{block_width}. + +@item planes +Set planes to filter. Default is first only. +@end table + +@subsection Examples + +@itemize +@item +Determine blur for 80% of most significant 32x32 blocks: +@example +blurdetect=block_width=32:block_height=32:block_pct=80 +@end example +@end itemize + @section bm3d Denoise frames using Block-Matching 3D algorithm. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 38ca379e5a..1db097b464 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -195,6 +195,7 @@ OBJS-$(CONFIG_BLACKDETECT_FILTER)+= vf_blackdetect.o OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o OBJS-$(CONFIG_BLEND_FILTER) += vf_blend.o framesync.o OBJS-$(CONFIG_BLEND_VULKAN_FILTER) += vf_blend_vulkan.o framesync.o vulkan.o vulkan_filter.o +OBJS-$(CONFIG_BLURDETECT_FILTER) += vf_blurdetect.o edge_common.o OBJS-$(CONFIG_BM3D_FILTER) += vf_bm3d.o framesync.o OBJS-$(CONFIG_BOXBLUR_FILTER)+= vf_boxblur.o boxblur.o OBJS-$(CONFIG_BOXBLUR_OPENCL_FILTER) += vf_avgblur_opencl.o opencl.o \ diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 36fa3ae8d7..2ad523fd0f 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -183,6 +183,7 @@ extern const AVFilter ff_vf_blackdetect; extern const AVFilter ff_vf_blackframe; extern const AVFilter ff_vf_blend; extern const AVFilter ff_vf_blend_vulkan; +extern const AVFilter ff_vf_blurdetect; extern const AVFilter ff_vf_bm3d; extern const AVFilter ff_vf_boxblur; extern const AVFilter ff_vf_boxblur_opencl; diff --git a/libavfilter/version.h b/libavfilter/version.h index 9add1658e5..8f1b16969a 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -31,7 +31,7 @@ #include "version_major.h" -#define LIBAVFILTER_VERSION_MINOR 36 +#define LIBAVFILTER_VERSION_MINOR 37 #define LIBAVFILTER_VERSION_MICRO 100 diff --git a/libavfilter/vf_blurdetect.c b/libavfilter/vf_blurdetect.c new file mode 100644 index 00..0199bd13de --- /dev/null +++ b/libavfilter/vf_blurdetect.c @@ -0,0 +1,394 @@ +/* + * Copyright (c) 2021 Thilo Borgmann + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under
[FFmpeg-cvslog] avcodec/libsvtav1: pass pict_type to library
ffmpeg | branch: master | Christopher Degawa | Mon Apr 25 17:54:38 2022 -0500| [6fd1533057ff4f966efc169b71f8c3770843fc49] | committer: James Almer avcodec/libsvtav1: pass pict_type to library match the behavior of SvtAv1EncApp to ensure pic_type is always set before passing it to the library. The other options for pic_type aren't currently used inside the library, so they aren't introduced in this patch. Signed-off-by: Christopher Degawa Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6fd1533057ff4f966efc169b71f8c3770843fc49 --- libavcodec/libsvtav1.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 2e3d96ce37..088b9bab02 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -404,6 +404,16 @@ static int eb_send_frame(AVCodecContext *avctx, const AVFrame *frame) headerPtr->p_app_private = NULL; headerPtr->pts = frame->pts; +switch (frame->pict_type) { +case AV_PICTURE_TYPE_I: +headerPtr->pic_type = EB_AV1_KEY_PICTURE; +break; +default: +// Actually means auto, or default. +headerPtr->pic_type = EB_AV1_INVALID_PICTURE; +break; +} + svt_av1_enc_send_picture(svt_enc->svt_handle, headerPtr); return 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/libsvtav1: add support for setting chroma sample location
ffmpeg | branch: master | Jan Ekström | Mon Apr 25 23:35:17 2022 +0300| [ded0334d214f9617122ccf5466f99df5c908277b] | committer: Jan Ekström avcodec/libsvtav1: add support for setting chroma sample location Support for configuring this was added with version 1.0.0. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ded0334d214f9617122ccf5466f99df5c908277b --- libavcodec/libsvtav1.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 088b9bab02..b4112004ad 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -205,6 +205,33 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param, else param->color_range = !!(desc->flags & AV_PIX_FMT_FLAG_RGB); +#if SVT_AV1_CHECK_VERSION(1, 0, 0) +if (avctx->chroma_sample_location != AVCHROMA_LOC_UNSPECIFIED) { +const char *name = +av_chroma_location_name(avctx->chroma_sample_location); + +switch (avctx->chroma_sample_location) { +case AVCHROMA_LOC_LEFT: +param->chroma_sample_position = EB_CSP_VERTICAL; +break; +case AVCHROMA_LOC_TOPLEFT: +param->chroma_sample_position = EB_CSP_COLOCATED; +break; +default: +if (!name) +break; + +av_log(avctx, AV_LOG_WARNING, + "Specified chroma sample location %s is unsupported " + "on the AV1 bit stream level. Usage of a container that " + "allows passing this information - such as Matroska - " + "is recommended.\n", + name); +break; +} +} +#endif + if (avctx->profile != FF_PROFILE_UNKNOWN) param->profile = avctx->profile; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".