Re: [FFmpeg-devel] [PATCH] libavdevice/decklink: extend available actions on signal loss
On 11/28/23 16:48, Devin Heitmueller wrote: > My apologies, I saw your remarks that this didn't change backward > compatibility but failed to reply. I have no further issues with this > patch. > > Thanks, > > Devin Ping. Can this please be merged? Thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v3] avformat/mov: Add support for demuxing still HEIC images
On 10/4/2023 1:40 PM, Vignesh Venkatasubramanian via ffmpeg-devel wrote: They are similar to AVIF images (both use the HEIF container). The only additional work needed is to parse the hvcC box and put it in the extradata. With this patch applied, ffmpeg (when built with an HEVC decoder) is able to decode the files in https://github.com/nokiatech/heif/tree/gh-pages/content/images Also add a couple of fate tests with samples from https://github.com/nokiatech/heif_conformance/tree/master/conformance_files Partially fixes trac ticket #6521. Signed-off-by: Vignesh Venkatasubramanian --- libavformat/isom.h| 2 + libavformat/mov.c | 41 ++- tests/fate/mov.mak| 6 +++ .../fate/mov-heic-demux-still-image-1-item| 11 + .../mov-heic-demux-still-image-multiple-items | 11 + 5 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 tests/ref/fate/mov-heic-demux-still-image-1-item create mode 100644 tests/ref/fate/mov-heic-demux-still-image-multiple-items This seems to have been forgotten, so I'll apply it soon. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2 4/4] vvcdec: reuse h26x/h2656_deblock_template.c
Hi, On Mon, Jan 8, 2024 at 10:05 PM Nuo Mi wrote: > On Tue, Jan 9, 2024 at 9:23 AM Ronald S. Bultje > wrote: > > > Hi, > > > > On Mon, Jan 8, 2024 at 8:03 PM Nuo Mi wrote: > > > > > On Sat, Jan 6, 2024 at 6:52 PM Nuo Mi wrote: > > > > > > > --- > > > > libavcodec/vvc/vvc_filter_template.c | 82 > +--- > > > > 1 file changed, 3 insertions(+), 79 deletions(-) > > > > > > > > diff --git a/libavcodec/vvc/vvc_filter_template.c > > > > b/libavcodec/vvc/vvc_filter_template.c > > > > index 9418980c33..671ed7de4e 100644 > > > > --- a/libavcodec/vvc/vvc_filter_template.c > > > > +++ b/libavcodec/vvc/vvc_filter_template.c > > > > @@ -461,6 +461,8 @@ static void > FUNC(alf_recon_coeff_and_clip)(int16_t > > > > *coeff, int16_t *clip, > > > > #define FQ2 pix[2 * xstride + 1 * ystride] > > > > #define FQ3 pix[3 * xstride + 1 * ystride] > > > > > > > > +#include "libavcodec/h26x/h2656_deblock_template.c" > > > > > > > Will merge this in two days if there are no objections to the file and > > > directory names. > > > > > > > Are there options to share the actual generated binary code? The C code > > admittedly is not so important, but it would be great if there was some > way > > to ensure that optimizations written for HEVC in some instruction set, > work > > for VVC also - or vice versa. > > > Yes. After we merge this, we will send out the mc x86 asm code for review. > It will share the same binary with HEVC. > For SAO/Deblock, we will follow a similar approach, but it needs to be a > little later than mc. > For C code, we can share the binary as well, but it involves some interface > changes, better to do it after all asm is ready. > OK, that sounds reasonable to me. Ronald ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v4] avcodec/cbs_vp8: Use little endian in fixed() and improve the pos check
This commit adds value range checks to cbs_vp8_read_unsigned_le, migrates fixed() to use it, and enforces little-endian consistency for all read methods. The VP8 compressed header may not be byte-aligned due to boolean coding. Use bitwise comparison to prevent the potential overread. TETS: ffmpeg -i fate-suite/vp8-test-vectors-r1/* -vcodec copy -bsf:v trace_headers -f null - Signed-off-by: Jianhui Dai --- libavcodec/cbs_vp8.c | 53 +++- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/libavcodec/cbs_vp8.c b/libavcodec/cbs_vp8.c index 065156c248..338d56ed7f 100644 --- a/libavcodec/cbs_vp8.c +++ b/libavcodec/cbs_vp8.c @@ -33,22 +33,22 @@ extern const uint8_t ff_vp8_token_update_probs[4][8][3][11]; typedef struct CBSVP8BoolDecoder { GetBitContext *gbc; -uint8_t value; uint8_t range; -uint8_t count; // Store the number of bits in the `value` buffer. - +uint8_t value; +// Store the number of bits in the `value` buffer. +uint8_t count; } CBSVP8BoolDecoder; -static int cbs_vp8_bool_decoder_init(CBSVP8BoolDecoder *decoder, GetBitContext *gbc) +static int cbs_vp8_bool_decoder_init(CBSVP8BoolDecoder *decoder, + GetBitContext *gbc) { av_assert0(decoder); av_assert0(gbc); decoder->gbc = gbc; -decoder->value = 0; decoder->range = 255; - +decoder->value = 0; decoder->count = 0; return 0; @@ -60,7 +60,7 @@ static bool cbs_vp8_bool_decoder_fill_value(CBSVP8BoolDecoder *decoder) av_assert0(decoder->count <= 8); if (decoder->count == 8) { - return true; +return true; } if (get_bits_left(decoder->gbc) >= bits) { @@ -141,7 +141,7 @@ static int cbs_vp8_bool_decoder_read_unsigned( } if (trace_enable) { - CBS_TRACE_READ_END(); +CBS_TRACE_READ_END(); } *write_to = value; @@ -181,9 +181,11 @@ static int cbs_vp8_bool_decoder_read_signed( return 0; } -static int cbs_vp8_read_unsigned_le(CodedBitstreamContext *ctx, GetBitContext *gbc, - int width, const char *name, - const int *subscripts, uint32_t *write_to) +static int cbs_vp8_read_unsigned_le(CodedBitstreamContext *ctx, +GetBitContext *gbc, int width, +const char *name, const int *subscripts, +uint32_t *write_to, uint32_t range_min, +uint32_t range_max) { int32_t value; @@ -200,6 +202,14 @@ static int cbs_vp8_read_unsigned_le(CodedBitstreamContext *ctx, GetBitContext *g CBS_TRACE_READ_END(); +if (value < range_min || value > range_max) { +av_log(ctx->log_ctx, AV_LOG_ERROR, + "%s out of range: " + "%" PRIu32 ", but must be in [%" PRIu32 ",%" PRIu32 "].\n", + name, value, range_min, range_max); +return AVERROR_INVALIDDATA; +} + *write_to = value; return 0; } @@ -246,15 +256,16 @@ static int cbs_vp8_read_unsigned_le(CodedBitstreamContext *ctx, GetBitContext *g do { \ uint32_t value; \ CHECK(cbs_vp8_read_unsigned_le(ctx, rw, width, #name, \ -SUBSCRIPTS(subs, __VA_ARGS__), &value)); \ + SUBSCRIPTS(subs, __VA_ARGS__), &value, \ + 0, MAX_UINT_BITS(width))); \ current->name = value; \ } while (0) #define fixed(width, name, value) \ do { \ uint32_t fixed_value; \ -CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, 0, &fixed_value, \ - value, value)); \ +CHECK(cbs_vp8_read_unsigned_le(ctx, rw, width, #name, 0, &fixed_value, \ + value, value)); \ } while (0) #define bc_unsigned_subs(width, prob, enable_trace, name, subs, ...) \ @@ -277,6 +288,15 @@ static int cbs_vp8_read_unsigned_le(CodedBitstreamContext *ctx, GetBitContext *g #include "cbs_vp8_syntax_template.c" +#undef READ +#undef READWRITE +#undef RWContext +#undef CBSVP8BoolCodingRW +#undef xf +#undef fixed +#undef bc_unsigned_subs +#undef bc_signed_subs + static int cbs_vp8_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header) { @@ -327,9 +347,10 @@ static int cbs_vp8_read_unit(CodedBitstreamContext *ctx, if (err < 0) return err; +// Position may not be byte-aligned after compressed header; use bit-level +// comparison. pos = get_bits_count(&gbc); -pos /= 8; -av_assert0(pos <= unit->data_size); +av_assert0(pos <= unit->data_size * 8); frame->data_ref = av_buffer_ref(unit->data_ref); if (!frame->data_ref) -- 2.25.1 ___ ffmpeg-devel mailing list ffmpeg-de
[FFmpeg-devel] avfilter/vsrc_testsrc: fix colorchart black stripe
From c9b1deef0abd1d04866f7009b589339ae791937e Mon Sep 17 00:00:00 2001 From: Vladimir Petrov Date: Tue, 9 Jan 2024 18:42:19 +0200 Subject: [PATCH] avfilter/vsrc_testsrc: fix colorchart black stripe Fixed blackstripe on bottom or segmentation fault in case when patch width and height differ. Signed-off-by: Vladimir Petrov --- libavfilter/vsrc_testsrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index da17e950d8..3b5536badc 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -1977,7 +1977,7 @@ static void colorchart_fill_picture(AVFilterContext *ctx, AVFrame *frame) const int w = colorchart_presets[preset].w; const int h = colorchart_presets[preset].h; const int pw = test->pw; -const int ph = test->pw; +const int ph = test->ph; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { -- 2.43.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] Hardware purchase request: AVX512-capable laptop
Jan 3, 2024, 04:30 by d...@lynne.ee: > Jan 3, 2024, 04:04 by d...@lynne.ee: > >> Jan 3, 2024, 02:22 by jamr...@gmail.com: >> >>> On 1/2/2024 9:56 PM, Lynne wrote: >>> As some of you know, my laptop died nearly 2 years ago, and I've been working on a desktop machine, which is currently a Zen 3. AVX512 has become more popular in the meantime, with Zen 4 and future AMD CPUs shipping with it, but currently, we have very little AVX512. In short, I'd like a machine which runs an AVX512-capable AMD CPU, and as the world is opening up more and more, I'd like for it to be portable. I've looked around a lot, but as Intel still has a firm monopoly, the options are limited (7940H(S), 7945HX, 7845HX, 8945HS). What I think I've settled for is an ASUS Vivobook Pro 15, with a 7940HS CPU (the second least powerful Zen 4 mobile CPU), >>> >>> 7940HS is the highest Ryzen 9 model from the 7040 series. Not sure where >>> you got second least powerful from. >>> >>> https://en.wikipedia.org/wiki/List_of_AMD_Ryzen_processors#Phoenix_(7040_series,_Zen_4/RDNA3_based) >>> >> >> Was reading Wikipedia, and thought it was a Zen 3, my mistake >> (and AMD's mistake for making 4 versioning formats): >> https://en.wikipedia.org/wiki/List_of_AMD_Ryzen_processors >> >> currently trading for 1999.0 EUR on amazon.de. https://www.amazon.de/-/en/Vivobook-Display-R9-7940HS-Windows-Keyboard/dp/B0BRYTS8MR The other alternative I've found is a Lenovo Legion 7 Pro, but it's more expensive at 2399 EUR (currently seems temporarily discounted due to the holidays). >>> >>> I see a Lenovo Yoga Pro 7 available for 1099 EUR. >>> https://www.amazon.de/-/en/Lenovo-Display-Graphics-Blue-Green-Premium/dp/B0CGLPVQHK/ >>> >>> Same amount of RAM, screen resolution and storage, and a Ryzen 7. >>> >> >> It's a good suggestion, but I have a better one, that's somewhat more >> expensive, >> but has a better screen, better build quality, and is cheaper than the >> Vivobook: >> >> A Lenovo ThinkPad P14s Gen 4 with the following options: >> - Windows 14 Home (if you don't pick Windows, the OLED display is not >> available for no reason) >> - 32Gb of RAM >> - 1Tb "performance" SSD (it's 70 EUR more, but twice the size) >> - 2880x1800 OLED monitor >> - 4-cell battery (only 10 EUR more) >> - English (EU) keyboard, without backlighting >> >> https://www.lenovo.com/de/de/configurator/cto/index.html?bundleId=21K9CTO1WWDE2 >> > > Correction: link I pasted was for the P16s, not the P14s, this is the correct > link: > https://www.lenovo.com/de/de/configurator/cto/index.html?bundleId=21K5CTO1WWDE2 > Ping. So far I have one approval from Michael. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/2] avformat/mov: rename avif fields to heif
They are no longer avif specific. Signed-off-by: James Almer --- libavformat/isom.h | 4 ++-- libavformat/mov.c | 28 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libavformat/isom.h b/libavformat/isom.h index b30b9da65e..90c4fb5530 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -325,8 +325,8 @@ typedef struct MOVContext { int item_id; int extent_length; int64_t extent_offset; -} *avif_info; -int avif_info_size; +} *heif_info; +int heif_info_size; int64_t hvcC_offset; int hvcC_size; int interleaved_read; diff --git a/libavformat/mov.c b/libavformat/mov.c index c6398d6d81..12e82c66a9 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4916,15 +4916,15 @@ static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom) return ret; } -static int avif_add_stream(MOVContext *c, int item_id) +static int heif_add_stream(MOVContext *c, int item_id) { MOVStreamContext *sc; AVStream *st; int item_index = -1; if (c->fc->nb_streams) return AVERROR_INVALIDDATA; -for (int i = 0; i < c->avif_info_size; i++) -if (c->avif_info[i].item_id == item_id) { +for (int i = 0; i < c->heif_info_size; i++) +if (c->heif_info[i].item_id == item_id) { item_index = i; break; } @@ -4987,8 +4987,8 @@ static int avif_add_stream(MOVContext *c, int item_id) sc->stts_data[0].count = 1; // Not used for still images. But needed by mov_build_index. sc->stts_data[0].duration = 0; -sc->sample_sizes[0] = c->avif_info[item_index].extent_length; -sc->chunk_offsets[0] = c->avif_info[item_index].extent_offset; +sc->sample_sizes[0] = c->heif_info[item_index].extent_length; +sc->chunk_offsets[0] = c->heif_info[item_index].extent_offset; mov_build_index(c, st); return 0; @@ -5013,7 +5013,7 @@ static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (c->is_still_picture_avif) { int ret; // Add a stream for the YUV planes (primary item). -if ((ret = avif_add_stream(c, c->primary_item_id)) < 0) +if ((ret = heif_add_stream(c, c->primary_item_id)) < 0) return ret; // For still AVIF images, the meta box contains all the // necessary information that would generally be provided by the @@ -7820,7 +7820,7 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; } -if (c->avif_info) { +if (c->heif_info) { av_log(c->fc, AV_LOG_INFO, "Duplicate iloc box found\n"); return 0; } @@ -7841,16 +7841,16 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) } item_count = (version < 2) ? avio_rb16(pb) : avio_rb32(pb); -c->avif_info = av_malloc_array(item_count, sizeof(*c->avif_info)); -if (!c->avif_info) +c->heif_info = av_malloc_array(item_count, sizeof(*c->heif_info)); +if (!c->heif_info) return AVERROR(ENOMEM); -c->avif_info_size = item_count; +c->heif_info_size = item_count; for (int i = 0; i < item_count; i++) { int item_id = (version < 2) ? avio_rb16(pb) : avio_rb32(pb); if (avio_feof(pb)) return AVERROR_INVALIDDATA; -c->avif_info[i].item_id = item_id; +c->heif_info[i].item_id = item_id; if (version > 0) avio_rb16(pb); // construction_method. @@ -7867,8 +7867,8 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (rb_size(pb, &extent_offset, offset_size) < 0 || rb_size(pb, &extent_length, length_size) < 0) return AVERROR_INVALIDDATA; -c->avif_info[i].extent_length = extent_length; -c->avif_info[i].extent_offset = base_offset + extent_offset; +c->heif_info[i].extent_length = extent_length; +c->heif_info[i].extent_offset = base_offset + extent_offset; } } @@ -8502,7 +8502,7 @@ static int mov_read_close(AVFormatContext *s) av_freep(&mov->aes_decrypt); av_freep(&mov->chapter_tracks); -av_freep(&mov->avif_info); +av_freep(&mov->heif_info); return 0; } -- 2.43.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/2] avformat/mov: improve HEIF parsing
Parse iinf boxes and its child infe boxes to get the actual codec used (AV1 for avif, HEVC for heic), and properly export extradata in a generic way. The avif tests reference files are updated as the extradata is now exported. Signed-off-by: James Almer --- libavformat/isom.h| 3 +- libavformat/mov.c | 157 ++ .../fate/mov-avif-demux-still-image-1-item| 2 +- .../mov-avif-demux-still-image-multiple-items | 2 +- 4 files changed, 95 insertions(+), 69 deletions(-) diff --git a/libavformat/isom.h b/libavformat/isom.h index 90c4fb5530..107e2ce9bb 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -268,6 +268,7 @@ typedef struct MOVContext { int time_scale; int64_t duration; ///< duration of the longest track int found_moov; ///< 'moov' atom has been found +int found_iloc; ///< 'iloc' atom has been found int found_mdat; ///< 'mdat' atom has been found int found_hdlr_mdta; ///< 'hdlr' atom with type 'mdta' has been found int trak_index; ///< Index of the current 'trak' @@ -327,8 +328,6 @@ typedef struct MOVContext { int64_t extent_offset; } *heif_info; int heif_info_size; -int64_t hvcC_offset; -int hvcC_size; int interleaved_read; } MOVContext; diff --git a/libavformat/mov.c b/libavformat/mov.c index 12e82c66a9..47d0d41214 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1233,8 +1233,6 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom) c->isom = 1; av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type); av_dict_set(&c->fc->metadata, "major_brand", type, 0); -c->is_still_picture_avif = !strncmp(type, "avif", 4) || - !strncmp(type, "mif1", 4); minor_ver = avio_rb32(pb); /* minor version */ av_dict_set_int(&c->fc->metadata, "minor_version", minor_ver, 0); @@ -4641,10 +4639,6 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom) MOVStreamContext *sc; int ret; -if (c->is_still_picture_avif) { -return AVERROR_INVALIDDATA; -} - st = avformat_new_stream(c->fc, NULL); if (!st) return AVERROR(ENOMEM); st->id = -1; @@ -4916,7 +4910,7 @@ static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom) return ret; } -static int heif_add_stream(MOVContext *c, int item_id) +static int heif_add_stream(MOVContext *c, int item_id, uint32_t item_type) { MOVStreamContext *sc; AVStream *st; @@ -4940,20 +4934,7 @@ static int heif_add_stream(MOVContext *c, int item_id) st->priv_data = sc; st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; -st->codecpar->codec_id = AV_CODEC_ID_AV1; -if (c->hvcC_offset >= 0) { -int ret; -int64_t pos = avio_tell(c->fc->pb); -st->codecpar->codec_id = AV_CODEC_ID_HEVC; -if (avio_seek(c->fc->pb, c->hvcC_offset, SEEK_SET) != c->hvcC_offset) { -av_log(c->fc, AV_LOG_ERROR, "Failed to seek to hvcC data.\n"); -return AVERROR_UNKNOWN; -} -ret = ff_get_extradata(c->fc, st->codecpar, c->fc->pb, c->hvcC_size); -if (ret < 0) -return ret; -avio_seek(c->fc->pb, pos, SEEK_SET); -} +st->codecpar->codec_id = mov_codec_id(st, item_type); sc->ffindex = st->index; c->trak_index = st->index; st->avg_frame_rate.num = st->avg_frame_rate.den = 1; @@ -4996,8 +4977,6 @@ static int heif_add_stream(MOVContext *c, int item_id) static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom) { -c->hvcC_offset = -1; -c->hvcC_size = 0; while (atom.size > 8) { uint32_t tag; if (avio_feof(pb)) @@ -5005,23 +4984,9 @@ static int mov_read_meta(MOVContext *c, AVIOContext *pb, MOVAtom atom) tag = avio_rl32(pb); atom.size -= 4; if (tag == MKTAG('h','d','l','r')) { -int ret; avio_seek(pb, -8, SEEK_CUR); atom.size += 8; -if ((ret = mov_read_default(c, pb, atom)) < 0) -return ret; -if (c->is_still_picture_avif) { -int ret; -// Add a stream for the YUV planes (primary item). -if ((ret = heif_add_stream(c, c->primary_item_id)) < 0) -return ret; -// For still AVIF images, the meta box contains all the -// necessary information that would generally be provided by the -// moov box. So simply mark that we have found the moov box so -// that parsing can continue. -c->found_moov = 1; -} -return ret; +return mov_read_default(c, pb, atom); } } return 0; @@ -7813,18 +7778,10 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) uint64_t base_offset,
[FFmpeg-devel] [PATCH v2] checkasm: Generalize crash handling
This replaces the riscv specific handling from 7212466e735aa187d82f51dadbce957fe3da77f0 (which essentially is reverted, together with 286d6742218ba0235c32876b50bf593cb1986353) with a different implementation of the same (plus a bit more), based on the corresponding feature in dav1d's checkasm, supporting both Unix and Windows. See in particular dav1d commits 0b6ee30eab2400e4f85b735ad29a68a842c34e21 and 0421f787ea592fd2cc74c887f20b8dc31393788b, authored by Henrik Gramner. The overall approach is the same; set up a signal handler, store the state with sigsetjmp, jump out of the crashing function with siglongjmp. The main difference is in what happens when the signal handler is invoked. In the previous implementation, it would resume from right before calling the crashing function, and then skip that call based on the setjmp return value. In the imported implementation from dav1d, we return to right before the check_func() call, which will skip testing the current function (as the pointer is the same as it was before). Other differences are: - Support for other signal handling mechanisms (Windows AddVectoredExceptionHandler) - Using RtlCaptureContext/RtlRestoreContext instead of setjmp/longjmp on Windows with SEH (which adds the design limitation that it doesn't return a value like setjmp does) - Only catching signals once per function - if more than one signal is delivered before signal handling is reenabled, any signal is handled as it would without our handler - Not using an arch specific signal handler written in assembly --- v2: Updated with dav1d changes from https://code.videolan.org/videolan/dav1d/-/merge_requests/1577: - Remodel checkasm_save_context() to return an integer, like setjmp - Don't call checkasm_fail_func within the signal handler - Make the flag catch_signals a volatile sig_atomic_t - Use sigsetjmp/siglongjmp on Unix platforms - Use SA_RESETHAND and call sigaction when the signal is handled to set up a new handler for later signals - Keep using strsignal on __GLIBC__ --- tests/checkasm/checkasm.c | 96 - tests/checkasm/checkasm.h | 89 +++--- tests/checkasm/riscv/checkasm.S | 12 - 3 files changed, 153 insertions(+), 44 deletions(-) diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index 09c961f0c7..994d64e96b 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -42,6 +42,11 @@ #include #endif +#if defined(_WIN32) && !defined(SIGBUS) +/* non-standard, use the same value as mingw-w64 */ +#define SIGBUS 10 +#endif + #if HAVE_SETCONSOLETEXTATTRIBUTE && HAVE_GETSTDHANDLE #include #define COLOR_REDFOREGROUND_RED @@ -329,6 +334,7 @@ static struct { const char *cpu_flag_name; const char *test_name; int verbose; +volatile sig_atomic_t catch_signals; } state; /* PRNG state */ @@ -630,6 +636,61 @@ static CheckasmFunc *get_func(CheckasmFunc **root, const char *name) return f; } +checkasm_context checkasm_context_buf; + +/* Crash handling: attempt to catch crashes and handle them + * gracefully instead of just aborting abruptly. */ +#ifdef _WIN32 +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +static LONG NTAPI signal_handler(EXCEPTION_POINTERS *e) { +int s; + +if (!state.catch_signals) +return EXCEPTION_CONTINUE_SEARCH; + +switch (e->ExceptionRecord->ExceptionCode) { +case EXCEPTION_FLT_DIVIDE_BY_ZERO: +case EXCEPTION_INT_DIVIDE_BY_ZERO: +s = SIGFPE; +break; +case EXCEPTION_ILLEGAL_INSTRUCTION: +case EXCEPTION_PRIV_INSTRUCTION: +s = SIGILL; +break; +case EXCEPTION_ACCESS_VIOLATION: +case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: +case EXCEPTION_DATATYPE_MISALIGNMENT: +case EXCEPTION_STACK_OVERFLOW: +s = SIGSEGV; +break; +case EXCEPTION_IN_PAGE_ERROR: +s = SIGBUS; +break; +default: +return EXCEPTION_CONTINUE_SEARCH; +} +state.catch_signals = 0; +checkasm_load_context(s); +return EXCEPTION_CONTINUE_EXECUTION; /* never reached, but shuts up gcc */ +} +#endif +#else +static void signal_handler(int s); + +static const struct sigaction signal_handler_act = { +.sa_handler = signal_handler, +.sa_flags = SA_RESETHAND, +}; + +static void signal_handler(int s) { +if (state.catch_signals) { +state.catch_signals = 0; +sigaction(s, &signal_handler_act, NULL); +checkasm_load_context(s); +} +} +#endif + /* Perform tests and benchmarks for the specified cpu flag if supported by the host */ static void check_cpu_flag(const char *name, int flag) { @@ -740,18 +801,20 @@ int main(int argc, char *argv[]) unsigned int seed = av_get_random_seed(); int i, ret = 0; +#ifdef _WIN32 +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +AddVectoredExceptionHandler(0, signal_handler); +#endif +#else +sigaction(SIGBUS, &signal_handler_act, NULL); +
[FFmpeg-devel] [PATCH] avcodec/av1dec: attempt to set SAR even if no hardware decoding is available
Should fix fate failures in avif tests when no external decoder is available. Signed-off-by: James Almer --- libavcodec/av1dec.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index da05a0f039..43b5aef687 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -1227,7 +1227,7 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) av_log(avctx, AV_LOG_ERROR, "Failed to get pixel format.\n"); s->raw_seq = NULL; -goto end; +continue; } } @@ -1248,6 +1248,16 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) case AV1_OBU_FRAME: case AV1_OBU_FRAME_HEADER: if (!s->raw_seq) { +// Attempt to set dimensions in all cases +if (s->pix_fmt == AV_PIX_FMT_NONE) { +ret = update_context_with_frame_header(avctx, &obu->obu.frame.header); +if (ret < 0) { +av_log(avctx, AV_LOG_ERROR, "Failed to update context with frame header\n"); +return ret; +} +ret = AVERROR(ENOSYS); +goto end; +} av_log(avctx, AV_LOG_ERROR, "Missing Sequence Header.\n"); ret = AVERROR_INVALIDDATA; goto end; -- 2.43.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 27/35] avcodec/proresenc_anatoliy: remove TO_GOLOMB2()
On date Monday 2024-01-08 00:00:37 +0100, Clément Bœsch wrote: > On Sun, Dec 24, 2023 at 12:43:32AM +0100, Stefano Sabatini wrote: > > On date Monday 2023-12-11 02:35:28 +0100, Clément Bœsch wrote: > > > A few cosmetics aside, this makes the function identical to the one with > > > the same name in proresenc_kostya. > > > --- > > > libavcodec/proresenc_anatoliy.c | 6 ++ > > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > > > diff --git a/libavcodec/proresenc_anatoliy.c > > > b/libavcodec/proresenc_anatoliy.c > > > index bdf7bface4..aed5c68b1b 100644 > > > --- a/libavcodec/proresenc_anatoliy.c > > > +++ b/libavcodec/proresenc_anatoliy.c > > > @@ -257,7 +257,6 @@ static void encode_vlc_codeword(PutBitContext *pb, > > > unsigned codebook, int val) > > > > > > #define GET_SIGN(x) ((x) >> 31) > > > #define MAKE_CODE(x) (((x) * 2) ^ GET_SIGN(x)) > > > -#define TO_GOLOMB2(val,sign) ((val)==0 ? 0 : ((val) << 1) + (sign)) > > > > > > static av_always_inline int get_level(int val) > > > { > > > @@ -271,7 +270,6 @@ static void encode_dcs(PutBitContext *pb, int16_t > > > *blocks, > > > { > > > int i; > > > int codebook = 5, code, dc, prev_dc, delta, sign, new_sign; > > > -int diff_sign; > > > > > > prev_dc = (blocks[0] - 0x4000) / scale; > > > encode_vlc_codeword(pb, FIRST_DC_CB, MAKE_CODE(prev_dc)); > > > @@ -282,8 +280,8 @@ static void encode_dcs(PutBitContext *pb, int16_t > > > *blocks, > > > dc= (blocks[0] - 0x4000) / scale; > > > delta = dc - prev_dc; > > > new_sign = GET_SIGN(delta); > > > > > -diff_sign = new_sign ^ sign; > > > -code = TO_GOLOMB2(get_level(delta), diff_sign); > > > +delta = (delta ^ sign) - sign; > > > +code = MAKE_CODE(delta); > > > > These don't look equivalent, > > > > MAKE_CODE((delta ^ sign) - sign) is equivalent to > > TO_GOLOMB2(get_level(delta), sign) > > > > not to > > TO_GOLOMB2(get_level(delta), diff_sign) > > OK so this one is a bit tricky. > > Let's start from the specs, which states that the signed integer to symbol > (code) mapping should be: > > 2|n|if n>=0 > 2|n|-1 if n<0 > > We also know that n>>31 is -1 if n < 0, and 0 if n>=0, which means the > above condition can be simplified to: > > 2|n| + (n>>31) > > With prores_aw we have: > > s = -1 if different sign, 0 otherwise > 2|n| + s > > Because: > - get_level() is an absolute function¹ > - the val==0 case doesn't matter because in this case s will also be 0 > > In prores_ks we have: > > n'=-n if different sign, n otherwise > (2n')^sign(n') <=> 2|n'|-(n'>>31) > > So basically, aw does use the comparison with the previous delta and > encodes it accordingly, while ks decides to swap the sign of n according > to that previous delta, then encode it using its new sign. > > I wouldn't mind a third pair of eyes on the matter, but these look > equivalent to me. > > Note that in practice I also tried to encode a bunch of frames from > testsrc2 with and without the patch, and they are bit identical. Thanks for the detailed explanation, I think it's safe to push especially considering that there are no output changes. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] web/index: fix invalid line-break (BR) tags
On date Monday 2024-01-08 15:13:18 -0600, Marth64 wrote: > Signed-off-by: Marth64 > --- > src/index | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/src/index b/src/index > index 98cc516..a949270 100644 > --- a/src/index > +++ b/src/index > @@ -113,11 +113,11 @@ > > > Internally, we have had a number of changes too. The FFT, MDCT, DCT and > DST implementation used for codecs > -and filters has been fully replaced with the faster libavutil/tx (full > article about it coming soon). > -This also led to a reduction in the the size of the compiled binary, > which can be noticeable in small builds. > +and filters has been fully replaced with the faster libavutil/tx (full > article about it coming soon). Check this: https://stackoverflow.com/questions/1946426/html-5-is-it-br-br-or-br >From the HTML specs: |[Void elements] are forbidden from containing any content at all. In |HTML, these elements have a start tag only. The self-closing tag |syntax may be used. The end tag must be omitted because the element is |automatically closed by the parser. Therefore the most correct form should be . In practice, I think this should make no difference since browsers deal with that. For consistency, it might be good to convert everything to though. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] web/index: fix dangling/improper paragraph (P) tag
On date Monday 2024-01-08 15:14:27 -0600, Marth64 wrote: > --- > src/index | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/index b/src/index > index a949270..1d74e8c 100644 > --- a/src/index > +++ b/src/index > @@ -147,7 +147,7 @@ > The functionality will be included in stable branches with the release > of version 6.1, due > to be released soon. > > - > + probably it was meant to be: text text ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] web/index: fix dangling/improper paragraph (P) tag (2)
On date Monday 2024-01-08 15:17:25 -0600, Marth64 wrote: > Signed-off-by: Marth64 > --- > src/index | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/index b/src/index > index 1d74e8c..4b01f55 100644 > --- a/src/index > +++ b/src/index > @@ -146,7 +146,7 @@ > href="https://git.videolan.org/?p=ffmpeg.git;a=summary";>repository is > required. > The functionality will be included in stable branches with the release > of version 6.1, due > to be released soon. > - > + LGTM (but I don't think I have write access to the web repo). ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] web/index: fix dangling/improper paragraph (P) tag
Yup, when combined with the (2) version of this same patch, both should be addressed. Next time will combine in one patch. Thanks! On Tue, Jan 9, 2024 at 5:32 PM Stefano Sabatini wrote: > On date Monday 2024-01-08 15:14:27 -0600, Marth64 wrote: > > --- > > src/index | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/src/index b/src/index > > index a949270..1d74e8c 100644 > > --- a/src/index > > +++ b/src/index > > @@ -147,7 +147,7 @@ > > The functionality will be included in stable branches with the > release of version 6.1, due > > to be released soon. > > > > > - > > + > > probably it was meant to be: > > text > > > text > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] web/index: fix invalid line-break (BR) tags
I am good with that, will update. I am used to XHTML so did that style. Either way I just wanted to fix the truly invalid ones (). Thank you! On Tue, Jan 9, 2024 at 5:30 PM Stefano Sabatini wrote: > On date Monday 2024-01-08 15:13:18 -0600, Marth64 wrote: > > Signed-off-by: Marth64 > > --- > > src/index | 14 +++--- > > 1 file changed, 7 insertions(+), 7 deletions(-) > > > > diff --git a/src/index b/src/index > > index 98cc516..a949270 100644 > > --- a/src/index > > +++ b/src/index > > @@ -113,11 +113,11 @@ > > > > > > Internally, we have had a number of changes too. The FFT, MDCT, DCT > and DST implementation used for codecs > > -and filters has been fully replaced with the faster libavutil/tx > (full article about it coming soon). > > -This also led to a reduction in the the size of the compiled > binary, which can be noticeable in small builds. > > > +and filters has been fully replaced with the faster libavutil/tx > (full article about it coming soon). > > Check this: > https://stackoverflow.com/questions/1946426/html-5-is-it-br-br-or-br > > From the HTML specs: > |[Void elements] are forbidden from containing any content at all. In > |HTML, these elements have a start tag only. The self-closing tag > |syntax may be used. The end tag must be omitted because the element is > |automatically closed by the parser. > > Therefore the most correct form should be . > > In practice, I think this should make no difference since browsers > deal with that. > > For consistency, it might be good to convert everything to > though. > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] web/index: fix unclosed SMALL tag
On date Monday 2024-01-08 15:22:17 -0600, Marth64 wrote: > Signed-off-by: Marth64 > --- > src/template_footer1 | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/template_footer1 b/src/template_footer1 > index 4fce551..6722421 100644 > --- a/src/template_footer1 > +++ b/src/template_footer1 > @@ -1,5 +1,5 @@ > > - Hosting provided by href="https://telepoint.bg";>telepoint.bg > + Hosting provided by href="https://telepoint.bg";>telepoint.bg LGTM (but I confirm I have no write access to ffmpeg-web), thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2 0/3] Fix some active sequences in subtitles
On Thu, Dec 28, 2023 at 01:55:02 +0100, Oneric wrote: > On Sun, Dec 10, 2023 at 17:37:12 +0100, Oneric wrote: > > Changes from v1: > > - ff_ass_bprint_text_event now only inserts a word-joiner > >if there isn’t already one anyway > > - added a third commit improving the handling of > >curly brackets for standard ASS renderers > > > > ping ping #2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/2 v2] avformat/mov: improve HEIF parsing
Parse iprp and iinf boxes and children boxes to get the actual codec used (AV1 for avif, HEVC for heic), and properly export extradata and other properties in a generic way. The reference files for the avif tests are updated as the extradata is now exported. Based on a patch by Swaraj Hota. Co-authored-by: Swaraj Hota Signed-off-by: James Almer --- libavformat/isom.h| 19 +- libavformat/mov.c | 292 +- .../fate/mov-avif-demux-still-image-1-item| 2 +- .../mov-avif-demux-still-image-multiple-items | 2 +- 4 files changed, 228 insertions(+), 87 deletions(-) diff --git a/libavformat/isom.h b/libavformat/isom.h index 90c4fb5530..f397b3697f 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -262,12 +262,22 @@ typedef struct MOVStreamContext { } cenc; } MOVStreamContext; +typedef struct HEIFItem { +AVStream *st; +int item_id; +int extent_length; +int64_t extent_offset; +int64_t size; +int type; +} HEIFItem; + typedef struct MOVContext { const AVClass *class; ///< class for private options AVFormatContext *fc; int time_scale; int64_t duration; ///< duration of the longest track int found_moov; ///< 'moov' atom has been found +int found_iloc; ///< 'iloc' atom has been found int found_mdat; ///< 'mdat' atom has been found int found_hdlr_mdta; ///< 'hdlr' atom with type 'mdta' has been found int trak_index; ///< Index of the current 'trak' @@ -321,14 +331,9 @@ typedef struct MOVContext { uint32_t max_stts_delta; int is_still_picture_avif; int primary_item_id; -struct { -int item_id; -int extent_length; -int64_t extent_offset; -} *heif_info; +int cur_item_id; +HEIFItem *heif_info; int heif_info_size; -int64_t hvcC_offset; -int hvcC_size; int interleaved_read; } MOVContext; diff --git a/libavformat/mov.c b/libavformat/mov.c index 12e82c66a9..0a8d752e03 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1233,8 +1233,6 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom) c->isom = 1; av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: %.4s\n",(char *)&type); av_dict_set(&c->fc->metadata, "major_brand", type, 0); -c->is_still_picture_avif = !strncmp(type, "avif", 4) || - !strncmp(type, "mif1", 4); minor_ver = avio_rb32(pb); /* minor version */ av_dict_set_int(&c->fc->metadata, "minor_version", minor_ver, 0); @@ -4641,10 +4639,6 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom) MOVStreamContext *sc; int ret; -if (c->is_still_picture_avif) { -return AVERROR_INVALIDDATA; -} - st = avformat_new_stream(c->fc, NULL); if (!st) return AVERROR(ENOMEM); st->id = -1; @@ -4916,20 +4910,13 @@ static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom) return ret; } -static int heif_add_stream(MOVContext *c, int item_id) +static int heif_add_stream(MOVContext *c, HEIFItem *item) { MOVStreamContext *sc; AVStream *st; -int item_index = -1; + if (c->fc->nb_streams) return AVERROR_INVALIDDATA; -for (int i = 0; i < c->heif_info_size; i++) -if (c->heif_info[i].item_id == item_id) { -item_index = i; -break; -} -if (item_index < 0) -return AVERROR_INVALIDDATA; st = avformat_new_stream(c->fc, NULL); if (!st) return AVERROR(ENOMEM); @@ -4938,22 +4925,10 @@ static int heif_add_stream(MOVContext *c, int item_id) if (!sc) return AVERROR(ENOMEM); +item->st = st; st->priv_data = sc; st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; -st->codecpar->codec_id = AV_CODEC_ID_AV1; -if (c->hvcC_offset >= 0) { -int ret; -int64_t pos = avio_tell(c->fc->pb); -st->codecpar->codec_id = AV_CODEC_ID_HEVC; -if (avio_seek(c->fc->pb, c->hvcC_offset, SEEK_SET) != c->hvcC_offset) { -av_log(c->fc, AV_LOG_ERROR, "Failed to seek to hvcC data.\n"); -return AVERROR_UNKNOWN; -} -ret = ff_get_extradata(c->fc, st->codecpar, c->fc->pb, c->hvcC_size); -if (ret < 0) -return ret; -avio_seek(c->fc->pb, pos, SEEK_SET); -} +st->codecpar->codec_id = mov_codec_id(st, item->type); sc->ffindex = st->index; c->trak_index = st->index; st->avg_frame_rate.num = st->avg_frame_rate.den = 1; @@ -4987,17 +4962,12 @@ static int heif_add_stream(MOVContext *c, int item_id) sc->stts_data[0].count = 1; // Not used for still images. But needed by mov_build_index. sc->stts_data[0].duration = 0; -sc->sample_sizes[0] = c->heif_info[item_index].extent_length; -sc->chunk_offsets[0] = c->heif_info[item_index].extent_offset; -mov_build_index(c, st); return 0
Re: [FFmpeg-devel] [PATCH] web/index: fix dangling/improper paragraph (P) tag (2)
On Wed, Jan 10, 2024 at 12:33:28AM +0100, Stefano Sabatini wrote: > On date Monday 2024-01-08 15:17:25 -0600, Marth64 wrote: > > Signed-off-by: Marth64 > > --- > > src/index | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/src/index b/src/index > > index 1d74e8c..4b01f55 100644 > > --- a/src/index > > +++ b/src/index > > @@ -146,7 +146,7 @@ > > > href="https://git.videolan.org/?p=ffmpeg.git;a=summary";>repository is > > required. > > The functionality will be included in stable branches with the release > > of version 6.1, due > > to be released soon. > > - > > + > > LGTM (but I don't think I have write access to the web repo). You should have access, i even see commits from you in the past: commit 5eb77b8499027e943539cd03985b8f79e9fcedcb Author: Stefano Sabatini AuthorDate: Wed Aug 12 16:07:44 2015 +0200 Commit: Stefano Sabatini CommitDate: Wed Aug 12 16:07:44 2015 +0200 web/index: use "audio" and "video" in place of "audios" and "videos" [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The worst form of inequality is to try to make unequal things equal. -- Aristotle signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] web/index: fix unclosed SMALL tag
On Wed, Jan 10, 2024 at 12:43:13AM +0100, Stefano Sabatini wrote: > On date Monday 2024-01-08 15:22:17 -0600, Marth64 wrote: > > Signed-off-by: Marth64 > > --- > > src/template_footer1 | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/src/template_footer1 b/src/template_footer1 > > index 4fce551..6722421 100644 > > --- a/src/template_footer1 > > +++ b/src/template_footer1 > > @@ -1,5 +1,5 @@ > > > > - Hosting provided by > href="https://telepoint.bg";>telepoint.bg > > + Hosting provided by > href="https://telepoint.bg";>telepoint.bg > > LGTM (but I confirm I have no write access to ffmpeg-web), thanks. are you using ? g...@ffmpeg.org:ffmpeg-web thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have often repented speaking, but never of holding my tongue. -- Xenocrates signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/av1dec: attempt to set SAR even if no hardware decoding is available
James Almer: > Should fix fate failures in avif tests when no external decoder is > available. > > Signed-off-by: James Almer > --- > libavcodec/av1dec.c | 12 +++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c > index da05a0f039..43b5aef687 100644 > --- a/libavcodec/av1dec.c > +++ b/libavcodec/av1dec.c > @@ -1227,7 +1227,7 @@ static int av1_receive_frame_internal(AVCodecContext > *avctx, AVFrame *frame) > av_log(avctx, AV_LOG_ERROR, > "Failed to get pixel format.\n"); > s->raw_seq = NULL; > -goto end; > +continue; > } > } > > @@ -1248,6 +1248,16 @@ static int av1_receive_frame_internal(AVCodecContext > *avctx, AVFrame *frame) > case AV1_OBU_FRAME: > case AV1_OBU_FRAME_HEADER: > if (!s->raw_seq) { > +// Attempt to set dimensions in all cases > +if (s->pix_fmt == AV_PIX_FMT_NONE) { > +ret = update_context_with_frame_header(avctx, > &obu->obu.frame.header); > +if (ret < 0) { > +av_log(avctx, AV_LOG_ERROR, "Failed to update > context with frame header\n"); > +return ret; > +} > +ret = AVERROR(ENOSYS); > +goto end; > +} > av_log(avctx, AV_LOG_ERROR, "Missing Sequence Header.\n"); > ret = AVERROR_INVALIDDATA; > goto end; You should instead implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM for this decoder so that one does not get a wall of error logs when probing without proper hardware. - Andreas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avcodec/av1dec: attempt to set SAR even if no hardware decoding is available
On 1/9/2024 11:30 PM, Andreas Rheinhardt wrote: James Almer: Should fix fate failures in avif tests when no external decoder is available. Signed-off-by: James Almer --- libavcodec/av1dec.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index da05a0f039..43b5aef687 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -1227,7 +1227,7 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) av_log(avctx, AV_LOG_ERROR, "Failed to get pixel format.\n"); s->raw_seq = NULL; -goto end; +continue; } } @@ -1248,6 +1248,16 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) case AV1_OBU_FRAME: case AV1_OBU_FRAME_HEADER: if (!s->raw_seq) { +// Attempt to set dimensions in all cases +if (s->pix_fmt == AV_PIX_FMT_NONE) { +ret = update_context_with_frame_header(avctx, &obu->obu.frame.header); +if (ret < 0) { +av_log(avctx, AV_LOG_ERROR, "Failed to update context with frame header\n"); +return ret; +} +ret = AVERROR(ENOSYS); +goto end; +} av_log(avctx, AV_LOG_ERROR, "Missing Sequence Header.\n"); ret = AVERROR_INVALIDDATA; goto end; You should instead implement FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM for this decoder so that one does not get a wall of error logs when probing without proper hardware. - Andreas I fixed the problem in a different way already, so this patch can be dropped. I might look at FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM later. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] Hardware purchase request: AVX512-capable laptop
On Sat, Jan 06, 2024 at 06:42:40PM +0100, Michael Niedermayer wrote: > Hi > > On Wed, Jan 03, 2024 at 01:56:12AM +0100, Lynne wrote: > > As some of you know, my laptop died nearly 2 years ago, and > > Why/how did the laptop die ? > is it unrepearable ? ping [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Concerning the gods, I have no means of knowing whether they exist or not or of what sort they may be, because of the obscurity of the subject, and the brevity of human life -- Protagoras signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/4] avcodec/mdec: DC reading for STRv1 is like STRv2
On Tue, Jan 02, 2024 at 02:49:26AM +, aybe aybe wrote: > Hi, > > As I understand, support for .STR files is broken for almost 10 years now > (since 161442ff2c4b0dd8a5072c6bbe6bf55303fffccf it seems). > > Currently, ffmpeg fails with tons of errors like this on version 1 STRs, e.g. > Wipeout 1: > [mdec @ 027c72c0] ac-tex damaged at 1 9 > > What happens is that only the audio is present in the video file. > > Anyway, that one character patch fixes the problem, video is now rendered. > > Signed-off-by: aybe > --- > libavcodec/mdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c > index 44b12471a9..c4904216b8 100644 > --- a/libavcodec/mdec.c > +++ b/libavcodec/mdec.c > @@ -68,7 +68,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, > int16_t *block, int n) > const int qscale = a->qscale; > > /* DC coefficient */ > -if (a->version == 2) { > +if (a->version <= 2) { > block[0] = 2 * get_sbits(&a->gb, 10) + 1024; > } else { > component = (n <= 3 ? 0 : n - 4 + 1); > -- > 2.41.0.windows.1 This is how the patch should look: (there are differencs in the whitespace which git seems to have problems with in above) not sure where these differences came from thx diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 44b12471a9e..c4904216b81 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -68,7 +68,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) const int qscale = a->qscale; /* DC coefficient */ -if (a->version == 2) { +if (a->version <= 2) { block[0] = 2 * get_sbits(&a->gb, 10) + 1024; } else { component = (n <= 3 ? 0 : n - 4 + 1); [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you think the mosad wants you dead since a long time then you are either wrong or dead since a long time. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 1/4] avcodec/mdec: DC reading for STRv1 is like STRv2
On Tue, Jan 02, 2024 at 02:49:26AM +, aybe aybe wrote: > Hi, > > As I understand, support for .STR files is broken for almost 10 years now > (since 161442ff2c4b0dd8a5072c6bbe6bf55303fffccf it seems). > > Currently, ffmpeg fails with tons of errors like this on version 1 STRs, e.g. > Wipeout 1: > [mdec @ 027c72c0] ac-tex damaged at 1 9 where can i find a psxstr file to test this ? the psxstr files i find on https://samples.ffmpeg.org/ seem not affected by this thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are best at talking, realize last or never when they are wrong. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] Hardware purchase request: AVX512-capable laptop
Jan 10, 2024, 03:31 by mich...@niedermayer.cc: > On Sat, Jan 06, 2024 at 06:42:40PM +0100, Michael Niedermayer wrote: > >> Hi >> >> On Wed, Jan 03, 2024 at 01:56:12AM +0100, Lynne wrote: >> > As some of you know, my laptop died nearly 2 years ago, and >> >> Why/how did the laptop die ? >> is it unrepearable ? >> > > ping > It was a 4th gen Thinkpad X1 Carbon. A few drops of water got in between the caps lock before I noticed, by the time I did, it was too late. Battery circuitry is dead so it only runs on AC, frequency controller is dying so it runs at fixed Pentium II 350Mhz speeds, keyboard controller sees keys pressed all the time, touchpad is dead, USB is dead. The motherboard crammed essential components on the periphery and non-essential replaceable components like wifi and 4g modem right next to the CPU, so it was not great engineering. It did live a long life for 7 years, but only the shell remains mostly usable. I may not be able to put it back together as it was, since I lost some screws, as I kept working on it for months. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 4/4] avformat/psxstr: basic FPS detection instead of fixed value
On Tue, Jan 02, 2024 at 03:14:19AM +, aybe aybe wrote: > This fourth and last patch is an attempt at removing the hard-coded value of > 15 FPS. > > In patch 1/4, although it would render video, the audio and video were not > synchronized at all, now there are. > > In this approach I kept it simple, grab min/max possible rates, pick min, > clamp to 15/30 just in case. > > It appears to work quite well, the right frame rate is picked up and both > streams are in sync. > > (tested against Wipeout introduction for both PAL and NTSC versions). > > > Besides, there have been significant findings over the years regarding that > format, specifically: > https://problemkaputt.de/psxspx-macroblock-decoder-mdec.htm > https://github.com/m35/jpsxdec/blob/readme/jpsxdec/PlayStation1_STR_format.txt > > Maybe someone versed in this topic (I'm not) could further improve support of > this format according these docs... > > > > Signed-off-by: aybe > --- > libavformat/psxstr.c | 27 +-- > 1 file changed, 25 insertions(+), 2 deletions(-) > > diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c > index 306a690f52..98897acde3 100644 > --- a/libavformat/psxstr.c > +++ b/libavformat/psxstr.c > @@ -52,6 +52,9 @@ > > #define STR_MAGIC (0x80010160) > > +#define MDEC_STR_FPS_MIN 15 > +#define MDEC_STR_FPS_MAX 30 > + > typedef struct StrChannel { > /* video parameters */ > int video_stream_index; > @@ -65,6 +68,10 @@ typedef struct StrDemuxContext { > > /* a STR file can contain up to 32 channels of data */ > StrChannel channels[32]; > +/* trivial FPS detection based on sectors per frame */ > +int fps_min; /* slowest FPS found */ > +int fps_max; /* fastest FPS found */ > +int fps_val; /* nominal FPS value */ > } StrDemuxContext; > > static const uint8_t sync_header[12] = > {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00}; > @@ -150,6 +157,10 @@ static int str_read_header(AVFormatContext *s) > str->channels[i].audio_stream_index= -1; > } > > +str->fps_min = INT_MAX; > +str->fps_max = INT_MIN; > +str->fps_val = 0; > + > s->ctx_flags |= AVFMTCTX_NOHEADER; > > return 0; > @@ -161,7 +172,7 @@ static int str_read_packet(AVFormatContext *s, > AVIOContext *pb = s->pb; > StrDemuxContext *str = s->priv_data; > unsigned char sector[RAW_CD_SECTOR_SIZE]; > -int channel, ret; > +int channel, ret, sub_mode, idx_sect, num_sect; > AVPacket *pkt; > AVStream *st; > > @@ -178,6 +189,18 @@ static int str_read_packet(AVFormatContext *s, > if (channel >= 32) > return AVERROR_INVALIDDATA; > > +sub_mode = sector[0x12]; > +idx_sect = AV_RL16(§or[0x1C]); > +num_sect = AV_RL16(§or[0x1E]); > + > +/* compute FPS from sector count @ each new video frame */ > +if (sub_mode & 0x02 && idx_sect == 0x00) { > +int fps = 150 / num_sect; > +str->fps_min = FFMIN(str->fps_min, fps); > +str->fps_max = FFMAX(str->fps_max, fps); > +str->fps_val = FFMIN(MDEC_STR_FPS_MAX, FFMAX(MDEC_STR_FPS_MIN, > str->fps_min)); > +} > + > switch (sector[0x12] & CDXA_TYPE_MASK) { > > case CDXA_TYPE_DATA: > @@ -200,7 +223,7 @@ static int str_read_packet(AVFormatContext *s, > st = avformat_new_stream(s, NULL); > if (!st) > return AVERROR(ENOMEM); > -avpriv_set_pts_info(st, 64, 1, 15); > +avpriv_set_pts_info(st, 64, 1, str->fps_val); This is not a FPS value, avpriv_set_pts_info() sets the timebase in which timestamps are specified I dont know psxstr but can you explain what information there is in it about the video frames ? is there some sort of information that indicates when a frame is to be displayed ? that is like a timestamp ? thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Elect your leaders based on what they did after the last election, not based on what they say before an election. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 4/4] fate: add raw IAMF tests
On Sun, Jan 07, 2024 at 06:31:00PM -0300, James Almer wrote: > Covers muxing from raw pcm audio input into FLAC, using several scalable > layouts, > and demuxing the result. > > Signed-off-by: James Almer > --- > tests/Makefile | 7 +- > tests/fate/iamf.mak| 31 ++ > tests/filtergraphs/iamf_5_1| 4 + > tests/filtergraphs/iamf_5_1_2 | 5 + > tests/filtergraphs/iamf_5_1_4 | 6 ++ > tests/filtergraphs/iamf_7_1_4 | 7 ++ > tests/ref/fate/iamf-5_1_4 | 98 ++ > tests/ref/fate/iamf-7_1_4 | 114 + > tests/ref/fate/iamf-stereo | 18 > tests/streamgroups/audio_element-5_1_4 | 7 ++ > tests/streamgroups/audio_element-7_1_4 | 6 ++ > tests/streamgroups/audio_element-stereo| 3 + > tests/streamgroups/mix_presentation-5_1_4 | 2 + > tests/streamgroups/mix_presentation-7_1_4 | 2 + > tests/streamgroups/mix_presentation-stereo | 3 + > 15 files changed, 312 insertions(+), 1 deletion(-) > create mode 100644 tests/fate/iamf.mak > create mode 100644 tests/filtergraphs/iamf_5_1 > create mode 100644 tests/filtergraphs/iamf_5_1_2 > create mode 100644 tests/filtergraphs/iamf_5_1_4 > create mode 100644 tests/filtergraphs/iamf_7_1_4 > create mode 100644 tests/ref/fate/iamf-5_1_4 > create mode 100644 tests/ref/fate/iamf-7_1_4 > create mode 100644 tests/ref/fate/iamf-stereo > create mode 100644 tests/streamgroups/audio_element-5_1_4 > create mode 100644 tests/streamgroups/audio_element-7_1_4 > create mode 100644 tests/streamgroups/audio_element-stereo > create mode 100644 tests/streamgroups/mix_presentation-5_1_4 > create mode 100644 tests/streamgroups/mix_presentation-7_1_4 > create mode 100644 tests/streamgroups/mix_presentation-stereo Iam probably missing some dependancies but, reporting anyway this fails fate: [aist#0:0/pcm_s16le @ 0x5645f5820680] Guessed Channel Layout: stereo Input #0, wav, from 'ffmpeg/tests/data/asynth-44100-2.wav': Duration: 00:00:06.00, bitrate: 1411 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s [in#0/wav @ 0x5645f5812400] Codec AVOption idct (select IDCT implementation) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some decoder which was not actually used for any stream. [out#0/iamf @ 0x5645f585af80] Codec AVOption dct (DCT algorithm) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream. [out#0/iamf @ 0x5645f585af80] Codec AVOption idct (select IDCT implementation) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream. [out#0/iamf @ 0x5645f585af80] Invalid or missing stream group index in submix element specification "stg=0:parameter_id=100:headphones_rendering_mode=stereo:annotations=en-us=Scalable_Submix" Error opening output file ffmpeg/tests/data/fate/iamf-stereo.iamf. Error opening output files: Invalid argument threads=1 tests/Makefile:317: recipe for target 'fate-iamf-stereo' failed make: *** [fate-iamf-stereo] Error 234 thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Its not that you shouldnt use gotos but rather that you should write readable code and code with gotos often but not always is less readable signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".