[FFmpeg-cvslog] avformat/tty: add seeking support
ffmpeg | branch: master | Paul B Mahol | Sun Feb 2 14:03:45 2020 +0100| [767e95d560f9a7ea9d53cbd7f3a9cde9fa35054f] | committer: Paul B Mahol avformat/tty: add seeking support > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=767e95d560f9a7ea9d53cbd7f3a9cde9fa35054f --- libavformat/tty.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/tty.c b/libavformat/tty.c index f889121e26..efa399c108 100644 --- a/libavformat/tty.c +++ b/libavformat/tty.c @@ -156,6 +156,8 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt) pkt->size = av_get_packet(avctx->pb, pkt, n); if (pkt->size < 0) return pkt->size; +pkt->stream_index = 0; +pkt->pts = pkt->pos / n; pkt->flags |= AV_PKT_FLAG_KEY; return 0; } @@ -185,4 +187,5 @@ AVInputFormat ff_tty_demuxer = { .read_packet= read_packet, .extensions = tty_extensions, .priv_class = &tty_demuxer_class, +.flags = AVFMT_GENERIC_INDEX, }; ___ 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] avformat/tty: make probing strict for first 8 bytes
ffmpeg | branch: master | Paul B Mahol | Sun Feb 2 13:51:49 2020 +0100| [9216ad2e46ad09a8d6810d52fcd8714ba3e39e44] | committer: Paul B Mahol avformat/tty: make probing strict for first 8 bytes > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9216ad2e46ad09a8d6810d52fcd8714ba3e39e44 --- libavformat/tty.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavformat/tty.c b/libavformat/tty.c index 854a23c500..f889121e26 100644 --- a/libavformat/tty.c +++ b/libavformat/tty.c @@ -56,7 +56,13 @@ static int read_probe(const AVProbeData *p) if (!p->buf_size) return 0; -for (int i = 0; i < p->buf_size; i++) +for (int i = 0; i < 8 && i < p->buf_size; i++) +cnt += !!isansicode(p->buf[i]); + +if (cnt != 8) +return 0; + +for (int i = 8; i < p->buf_size; i++) cnt += !!isansicode(p->buf[i]); return (cnt * 100LL / p->buf_size) * (cnt > 400) * ___ 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] libswscale/x86/yuv2rgb: add ssse3 version
ffmpeg | branch: master | Ting Fu | Sun Jan 19 11:51:04 2020 +0800| [fc6a5883d6af8cae0e96af84dda0ad74b360a084] | committer: Paul B Mahol libswscale/x86/yuv2rgb: add ssse3 version Tested using this command: /ffmpeg -pix_fmt yuv420p -s 1920*1080 -i ArashRawYuv420.yuv \ -vcodec rawvideo -s 1920*1080 -pix_fmt rgb24 -f null /dev/null The fps increase from 389 to 640 on Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz Signed-off-by: Ting Fu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fc6a5883d6af8cae0e96af84dda0ad74b360a084 --- libswscale/x86/yuv2rgb.c | 38 libswscale/x86/yuv_2_rgb.asm | 145 ++- 2 files changed, 167 insertions(+), 16 deletions(-) diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c index c7668f487c..c12e88cbb5 100644 --- a/libswscale/x86/yuv2rgb.c +++ b/libswscale/x86/yuv2rgb.c @@ -67,6 +67,15 @@ DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL; #include "yuv2rgb_template.c" #endif /* HAVE_MMXEXT */ +//SSSE3 versions +#if HAVE_SSSE3 +#undef RENAME +#undef COMPILE_TEMPLATE_MMXEXT +#define COMPILE_TEMPLATE_MMXEXT 0 +#define RENAME(a) a ## _ssse3 +#include "yuv2rgb_template.c" +#endif + #endif /* HAVE_X86ASM */ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c) @@ -74,6 +83,35 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c) #if HAVE_X86ASM int cpu_flags = av_get_cpu_flags(); +if (EXTERNAL_SSSE3(cpu_flags)) { +switch (c->dstFormat) { +case AV_PIX_FMT_RGB32: +if (c->srcFormat == AV_PIX_FMT_YUVA420P) { +#if CONFIG_SWSCALE_ALPHA +return yuva420_rgb32_ssse3; +#endif +break; +} else +return yuv420_rgb32_ssse3; +case AV_PIX_FMT_BGR32: +if (c->srcFormat == AV_PIX_FMT_YUVA420P) { +#if CONFIG_SWSCALE_ALPHA +return yuva420_bgr32_ssse3; +#endif +break; +} else +return yuv420_bgr32_ssse3; +case AV_PIX_FMT_RGB24: +return yuv420_rgb24_ssse3; +case AV_PIX_FMT_BGR24: +return yuv420_bgr24_ssse3; +case AV_PIX_FMT_RGB565: +return yuv420_rgb16_ssse3; +case AV_PIX_FMT_RGB555: +return yuv420_rgb15_ssse3; +} +} + if (EXTERNAL_MMXEXT(cpu_flags)) { switch (c->dstFormat) { case AV_PIX_FMT_RGB24: diff --git a/libswscale/x86/yuv_2_rgb.asm b/libswscale/x86/yuv_2_rgb.asm index a44ab1607b..e05bbb89f5 100644 --- a/libswscale/x86/yuv_2_rgb.asm +++ b/libswscale/x86/yuv_2_rgb.asm @@ -25,11 +25,18 @@ SECTION_RODATA -pw_00ff: times 4 dw 255 -pb_f8: times 8 db 248 -pb_e0: times 8 db 224 -pb_03: times 8 db 3 -pb_07: times 8 db 7 +; below variables are named like mask_dwXY, which means to preserve dword No.X & No.Y +mask_dw036 : db -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0 +mask_dw147 : db 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1 +mask_dw25 : db 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0 +rgb24_shuf1: db 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5, 10, 11 +rgb24_shuf2: db 10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5 +rgb24_shuf3: db 4, 5, 10, 11, 0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15 +pw_00ff: times 8 dw 255 +pb_f8: times 16 db 248 +pb_e0: times 16 db 224 +pb_03: times 16 db 3 +pb_07: times 16 db 7 mask_1101: dw -1, -1, 0, -1 mask_0010: dw 0, 0, -1, 0 @@ -49,7 +56,11 @@ SECTION .text ;- %macro MOV_H2L 1 -psrlq %1, 32 +%if mmsize == 8 +psrlq %1, 32 +%else ; mmsize == 16 +psrldq %1, 8 +%endif %endmacro %macro yuv2rgb_fn 3 @@ -77,6 +88,7 @@ psrlq %1, 32 %define m_blue m1 %endif +%if mmsize == 8 %define time_num 1 %define reg_num 8 %define y_offset [pointer_c_ditherq + 8 * 8] @@ -87,11 +99,45 @@ psrlq %1, 32 %define y_coff [pointer_c_ditherq + 3 * 8] %define ub_coff [pointer_c_ditherq + 5 * 8] %define vr_coff [pointer_c_ditherq + 4 * 8] +%elif mmsize == 16 +%define time_num 2 +%if ARCH_X86_32 +%define reg_num 8 +%define my_offset [pointer_c_ditherq + 8 * 8] +%define mu_offset [pointer_c_ditherq + 9 * 8] +%define mv_offset [pointer_c_ditherq + 10 * 8] +%define mug_coff [pointer_c_ditherq + 7 * 8] +%define mvg_coff [pointer_c_ditherq + 6 * 8] +%define my_coff [pointer_c_ditherq + 3 * 8] +%define mub_coff [pointer_c_ditherq + 5 * 8] +%define mvr_coff [pointer_c_ditherq + 4 * 8] +%else ; ARCH_X86_64 +%define reg_num 16 +%define y_offset m8 +%define u_offset m9 +%define v_offset m10 +%define ug_coff m11 +%define vg_coff m12 +%define y_coff m13 +%define ub_coff m14 +%define vr_coff m15 +%endif ; ARCH_X86_32/64 +%endif ; coeff define mmsize == 8/16 cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters %if ARCH_X86_64 movsxd indexq, indexd +%if mmsize == 16 +VBROADCA
[FFmpeg-cvslog] avfilter/vf_thumbnail: fix possible crash on error
ffmpeg | branch: master | Paul B Mahol | Mon Feb 10 15:42:52 2020 +0100| [e63a66416fe911e039c6959ace6badbe5f097e3b] | committer: Paul B Mahol avfilter/vf_thumbnail: fix possible crash on error > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e63a66416fe911e039c6959ace6badbe5f097e3b --- libavfilter/vf_thumbnail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_thumbnail.c b/libavfilter/vf_thumbnail.c index a2e15d931e..ac04615bdc 100644 --- a/libavfilter/vf_thumbnail.c +++ b/libavfilter/vf_thumbnail.c @@ -162,7 +162,7 @@ static av_cold void uninit(AVFilterContext *ctx) { int i; ThumbContext *s = ctx->priv; -for (i = 0; i < s->n_frames && s->frames[i].buf; i++) +for (i = 0; i < s->n_frames && s->frames && s->frames[i].buf; i++) av_frame_free(&s->frames[i].buf); av_freep(&s->frames); } ___ 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] avfilter/vf_thumbnail: add timeline support
ffmpeg | branch: master | Paul B Mahol | Mon Feb 10 15:42:27 2020 +0100| [32bc0e04449e3e1e8e283f8edac4a796ee29e6b6] | committer: Paul B Mahol avfilter/vf_thumbnail: add timeline support > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=32bc0e04449e3e1e8e283f8edac4a796ee29e6b6 --- libavfilter/vf_thumbnail.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavfilter/vf_thumbnail.c b/libavfilter/vf_thumbnail.c index 0effdc91e9..a2e15d931e 100644 --- a/libavfilter/vf_thumbnail.c +++ b/libavfilter/vf_thumbnail.c @@ -234,4 +234,5 @@ AVFilter ff_vf_thumbnail = { .inputs= thumbnail_inputs, .outputs = thumbnail_outputs, .priv_class= &thumbnail_class, +.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, }; ___ 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] avformat/tty: fix last timestamp for fate
ffmpeg | branch: master | Paul B Mahol | Mon Feb 10 16:47:03 2020 +0100| [bbea268aa806a740e25c7dededf8dbe946e78bc5] | committer: Paul B Mahol avformat/tty: fix last timestamp for fate > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bbea268aa806a740e25c7dededf8dbe946e78bc5 --- libavformat/tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/tty.c b/libavformat/tty.c index efa399c108..56438d5f1c 100644 --- a/libavformat/tty.c +++ b/libavformat/tty.c @@ -157,7 +157,7 @@ static int read_packet(AVFormatContext *avctx, AVPacket *pkt) if (pkt->size < 0) return pkt->size; pkt->stream_index = 0; -pkt->pts = pkt->pos / n; +pkt->pts = pkt->pos / s->chars_per_frame; pkt->flags |= AV_PKT_FLAG_KEY; 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] avformat: Remove unnecessary av_packet_unref()
ffmpeg | branch: master | Andreas Rheinhardt | Tue Jan 7 14:55:40 2020 +0100| [6a67d518d60b61ae2bd98c3948894a7be9955e8c] | committer: Marton Balint avformat: Remove unnecessary av_packet_unref() Since bae8844e the packet will always be unreferenced when a demuxer returns an error, so that a lot of calls to av_packet_unref() in lots of demuxers are now redundant and can be removed. Signed-off-by: Andreas Rheinhardt Signed-off-by: Marton Balint > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6a67d518d60b61ae2bd98c3948894a7be9955e8c --- libavformat/aacdec.c | 6 -- libavformat/adp.c| 1 - libavformat/adxdec.c | 2 -- libavformat/amr.c| 1 - libavformat/ape.c| 1 - libavformat/avs.c| 1 - libavformat/brstm.c | 3 +-- libavformat/c93.c| 13 +++-- libavformat/cdxl.c | 1 - libavformat/concatdec.c | 4 +--- libavformat/dfa.c| 3 --- libavformat/dsicin.c | 1 - libavformat/dss.c| 6 +- libavformat/dxa.c| 1 - libavformat/electronicarts.c | 3 --- libavformat/fitsdec.c| 2 -- libavformat/flic.c | 3 +-- libavformat/g723_1.c | 1 - libavformat/gdv.c| 1 - libavformat/gsmdec.c | 1 - libavformat/hls.c| 1 - libavformat/icodec.c | 1 - libavformat/idcin.c | 2 -- libavformat/idroqdec.c | 3 +-- libavformat/ilbc.c | 1 - libavformat/img2dec.c| 1 - libavformat/iv8.c| 1 - libavformat/libmodplug.c | 1 - libavformat/lxfdec.c | 1 - libavformat/mov.c| 1 - libavformat/mpc.c| 1 - libavformat/mpegts.c | 1 - libavformat/mpjpegdec.c | 2 -- libavformat/ncdec.c | 1 - libavformat/nuv.c| 1 - libavformat/oggdec.c | 7 ++- libavformat/redspark.c | 1 - libavformat/rl2.c| 1 - libavformat/rpl.c| 2 -- libavformat/s337m.c | 2 -- libavformat/sapdec.c | 1 - libavformat/sdr2.c | 1 - libavformat/sierravmd.c | 1 - libavformat/siff.c | 1 - libavformat/spdifdec.c | 5 + libavformat/swfdec.c | 3 --- libavformat/thp.c| 2 -- libavformat/vivo.c | 14 +- libavformat/vpk.c| 4 +--- libavformat/vqf.c| 1 - libavformat/wvdec.c | 4 libavformat/yuv4mpegdec.c| 1 - 52 files changed, 17 insertions(+), 108 deletions(-) diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c index 00ca2319ca..ba3f5ccc6d 100644 --- a/libavformat/aacdec.c +++ b/libavformat/aacdec.c @@ -141,7 +141,6 @@ static int handle_id3(AVFormatContext *s, AVPacket *pkt) ret = av_append_packet(s->pb, pkt, ff_id3v2_tag_len(pkt->data) - pkt->size); if (ret < 0) { -av_packet_unref(pkt); return ret; } @@ -174,7 +173,6 @@ retry: return ret; if (ret < ADTS_HEADER_SIZE) { -av_packet_unref(pkt); return AVERROR(EIO); } @@ -185,7 +183,6 @@ retry: av_assert2(append > 0); ret = av_append_packet(s->pb, pkt, append); if (ret != append) { -av_packet_unref(pkt); return AVERROR(EIO); } if (!ff_id3v2_match(pkt->data, ID3v2_DEFAULT_MAGIC)) { @@ -201,13 +198,10 @@ retry: fsize = (AV_RB32(pkt->data + 3) >> 13) & 0x1FFF; if (fsize < ADTS_HEADER_SIZE) { -av_packet_unref(pkt); return AVERROR_INVALIDDATA; } ret = av_append_packet(s->pb, pkt, fsize - pkt->size); -if (ret < 0) -av_packet_unref(pkt); return ret; } diff --git a/libavformat/adp.c b/libavformat/adp.c index 56f302acfd..8668c78fe4 100644 --- a/libavformat/adp.c +++ b/libavformat/adp.c @@ -78,7 +78,6 @@ static int adp_read_packet(AVFormatContext *s, AVPacket *pkt) if (ret != size) { if (ret < 0) { -av_packet_unref(pkt); return ret; } av_shrink_packet(pkt, ret); diff --git a/libavformat/adxdec.c b/libavformat/adxdec.c index f80b4b80f0..ccd5049acd 100644 --- a/libavformat/adxdec.c +++ b/libavformat/adxdec.c @@ -65,11 +65,9 @@ static int adx_read_packet(AVFormatContext *s, AVPacket *pkt) ret = av_get_packet(s->pb, pkt, size); if (ret != size) { -av_packet_unref(pkt); return ret < 0 ? ret : AVERROR(EIO); } if (AV_RB16(pkt->data) & 0x8000) { -av_packet_unref(pkt); return AVERROR_EOF; } pkt->size = size; diff --git a/libavformat/amr.c b/libavformat/amr.c index 650b565b1b..eccbbde5b0 100644 --- a/libavformat/amr.c +++ b/libavformat/amr.c @@ -153,7 +153,6 @@ static int amr_read_packet(AVFormatContext *s, AVPacket *pkt) read = avio_read(s->pb, pkt->data + 1, size - 1); if (read != size - 1) { -av_pack
[FFmpeg-cvslog] avfilter/vf_dedot: Fix leak of AVFrame if making it writable fails
ffmpeg | branch: master | Andreas Rheinhardt | Sun Feb 9 19:40:34 2020 +0100| [212077eda46c4c3eb644774d2b1ccbeb3e322fff] | committer: Michael Niedermayer avfilter/vf_dedot: Fix leak of AVFrame if making it writable fails Even in this scenario, the frame still contains references to data that won't be freed if the frame isn't unreferenced. And the AVFrame itself will leak, too. Fixes Coverity issue #1441422. Signed-off-by: Andreas Rheinhardt Reviewed-by: Paul B Mahol Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=212077eda46c4c3eb644774d2b1ccbeb3e322fff --- libavfilter/vf_dedot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_dedot.c b/libavfilter/vf_dedot.c index 1fb7bfe866..993ac8f74f 100644 --- a/libavfilter/vf_dedot.c +++ b/libavfilter/vf_dedot.c @@ -313,7 +313,8 @@ static int activate(AVFilterContext *ctx) FFMIN(s->planeheight[2], ff_filter_get_nb_threads(ctx))); } -} +} else +av_frame_free(&out); } else if (!out) { ret = AVERROR(ENOMEM); } ___ 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] avformat/mpjpegdec: Remove redundant initializations
ffmpeg | branch: master | Andreas Rheinhardt | Tue Jan 7 14:55:43 2020 +0100| [dd81f73946b85134441c0a917dc4dadf7b70ba85] | committer: Marton Balint avformat/mpjpegdec: Remove redundant initializations The AVPacket destined for a demuxer's output has already been initialized before it reaches the demuxer. Signed-off-by: Andreas Rheinhardt Signed-off-by: Marton Balint > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd81f73946b85134441c0a917dc4dadf7b70ba85 --- libavformat/mpjpegdec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c index 1e2ab0db1a..df2880412d 100644 --- a/libavformat/mpjpegdec.c +++ b/libavformat/mpjpegdec.c @@ -331,9 +331,7 @@ static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt) int remaining = 0, len; const int read_chunk = 2048; -av_init_packet(pkt); -pkt->data = NULL; -pkt->size = 0; + pkt->pos = avio_tell(s->pb); while ((ret = ffio_ensure_seekback(s->pb, read_chunk - remaining)) >= 0 && /* we may need to return as much as all we've read back to the buffer */ ___ 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".