[FFmpeg-cvslog] avcodec/msp2dec: Microsoft Paint (MSP) version 2 decoder
ffmpeg | branch: master | Peter Ross | Thu Oct 8 21:04:58 2020 +1100| [85b442e231ea065410312ce6a04ac241cced4765] | committer: Peter Ross avcodec/msp2dec: Microsoft Paint (MSP) version 2 decoder Signed-off-by: Peter Ross > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=85b442e231ea065410312ce6a04ac241cced4765 --- Changelog | 1 + libavcodec/Makefile | 1 + libavcodec/allcodecs.c | 1 + libavcodec/codec_desc.c | 7 libavcodec/codec_id.h | 1 + libavcodec/msp2dec.c| 102 libavcodec/version.h| 2 +- 7 files changed, 114 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 32eb71608a..e0f6e8e299 100644 --- a/Changelog +++ b/Changelog @@ -49,6 +49,7 @@ version : - SpeedHQ encoder - asupercut filter - asubcut filter +- Microsoft Paint (MSP) version 2 decoder version 4.3: diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 01d8c5ee46..33e08548f5 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -508,6 +508,7 @@ OBJS-$(CONFIG_MSMPEG4V2_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o OBJS-$(CONFIG_MSMPEG4V2_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o OBJS-$(CONFIG_MSMPEG4V3_DECODER) += msmpeg4dec.o msmpeg4.o msmpeg4data.o OBJS-$(CONFIG_MSMPEG4V3_ENCODER) += msmpeg4enc.o msmpeg4.o msmpeg4data.o +OBJS-$(CONFIG_MSP2_DECODER)+= msp2dec.o OBJS-$(CONFIG_MSRLE_DECODER) += msrle.o msrledec.o OBJS-$(CONFIG_MSS1_DECODER)+= mss1.o mss12.o OBJS-$(CONFIG_MSS2_DECODER)+= mss2.o mss12.o mss2dsp.o wmv2data.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 774d5670bf..f00d524747 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -215,6 +215,7 @@ extern AVCodec ff_msmpeg4v2_decoder; extern AVCodec ff_msmpeg4v3_encoder; extern AVCodec ff_msmpeg4v3_decoder; extern AVCodec ff_msmpeg4_crystalhd_decoder; +extern AVCodec ff_msp2_decoder; extern AVCodec ff_msrle_decoder; extern AVCodec ff_mss1_decoder; extern AVCodec ff_mss2_decoder; diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 3b148883b8..40a5a9a9e5 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1419,6 +1419,13 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL("AVS3-P2/IEEE1857.10"), .props = AV_CODEC_PROP_LOSSY, }, +{ +.id= AV_CODEC_ID_MSP2, +.type = AVMEDIA_TYPE_VIDEO, +.name = "msp2", +.long_name = NULL_IF_CONFIG_SMALL("Microsoft Paint (MSP) version 2"), +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS, +}, { .id= AV_CODEC_ID_Y41P, .type = AVMEDIA_TYPE_VIDEO, diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h index 668c565788..6133e03bb9 100644 --- a/libavcodec/codec_id.h +++ b/libavcodec/codec_id.h @@ -243,6 +243,7 @@ enum AVCodecID { AV_CODEC_ID_AVS2, AV_CODEC_ID_PGX, AV_CODEC_ID_AVS3, +AV_CODEC_ID_MSP2, AV_CODEC_ID_Y41P = 0x8000, AV_CODEC_ID_AVRP, diff --git a/libavcodec/msp2dec.c b/libavcodec/msp2dec.c new file mode 100644 index 00..cc548d218a --- /dev/null +++ b/libavcodec/msp2dec.c @@ -0,0 +1,102 @@ +/* + * Microsoft Paint (MSP) version 2 decoder + * Copyright (c) 2020 Peter Ross (pr...@xvid.org) + * + * 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 + */ + +/** + * @file + * Microsoft Paint (MSP) version 2 decoder + */ + +#include "avcodec.h" +#include "bytestream.h" +#include "internal.h" + +static int msp2_decode_frame(AVCodecContext *avctx, +void *data, int *got_frame, +AVPacket *avpkt) +{ +const uint8_t *buf = avpkt->data; +int buf_size = avpkt->size; +AVFrame *p = data; +int ret; +unsigned int x, y, width = (avctx->width + 7) / 8; +GetByteContext idx, gb; + +if (buf_size <= 2 * avctx->height) +return AVERROR_INVALIDDATA; + +avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; + +if ((ret = ff_get_buffer(avctx, p, 0)) < 0) +return ret; + +p->pict_type = AV_PICTURE_TYPE_I; +p->key_frame = 1; + +b
[FFmpeg-cvslog] avformat/mspdec: Microsoft Paint (MSP) demuxer
ffmpeg | branch: master | Peter Ross | Thu Oct 8 21:04:58 2020 +1100| [2aab42bc40ebed79a661285f69506b06850629df] | committer: Peter Ross avformat/mspdec: Microsoft Paint (MSP) demuxer Signed-off-by: Peter Ross > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2aab42bc40ebed79a661285f69506b06850629df --- Changelog | 1 + doc/general_contents.texi | 2 + libavformat/Makefile | 1 + libavformat/allformats.c | 1 + libavformat/mspdec.c | 116 ++ libavformat/version.h | 2 +- 6 files changed, 122 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index e0f6e8e299..503317dfae 100644 --- a/Changelog +++ b/Changelog @@ -50,6 +50,7 @@ version : - asupercut filter - asubcut filter - Microsoft Paint (MSP) version 2 decoder +- Microsoft Paint (MSP) demuxer version 4.3: diff --git a/doc/general_contents.texi b/doc/general_contents.texi index 1be6f9b683..443e8ed8d1 100644 --- a/doc/general_contents.texi +++ b/doc/general_contents.texi @@ -735,6 +735,8 @@ following image formats are supported: @item JPEG-LS @tab X @tab X @item LJPEG@tab X @tab @tab Lossless JPEG +@item MSP @tab @tab X +@tab Microsoft Paint image @item PAM @tab X @tab X @tab PAM is a PNM extension with alpha support. @item PBM @tab X @tab X diff --git a/libavformat/Makefile b/libavformat/Makefile index be5a482b01..97d868081b 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -357,6 +357,7 @@ OBJS-$(CONFIG_MPL2_DEMUXER) += mpl2dec.o subtitles.o OBJS-$(CONFIG_MSF_DEMUXER) += msf.o OBJS-$(CONFIG_MPSUB_DEMUXER) += mpsubdec.o subtitles.o OBJS-$(CONFIG_MSNWC_TCP_DEMUXER) += msnwc_tcp.o +OBJS-$(CONFIG_MSP_DEMUXER) += mspdec.o OBJS-$(CONFIG_MTAF_DEMUXER) += mtaf.o OBJS-$(CONFIG_MTV_DEMUXER) += mtv.o OBJS-$(CONFIG_MUSX_DEMUXER) += musx.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 53e5374255..0e0caaad39 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -286,6 +286,7 @@ extern AVInputFormat ff_mpl2_demuxer; extern AVInputFormat ff_mpsub_demuxer; extern AVInputFormat ff_msf_demuxer; extern AVInputFormat ff_msnwc_tcp_demuxer; +extern AVInputFormat ff_msp_demuxer; extern AVInputFormat ff_mtaf_demuxer; extern AVInputFormat ff_mtv_demuxer; extern AVInputFormat ff_musx_demuxer; diff --git a/libavformat/mspdec.c b/libavformat/mspdec.c new file mode 100644 index 00..b81d835a63 --- /dev/null +++ b/libavformat/mspdec.c @@ -0,0 +1,116 @@ +/* + * Microsoft Paint (MSP) demuxer + * Copyright (c) 2020 Peter Ross (pr...@xvid.org) + * + * 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 + */ + +/** + * @file + * Microsoft Paint (MSP) demuxer + */ + +#include "libavutil/intreadwrite.h" +#include "libavutil/imgutils.h" +#include "avformat.h" +#include "internal.h" + +typedef struct { +int packet_size; +} MSPContext; + +static int msp_probe(const AVProbeData *p) +{ +unsigned int i, sum; + +if (p->buf_size <= 32 || (memcmp(p->buf, "DanM", 4) && memcmp(p->buf, "LinS", 4))) +return 0; + +sum = 0; +for (i = 0; i < 24; i += 2) +sum ^= AV_RL16(p->buf + i); + +return AV_RL16(p->buf + 24) == sum ? AVPROBE_SCORE_MAX : 0; +} + +static int msp_read_header(AVFormatContext *s) +{ +MSPContext * cntx = s->priv_data; +AVIOContext *pb = s->pb; +AVStream *st; + +st = avformat_new_stream(s, NULL); +if (!st) +return AVERROR(ENOMEM); + +st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; +st->codecpar->codec_id = avio_rl32(pb) == MKTAG('D', 'a', 'n', 'M') ? AV_CODEC_ID_RAWVIDEO : AV_CODEC_ID_MSP2; + +st->codecpar->width = avio_rl16(pb); +st->codecpar->height = avio_rl16(pb); +st->codecpar->format = AV_PIX_FMT_MONOBLACK; + +st->sample_aspect_ratio.num = avio_rl16(pb); +st->sample_aspect_ratio.den = avio_rl16(pb); +avio_skip(pb, 20); + +if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) { +cntx->packet_size = av_image_get_buffer_size(st->codecpar->format, st->codecpar->width, st->codecpar->height, 1); +if (cntx->pa
[FFmpeg-cvslog] avfilter/af_biquads: add shortcut to set internal precision
ffmpeg | branch: master | Paul B Mahol | Sun Dec 6 14:39:47 2020 +0100| [88b6ebdaceb4f01fafe5886775794bcffea5daca] | committer: Paul B Mahol avfilter/af_biquads: add shortcut to set internal precision > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=88b6ebdaceb4f01fafe5886775794bcffea5daca --- doc/filters.texi | 135 +++ libavfilter/af_biquads.c | 107 - 2 files changed, 240 insertions(+), 2 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 99fcae2650..3a31f72d79 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -1719,6 +1719,21 @@ Set transform type of IIR filter. @item tdii @item latt @end table + +@item precision, r +Set precison of filtering. +@table @option +@item auto +Pick automatic sample format depending on surround filters. +@item s16 +Always use signed 16-bit. +@item s32 +Always use signed 32-bit. +@item f32 +Always use float 32-bit. +@item f64 +Always use float 64-bit. +@end table @end table @subsection Commands @@ -2918,6 +2933,21 @@ Set transform type of IIR filter. @item tdii @item latt @end table + +@item precision, r +Set precison of filtering. +@table @option +@item auto +Pick automatic sample format depending on surround filters. +@item s16 +Always use signed 16-bit. +@item s32 +Always use signed 32-bit. +@item f32 +Always use float 32-bit. +@item f64 +Always use float 64-bit. +@end table @end table @subsection Commands @@ -2990,6 +3020,21 @@ Set transform type of IIR filter. @item tdii @item latt @end table + +@item precision, r +Set precison of filtering. +@table @option +@item auto +Pick automatic sample format depending on surround filters. +@item s16 +Always use signed 16-bit. +@item s32 +Always use signed 32-bit. +@item f32 +Always use float 32-bit. +@item f64 +Always use float 64-bit. +@end table @end table @subsection Commands @@ -3069,6 +3114,21 @@ Set transform type of IIR filter. @item tdii @item latt @end table + +@item precision, r +Set precison of filtering. +@table @option +@item auto +Pick automatic sample format depending on surround filters. +@item s16 +Always use signed 16-bit. +@item s32 +Always use signed 32-bit. +@item f32 +Always use float 32-bit. +@item f64 +Always use float 64-bit. +@end table @end table @subsection Commands @@ -3136,6 +3196,21 @@ Set transform type of IIR filter. @item tdii @item latt @end table + +@item precision, r +Set precison of filtering. +@table @option +@item auto +Pick automatic sample format depending on surround filters. +@item s16 +Always use signed 16-bit. +@item s32 +Always use signed 32-bit. +@item f32 +Always use float 32-bit. +@item f64 +Always use float 64-bit. +@end table @end table @section bs2b @@ -3868,6 +3943,21 @@ Set transform type of IIR filter. @item tdii @item latt @end table + +@item precision, r +Set precison of filtering. +@table @option +@item auto +Pick automatic sample format depending on surround filters. +@item s16 +Always use signed 16-bit. +@item s32 +Always use signed 32-bit. +@item f32 +Always use float 32-bit. +@item f64 +Always use float 64-bit. +@end table @end table @subsection Examples @@ -4354,6 +,21 @@ Set transform type of IIR filter. @item tdii @item latt @end table + +@item precision, r +Set precison of filtering. +@table @option +@item auto +Pick automatic sample format depending on surround filters. +@item s16 +Always use signed 16-bit. +@item s32 +Always use signed 32-bit. +@item f32 +Always use float 32-bit. +@item f64 +Always use float 64-bit. +@end table @end table @subsection Commands @@ -4689,6 +4794,21 @@ Set transform type of IIR filter. @item tdii @item latt @end table + +@item precision, r +Set precison of filtering. +@table @option +@item auto +Pick automatic sample format depending on surround filters. +@item s16 +Always use signed 16-bit. +@item s32 +Always use signed 32-bit. +@item f32 +Always use float 32-bit. +@item f64 +Always use float 64-bit. +@end table @end table @subsection Examples @@ -5895,6 +6015,21 @@ Set transform type of IIR filter. @item tdii @item latt @end table + +@item precision, r +Set precison of filtering. +@table @option +@item auto +Pick automatic sample format depending on surround filters. +@item s16 +Always use signed 16-bit. +@item s32 +Always use signed 32-bit. +@item f32 +Always use float 32-bit. +@item f64 +Always use float 64-bit. +@end table @end table @subsection Commands diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c index 3ec26d2a9d..edefe15d05 100644 --- a/libavfilter/af_biquads.c +++ b/libavfilter/af_biquads.c @@ -115,6 +115,7 @@ typedef struct BiquadsContext { int poles; int csg; int transform_type; +int precision; int bypass; @@ -143,15 +144,20 @@ typedef struct BiquadsContext { static int query_formats(AVFilterContext *ctx) { +BiquadsContext *s = ctx->priv; AVFilterFormats *formats;
[FFmpeg-cvslog] avfilter/vf_showinfo: include the correct Dynamic HDR10+ header
ffmpeg | branch: master | James Almer | Sun Dec 6 12:08:58 2020 -0300| [13f35782b9f57449ea6e93f914f953f17d1e34fc] | committer: James Almer avfilter/vf_showinfo: include the correct Dynamic HDR10+ header Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=13f35782b9f57449ea6e93f914f953f17d1e34fc --- libavfilter/vf_showinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c index f9ed54a70c..6208892005 100644 --- a/libavfilter/vf_showinfo.c +++ b/libavfilter/vf_showinfo.c @@ -24,12 +24,12 @@ #include -#include "libavcodec/dynamic_hdr10_plus.h" #include "libavutil/bswap.h" #include "libavutil/adler32.h" #include "libavutil/display.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" +#include "libavutil/hdr_dynamic_metadata.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "libavutil/spherical.h" ___ 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/hevc_sei: replace en dash character with a hyphen
ffmpeg | branch: master | James Almer | Sun Dec 6 12:29:18 2020 -0300| [5b9082377967351495d31ac924d93bf7df2e02a6] | committer: James Almer avcodec/hevc_sei: replace en dash character with a hyphen Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b9082377967351495d31ac924d93bf7df2e02a6 --- libavcodec/hevc_sei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/hevc_sei.c b/libavcodec/hevc_sei.c index 4a0bc538c2..8a29181a31 100644 --- a/libavcodec/hevc_sei.c +++ b/libavcodec/hevc_sei.c @@ -230,7 +230,7 @@ static int decode_nal_sei_user_data_registered_itu_t_t35(HEVCSEI *s, GetBitConte if (country_code == usa_country_code && provider_code == smpte_provider_code) { -// A/341 Amendment – 2094-40 +// A/341 Amendment - 2094-40 const uint16_t smpte2094_40_provider_oriented_code = 0x0001; const uint8_t smpte2094_40_application_identifier = 0x04; ___ 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/dynamic_hdr10_plus: use get_bits_long() where needed
ffmpeg | branch: master | James Almer | Sun Dec 6 13:36:37 2020 -0300| [7a170bd6c14b17c7972d11deb9fbd6cfa2131256] | committer: James Almer avcodec/dynamic_hdr10_plus: use get_bits_long() where needed Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a170bd6c14b17c7972d11deb9fbd6cfa2131256 --- libavcodec/dynamic_hdr10_plus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/dynamic_hdr10_plus.c b/libavcodec/dynamic_hdr10_plus.c index 5684bfb2ef..bf0d085b8f 100644 --- a/libavcodec/dynamic_hdr10_plus.c +++ b/libavcodec/dynamic_hdr10_plus.c @@ -74,7 +74,7 @@ int ff_parse_itu_t_t35_to_dynamic_hdr10_plus(GetBitContext *gb, AVDynamicHDRPlus return AVERROR(EINVAL); s->targeted_system_display_maximum_luminance = -(AVRational){get_bits(gb, 27), luminance_den}; +(AVRational){get_bits_long(gb, 27), luminance_den}; s->targeted_system_display_actual_peak_luminance_flag = get_bits1(gb); if (s->targeted_system_display_actual_peak_luminance_flag) { ___ 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/dv: fix timestamps of audio packets in case of dropped corrupt audio frames
ffmpeg | branch: master | Marton Balint | Sat Oct 31 17:51:34 2020 +0100| [76fbb0052df471075858c1cb82b04c8be7adba8d] | committer: Marton Balint avformat/dv: fix timestamps of audio packets in case of dropped corrupt audio frames By using the frame counter (and the video time base) for audio pts we lose some timestamp precision but we ensure that video and audio coming from the same DV frame are always in sync. This patch also makes timestamps after seek consistent and it should also fix the timestamps when the audio clock is unlocked and have a completely indpendent clock source. (E.g. runs on fixed 48009 Hz which should have been exact 48000 Hz) Fixes out of sync timestamps in ticket #8762. Signed-off-by: Marton Balint > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=76fbb0052df471075858c1cb82b04c8be7adba8d --- libavformat/dv.c | 16 ++-- tests/ref/seek/lavf-dv | 18 +- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/libavformat/dv.c b/libavformat/dv.c index 3e0d12c0e3..26a78139f5 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -49,7 +49,6 @@ struct DVDemuxContext { uint8_t audio_buf[4][8192]; int ach; int frames; -uint64_t abytes; }; static inline uint16_t dv_audio_12to16(uint16_t sample) @@ -258,7 +257,7 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame) c->ast[i] = avformat_new_stream(c->fctx, NULL); if (!c->ast[i]) break; -avpriv_set_pts_info(c->ast[i], 64, 1, 3); +avpriv_set_pts_info(c->ast[i], 64, c->sys->time_base.num, c->sys->time_base.den); c->ast[i]->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; c->ast[i]->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE; @@ -387,8 +386,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, for (i = 0; i < c->ach; i++) { c->audio_pkt[i].pos = pos; c->audio_pkt[i].size = size; -c->audio_pkt[i].pts = c->abytes * 3 * 8 / - c->ast[i]->codecpar->bit_rate; +c->audio_pkt[i].pts = (c->sys->height == 720) ? (c->frames & ~1) : c->frames; ppcm[i] = c->audio_buf[i]; } if (c->ach) @@ -401,10 +399,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, c->audio_pkt[2].size = c->audio_pkt[3].size = 0; } else { c->audio_pkt[0].size = c->audio_pkt[1].size = 0; -c->abytes += size; } -} else { -c->abytes += size; } /* Now it's time to return video packet */ @@ -444,13 +439,6 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c, void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset) { c->frames = frame_offset; -if (c->ach) { -if (c->sys) { -c->abytes = av_rescale_q(c->frames, c->sys->time_base, - (AVRational) { 8, c->ast[0]->codecpar->bit_rate }); -} else -av_log(c->fctx, AV_LOG_ERROR, "cannot adjust audio bytes\n"); -} c->audio_pkt[0].size = c->audio_pkt[1].size = 0; c->audio_pkt[2].size = c->audio_pkt[3].size = 0; } diff --git a/tests/ref/seek/lavf-dv b/tests/ref/seek/lavf-dv index ff5abe..f63e4460be 100644 --- a/tests/ref/seek/lavf-dv +++ b/tests/ref/seek/lavf-dv @@ -7,9 +7,9 @@ ret: 0 st: 0 flags:0 ts: 0.80 ret: 0 st: 0 flags:1 dts: 0.80 pts: 0.80 pos:288 size:144000 ret: 0 st: 0 flags:1 ts:-0.32 ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 0 size:144000 -ret: 0 st: 1 flags:0 ts: 2.576667 +ret: 0 st: 1 flags:0 ts: 2.56 ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos:3456000 size:144000 -ret: 0 st: 1 flags:1 ts: 1.470833 +ret: 0 st: 1 flags:1 ts: 1.48 ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos:3456000 size:144000 ret: 0 st:-1 flags:0 ts: 0.365002 ret: 0 st: 0 flags:1 dts: 0.36 pts: 0.36 pos:1296000 size:144000 @@ -19,9 +19,9 @@ ret: 0 st: 0 flags:0 ts: 2.16 ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos:3456000 size:144000 ret: 0 st: 0 flags:1 ts: 1.04 ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos:3456000 size:144000 -ret: 0 st: 1 flags:0 ts:-0.058333 +ret: 0 st: 1 flags:0 ts:-0.04 ret: 0 st: 0 flags:1 dts: 0.00 pts: 0.00 pos: 0 size:144000 -ret: 0 st: 1 flags:1 ts: 2.835833 +ret: 0 st: 1 flags:1 ts: 2.84 ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos:3456000 size:144000 ret: 0 st:-1 flags:0 ts: 1.730004 ret: 0 st: 0 flags:1 dts: 0.96 pts: 0.96 pos:3456000 size:144000 @@ -31,10 +31,10 @@ ret: 0 st: 0 flags:0 ts:-0.48
[FFmpeg-cvslog] avformat/av1dec: check size before addition in probing
ffmpeg | branch: master | Michael Niedermayer | Thu Nov 5 20:04:20 2020 +0100| [76b6c46a81f420ffa04211d4b598547f14b67cb7] | committer: Michael Niedermayer avformat/av1dec: check size before addition in probing Fixes: signed integer overflow: 175 + 2147483571 cannot be represented in type 'int' Fixes: 26833/clusterfuzz-testcase-minimized-ffmpeg_dem_IMAGE2_fuzzer-5969501214212096 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=76b6c46a81f420ffa04211d4b598547f14b67cb7 --- libavformat/av1dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/av1dec.c b/libavformat/av1dec.c index 395eef6522..5ae81b34d4 100644 --- a/libavformat/av1dec.c +++ b/libavformat/av1dec.c @@ -361,7 +361,7 @@ static int obu_probe(const AVProbeData *p) ret = read_obu_with_size(p->buf + cnt, p->buf_size - cnt, &obu_size, &type); if (ret < 0 || obu_size <= 0) return 0; -cnt += ret; +cnt += FFMIN(ret, p->buf_size - cnt); ret = get_score(type, &seq); if (ret >= 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/dsfdec: Check block_align more completely
ffmpeg | branch: master | Michael Niedermayer | Thu Nov 5 21:22:13 2020 +0100| [65b8974d54455adc7a462f0f7385b76e1d08101c] | committer: Michael Niedermayer avformat/dsfdec: Check block_align more completely Fixes: infinite loop Fixes: 26865/clusterfuzz-testcase-minimized-ffmpeg_dem_DSF_fuzzer-5649473830912000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=65b8974d54455adc7a462f0f7385b76e1d08101c --- libavformat/dsfdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/dsfdec.c b/libavformat/dsfdec.c index c9740cf28f..1df163e114 100644 --- a/libavformat/dsfdec.c +++ b/libavformat/dsfdec.c @@ -124,8 +124,8 @@ static int dsf_read_header(AVFormatContext *s) dsf->audio_size = avio_rl64(pb) / 8 * st->codecpar->channels; st->codecpar->block_align = avio_rl32(pb); -if (st->codecpar->block_align > INT_MAX / st->codecpar->channels) { -avpriv_request_sample(s, "block_align overflow"); +if (st->codecpar->block_align > INT_MAX / st->codecpar->channels || st->codecpar->block_align <= 0) { +avpriv_request_sample(s, "block_align invalid"); return AVERROR_INVALIDDATA; } st->codecpar->block_align *= st->codecpar->channels; ___ 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/h264idct_template: Fix integer overflow in ff_h264_chroma422_dc_dequant_idct()
ffmpeg | branch: master | Michael Niedermayer | Thu Nov 5 22:14:21 2020 +0100| [51dfd6f1bdb03bfc7574b12e921fb3b8639ba5cf] | committer: Michael Niedermayer avcodec/h264idct_template: Fix integer overflow in ff_h264_chroma422_dc_dequant_idct() Fixes: signed integer overflow: -2105540608 - 2105540608 cannot be represented in type 'int' Fixes: 26870/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5656647567147008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=51dfd6f1bdb03bfc7574b12e921fb3b8639ba5cf --- libavcodec/h264idct_template.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264idct_template.c b/libavcodec/h264idct_template.c index f19579a47c..ce66ed3ab8 100644 --- a/libavcodec/h264idct_template.c +++ b/libavcodec/h264idct_template.c @@ -283,8 +283,8 @@ void FUNCC(ff_h264_chroma422_dc_dequant_idct)(int16_t *_block, int qmul){ dctcoef *block = (dctcoef*)_block; for(i=0; i<4; i++){ -temp[2*i+0] = block[stride*i + xStride*0] + block[stride*i + xStride*1]; -temp[2*i+1] = block[stride*i + xStride*0] - block[stride*i + xStride*1]; +temp[2*i+0] = block[stride*i + xStride*0] + (unsigned)block[stride*i + xStride*1]; +temp[2*i+1] = block[stride*i + xStride*0] - (unsigned)block[stride*i + xStride*1]; } for(i=0; i<2; i++){ ___ 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/realtextdec: read_ts() in 64bits
ffmpeg | branch: master | Michael Niedermayer | Thu Nov 5 16:19:18 2020 +0100| [47c146a56b5f6641dcf02bbaa056588d5536c582] | committer: Michael Niedermayer avformat/realtextdec: read_ts() in 64bits Fixes: signed integer overflow: 46671062 * 100 cannot be represented in type 'int' Fixes: 26826/clusterfuzz-testcase-minimized-ffmpeg_dem_REALTEXT_fuzzer-5644062910316544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=47c146a56b5f6641dcf02bbaa056588d5536c582 --- libavformat/realtextdec.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavformat/realtextdec.c b/libavformat/realtextdec.c index c2316da0ed..390f8ddc67 100644 --- a/libavformat/realtextdec.c +++ b/libavformat/realtextdec.c @@ -45,16 +45,16 @@ static int realtext_probe(const AVProbeData *p) return !av_strncasecmp(buf, "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/nvdec: Add support for decoding monochrome av1
ffmpeg | branch: master | Philip Langdale | Sat Dec 5 20:25:29 2020 -0800| [67bb11b5f6548c3b273b575f44077db19bb9a98e] | committer: Philip Langdale avcodec/nvdec: Add support for decoding monochrome av1 The nvidia hardware explicitly supports decoding monochrome content, presumably for the AVIF alpha channel. Supporting this requires an adjustment in av1dec and explicit monochrome detection in nvdec. I'm not sure why the monochrome path in av1dec did what it did - it seems non-functional - YUV440P doesn't seem a logical pix_fmt for monochrome and conditioning on chroma sub-sampling doesn't make sense. So I changed it. I've tested 8bit content, but I haven't found a way to create a 10bit sample, so that path is untested for now. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=67bb11b5f6548c3b273b575f44077db19bb9a98e --- libavcodec/av1dec.c | 19 --- libavcodec/nvdec.c | 3 +++ libavcodec/version.h | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index d7b2ac9d46..bc897af9cf 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -387,9 +387,12 @@ static int get_pixel_format(AVCodecContext *avctx) av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } } else { -if (seq->color_config.subsampling_x == 1 && -seq->color_config.subsampling_y == 1) -pix_fmt = AV_PIX_FMT_YUV440P; +if (bit_depth == 8) +pix_fmt = AV_PIX_FMT_GRAY8; +else if (bit_depth == 10) +pix_fmt = AV_PIX_FMT_GRAY10; +else if (bit_depth == 12) +pix_fmt = AV_PIX_FMT_GRAY12; else av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n"); } @@ -430,6 +433,16 @@ static int get_pixel_format(AVCodecContext *avctx) #endif #if CONFIG_AV1_VAAPI_HWACCEL *fmtp++ = AV_PIX_FMT_VAAPI; +#endif +break; +case AV_PIX_FMT_GRAY8: +#if CONFIG_AV1_NVDEC_HWACCEL +*fmtp++ = AV_PIX_FMT_CUDA; +#endif +break; +case AV_PIX_FMT_GRAY10: +#if CONFIG_AV1_NVDEC_HWACCEL +*fmtp++ = AV_PIX_FMT_CUDA; #endif break; } diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index 48281293ce..23c84d9acf 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -83,6 +83,9 @@ static int map_chroma_format(enum AVPixelFormat pix_fmt) { int shift_h = 0, shift_v = 0; +if (av_pix_fmt_count_planes(pix_fmt) == 1) +return cudaVideoChromaFormat_Monochrome; + av_pix_fmt_get_chroma_sub_sample(pix_fmt, &shift_h, &shift_v); if (shift_h == 1 && shift_v == 1) diff --git a/libavcodec/version.h b/libavcodec/version.h index 4ee221b7f2..1c10d105f6 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MINOR 115 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ ___ 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".