Re: [FFmpeg-devel] FFmpeg patch to add idr_interval option to libavcodec/qsvenc_mpeg2.c
On Tue, 2022-06-28 at 15:26 +, Greg Stewart wrote: > Hello, > > Please find attached a base64 encoded patch. This patch exposes the > "idr_interval" option to the mpeg2_qsv encoder (libavcodec/qsvenc_mpeg2.c) > identically to how was done for the h264_qsv encoder > (libavcodec/qsvenc_h264.c). For mpeg2, `IdrInterval` in the SDK defines the sequence header interval, not IDR frame interval [1]. Could you update the help string for this option and add a description about this option in mpeg2_qsv section in encoders.texi ? [1] https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxinfomfx Thanks Haihao > > Thank you, > > Greg Stewart > greg.stew...@edisen.com > ___ > 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 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/7] avcodec/iff: Split extract_header into extradata and packet part
183132872a1d8bc8a32e7fd8f994fa2f1b2d6bfc made the iff demuxer output extradata and made the decoder parse said extradata. To make this extradata extensible, it came with its own internal length field (containing the offset of the palette at the end of the extradata). Furthermore, in order to support mid-stream extradata changes, the packets returned by the demuxer also have such a length field (containing the offset of the actual packet data). Therefore the packet parsing the extradata accepted its input from both AVPackets as well as from ordinary extradata. Yet the demuxer never made use of this "feature": The packet's length field always indicated that the packet data starts immediately after the length field. Later, commit cb928fc448f9566e6f6c28d53fa4c2388e732a2b stopped appending the length field to the packets' data; of course, it also stopped searching for extradata in this data. Instead it added code to parse the packet's header to the function that parses extradata. This made this function consist of two disjoint parts, one of which is only reachable if this function is called from init (when parsing extradata) and one of which is reachable when parsing packet headers. Therefore this commit splits this function into two. Signed-off-by: Andreas Rheinhardt --- Btw: Both of these commits broke API/ABI. libavcodec/iff.c | 116 +-- 1 file changed, 61 insertions(+), 55 deletions(-) diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 74ebddc621..4abbed8dfb 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -199,11 +199,9 @@ static int cmap_read_palette(AVCodecContext *avctx, uint32_t *pal) * decoder structures. * * @param avctx the AVCodecContext where to extract extra context to - * @param avpkt the AVPacket to extract extra context from or NULL to use avctx * @return >= 0 in case of success, a negative error code otherwise */ -static int extract_header(AVCodecContext *const avctx, - const AVPacket *const avpkt) +static int extract_header(AVCodecContext *const avctx) { IffContext *s = avctx->priv_data; const uint8_t *buf; @@ -216,55 +214,6 @@ static int extract_header(AVCodecContext *const avctx, } palette_size = avctx->extradata_size - AV_RB16(avctx->extradata); -if (avpkt && avctx->codec_tag == MKTAG('A', 'N', 'I', 'M')) { -uint32_t chunk_id; -uint64_t data_size; -GetByteContext *gb = &s->gb; - -bytestream2_skip(gb, 4); -while (bytestream2_get_bytes_left(gb) >= 1) { -chunk_id = bytestream2_get_le32(gb); -data_size = bytestream2_get_be32(gb); - -if (chunk_id == MKTAG('B', 'M', 'H', 'D')) { -bytestream2_skip(gb, data_size + (data_size & 1)); -} else if (chunk_id == MKTAG('A', 'N', 'H', 'D')) { -unsigned extra; -if (data_size < 40) -return AVERROR_INVALIDDATA; - -s->compression = (bytestream2_get_byte(gb) << 8) | (s->compression & 0xFF); -bytestream2_skip(gb, 19); -extra = bytestream2_get_be32(gb); -s->is_short = !(extra & 1); -s->is_brush = extra == 2; -s->is_interlaced = !!(extra & 0x40); -data_size -= 24; -bytestream2_skip(gb, data_size + (data_size & 1)); -} else if (chunk_id == MKTAG('D', 'L', 'T', 'A') || - chunk_id == MKTAG('B', 'O', 'D', 'Y')) { -if (chunk_id == MKTAG('B','O','D','Y')) -s->compression &= 0xFF; -break; -} else if (chunk_id == MKTAG('C', 'M', 'A', 'P')) { -int count = data_size / 3; -uint32_t *pal = s->pal; - -if (count > 256) -return AVERROR_INVALIDDATA; -if (s->ham) { -for (i = 0; i < count; i++) -pal[i] = 0xFF00 | bytestream2_get_le24(gb); -} else { -for (i = 0; i < count; i++) -pal[i] = 0xFF00 | bytestream2_get_be24(gb); -} -bytestream2_skip(gb, data_size & 1); -} else { -bytestream2_skip(gb, data_size + (data_size&1)); -} -} -} else if (!avpkt) { buf = avctx->extradata; buf_size = bytestream_get_be16(&buf); if (buf_size <= 1 || palette_size < 0) { @@ -273,7 +222,6 @@ static int extract_header(AVCodecContext *const avctx, buf_size, palette_size); return AVERROR_INVALIDDATA; } -} if (buf_size >= 41) { s->compression = bytestream_get_byte(&buf); @@ -449,7 +397,7 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } -if ((err = extract_header(avctx, NULL)) < 0) +i
[FFmpeg-devel] [PATCH 2/7] avcodec/iff: Avoid redundant frees
This code is only called once during init, so none of the buffers here have been allocated already. Signed-off-by: Andreas Rheinhardt --- libavcodec/iff.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 4abbed8dfb..f14644471b 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -246,8 +246,6 @@ static int extract_header(AVCodecContext *const avctx) if (s->masking == MASK_HAS_MASK) { if (s->bpp >= 8 && !s->ham) { avctx->pix_fmt = AV_PIX_FMT_RGB32; -av_freep(&s->mask_buf); -av_freep(&s->mask_palbuf); if (s->bpp > 16) { av_log(avctx, AV_LOG_ERROR, "bpp %d too large for palette\n", s->bpp); return AVERROR(ENOMEM); @@ -256,10 +254,8 @@ static int extract_header(AVCodecContext *const avctx) if (!s->mask_buf) return AVERROR(ENOMEM); s->mask_palbuf = av_malloc((2 << s->bpp) * sizeof(uint32_t) + AV_INPUT_BUFFER_PADDING_SIZE); -if (!s->mask_palbuf) { -av_freep(&s->mask_buf); +if (!s->mask_palbuf) return AVERROR(ENOMEM); -} } s->bpp++; } else if (s->masking != MASK_NONE && s->masking != MASK_HAS_TRANSPARENT_COLOR) { @@ -273,9 +269,6 @@ static int extract_header(AVCodecContext *const avctx) if (s->video_size && s->planesize * s->bpp * avctx->height > s->video_size) return AVERROR_INVALIDDATA; -av_freep(&s->ham_buf); -av_freep(&s->ham_palbuf); - if (s->ham) { int i, count = FFMIN(palette_size / 3, 1 << s->ham); int ham_count; @@ -291,10 +284,8 @@ static int extract_header(AVCodecContext *const avctx) ham_count = 8 * (1 << s->ham); s->ham_palbuf = av_malloc(extra_space * (ham_count << !!(s->masking == MASK_HAS_MASK)) * sizeof (uint32_t) + AV_INPUT_BUFFER_PADDING_SIZE); -if (!s->ham_palbuf) { -av_freep(&s->ham_buf); +if (!s->ham_palbuf) return AVERROR(ENOMEM); -} if (count) { // HAM with color palette attached // prefill with black and palette and set HAM take direct value mask to zero -- 2.34.1 ___ 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 3/7] avcodec/iff: Return early when possible
It allows to save one level of indentation. Signed-off-by: Andreas Rheinhardt --- libavcodec/iff.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libavcodec/iff.c b/libavcodec/iff.c index f14644471b..13912e9133 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -223,7 +223,9 @@ static int extract_header(AVCodecContext *const avctx) return AVERROR_INVALIDDATA; } -if (buf_size >= 41) { +if (buf_size < 41) +return 0; + s->compression = bytestream_get_byte(&buf); s->bpp = bytestream_get_byte(&buf); s->ham = bytestream_get_byte(&buf); @@ -316,7 +318,6 @@ static int extract_header(AVCodecContext *const avctx) s->ham_palbuf[(1 << s->bpp) + i] = s->ham_palbuf[i] | 0xFF00; } } -} return 0; } @@ -1470,10 +1471,12 @@ static int parse_packet_header(AVCodecContext *const avctx, IffContext *s = avctx->priv_data; int i; -if (avctx->codec_tag == MKTAG('A', 'N', 'I', 'M')) { uint32_t chunk_id; uint64_t data_size; +if (avctx->codec_tag != MKTAG('A', 'N', 'I', 'M')) +return 0; + bytestream2_skip(gb, 4); while (bytestream2_get_bytes_left(gb) >= 1) { chunk_id = bytestream2_get_le32(gb); @@ -1517,7 +1520,6 @@ static int parse_packet_header(AVCodecContext *const avctx, bytestream2_skip(gb, data_size + (data_size&1)); } } -} return 0; } -- 2.34.1 ___ 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 4/7] avcodec/iff: Pass extradata and extradata_size explicitly
This might be useful in case this decoder were changed to support new extradata passed via side-data. Signed-off-by: Andreas Rheinhardt --- libavcodec/iff.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 13912e9133..453e910982 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -201,20 +201,20 @@ static int cmap_read_palette(AVCodecContext *avctx, uint32_t *pal) * @param avctx the AVCodecContext where to extract extra context to * @return >= 0 in case of success, a negative error code otherwise */ -static int extract_header(AVCodecContext *const avctx) +static int extract_header(AVCodecContext *const avctx, + const uint8_t *const extradata, int extradata_size) { IffContext *s = avctx->priv_data; -const uint8_t *buf; +const uint8_t *buf = extradata; unsigned buf_size = 0; int i, palette_size; -if (avctx->extradata_size < 2) { +if (extradata_size < 2) { av_log(avctx, AV_LOG_ERROR, "not enough extradata\n"); return AVERROR_INVALIDDATA; } -palette_size = avctx->extradata_size - AV_RB16(avctx->extradata); +palette_size = extradata_size - AV_RB16(extradata); -buf = avctx->extradata; buf_size = bytestream_get_be16(&buf); if (buf_size <= 1 || palette_size < 0) { av_log(avctx, AV_LOG_ERROR, @@ -274,7 +274,7 @@ static int extract_header(AVCodecContext *const avctx) if (s->ham) { int i, count = FFMIN(palette_size / 3, 1 << s->ham); int ham_count; -const uint8_t *const palette = avctx->extradata + AV_RB16(avctx->extradata); +const uint8_t *const palette = extradata + AV_RB16(extradata); int extra_space = 1; if (avctx->codec_tag == MKTAG('P', 'B', 'M', ' ') && s->ham == 4) @@ -389,7 +389,8 @@ static av_cold int decode_init(AVCodecContext *avctx) return AVERROR(ENOMEM); } -if ((err = extract_header(avctx)) < 0) +err = extract_header(avctx, avctx->extradata, avctx->extradata_size); +if (err < 0) return err; return 0; -- 2.34.1 ___ 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 5/7] avcodec/iff: Reindent after the previous commits
Signed-off-by: Andreas Rheinhardt --- libavcodec/iff.c | 260 +++ 1 file changed, 128 insertions(+), 132 deletions(-) diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 453e910982..00d0105be3 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -207,7 +207,7 @@ static int extract_header(AVCodecContext *const avctx, IffContext *s = avctx->priv_data; const uint8_t *buf = extradata; unsigned buf_size = 0; -int i, palette_size; +int palette_size; if (extradata_size < 2) { av_log(avctx, AV_LOG_ERROR, "not enough extradata\n"); @@ -215,109 +215,109 @@ static int extract_header(AVCodecContext *const avctx, } palette_size = extradata_size - AV_RB16(extradata); -buf_size = bytestream_get_be16(&buf); -if (buf_size <= 1 || palette_size < 0) { -av_log(avctx, AV_LOG_ERROR, - "Invalid palette size received: %u -> palette data offset: %d\n", - buf_size, palette_size); -return AVERROR_INVALIDDATA; -} +buf_size = bytestream_get_be16(&buf); +if (buf_size <= 1 || palette_size < 0) { +av_log(avctx, AV_LOG_ERROR, +"Invalid palette size received: %u -> palette data offset: %d\n", +buf_size, palette_size); +return AVERROR_INVALIDDATA; +} if (buf_size < 41) return 0; -s->compression = bytestream_get_byte(&buf); -s->bpp = bytestream_get_byte(&buf); -s->ham = bytestream_get_byte(&buf); -s->flags= bytestream_get_byte(&buf); -s->transparency = bytestream_get_be16(&buf); -s->masking = bytestream_get_byte(&buf); -for (i = 0; i < 16; i++) -s->tvdc[i] = bytestream_get_be16(&buf); - -if (s->ham) { -if (s->bpp > 8) { -av_log(avctx, AV_LOG_ERROR, "Invalid number of hold bits for HAM: %u\n", s->ham); -return AVERROR_INVALIDDATA; -} else if (s->ham != (s->bpp > 6 ? 6 : 4)) { -av_log(avctx, AV_LOG_ERROR, "Invalid number of hold bits for HAM: %u, BPP: %u\n", s->ham, s->bpp); -return AVERROR_INVALIDDATA; -} +s->compression = bytestream_get_byte(&buf); +s->bpp = bytestream_get_byte(&buf); +s->ham = bytestream_get_byte(&buf); +s->flags= bytestream_get_byte(&buf); +s->transparency = bytestream_get_be16(&buf); +s->masking = bytestream_get_byte(&buf); +for (int i = 0; i < 16; i++) +s->tvdc[i] = bytestream_get_be16(&buf); + +if (s->ham) { +if (s->bpp > 8) { +av_log(avctx, AV_LOG_ERROR, "Invalid number of hold bits for HAM: %u\n", s->ham); +return AVERROR_INVALIDDATA; +} else if (s->ham != (s->bpp > 6 ? 6 : 4)) { +av_log(avctx, AV_LOG_ERROR, "Invalid number of hold bits for HAM: %u, BPP: %u\n", s->ham, s->bpp); +return AVERROR_INVALIDDATA; } +} -if (s->masking == MASK_HAS_MASK) { -if (s->bpp >= 8 && !s->ham) { -avctx->pix_fmt = AV_PIX_FMT_RGB32; -if (s->bpp > 16) { -av_log(avctx, AV_LOG_ERROR, "bpp %d too large for palette\n", s->bpp); -return AVERROR(ENOMEM); -} -s->mask_buf = av_malloc((s->planesize * 32) + AV_INPUT_BUFFER_PADDING_SIZE); -if (!s->mask_buf) -return AVERROR(ENOMEM); -s->mask_palbuf = av_malloc((2 << s->bpp) * sizeof(uint32_t) + AV_INPUT_BUFFER_PADDING_SIZE); -if (!s->mask_palbuf) -return AVERROR(ENOMEM); +if (s->masking == MASK_HAS_MASK) { +if (s->bpp >= 8 && !s->ham) { +avctx->pix_fmt = AV_PIX_FMT_RGB32; +if (s->bpp > 16) { +av_log(avctx, AV_LOG_ERROR, "bpp %d too large for palette\n", s->bpp); +return AVERROR(ENOMEM); } -s->bpp++; -} else if (s->masking != MASK_NONE && s->masking != MASK_HAS_TRANSPARENT_COLOR) { -av_log(avctx, AV_LOG_ERROR, "Masking not supported\n"); -return AVERROR_PATCHWELCOME; -} -if (!s->bpp || s->bpp > 32) { -av_log(avctx, AV_LOG_ERROR, "Invalid number of bitplanes: %u\n", s->bpp); -return AVERROR_INVALIDDATA; +s->mask_buf = av_malloc((s->planesize * 32) + AV_INPUT_BUFFER_PADDING_SIZE); +if (!s->mask_buf) +return AVERROR(ENOMEM); +s->mask_palbuf = av_malloc((2 << s->bpp) * sizeof(uint32_t) + AV_INPUT_BUFFER_PADDING_SIZE); +if (!s->mask_palbuf) +return AVERROR(ENOMEM); } -if (s->video_size && s->planesize * s->bpp * avctx->height > s->video_size) -return AVERROR_INVALIDDATA; +s->bpp++; +} else i
[FFmpeg-devel] [PATCH 6/7] avcodec/iff: Remove transient objects from the context
This avoids keeping invalid pointers in the context. Signed-off-by: Andreas Rheinhardt --- libavcodec/iff.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 00d0105be3..ad96bd9191 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -45,7 +45,6 @@ typedef enum { } mask_type; typedef struct IffContext { -AVFrame *frame; int planesize; uint8_t * planebuf; uint8_t * ham_buf; ///< temporary buffer for planar to chunky conversation @@ -63,7 +62,6 @@ typedef struct IffContext { unsigned masking; ///< TODO: masking method used int init; // 1 if buffer and palette data already initialized, 0 otherwise int16_t tvdc[16]; ///< TVDC lookup table -GetByteContext gb; uint8_t *video[2]; unsigned video_size; uint32_t *pal; @@ -1529,7 +1527,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int buf_size = avpkt->size; const uint8_t *buf_end = buf + buf_size; int y, plane, res; -GetByteContext *gb = &s->gb; +GetByteContext gb0, *const gb = &gb0; const AVPixFmtDescriptor *desc; bytestream2_init(gb, avpkt->data, avpkt->size); @@ -1539,7 +1537,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if ((res = ff_get_buffer(avctx, frame, 0)) < 0) return res; -s->frame = frame; buf += bytestream2_tell(gb); buf_size -= bytestream2_tell(gb); @@ -1558,7 +1555,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, if (s->compression <= 0xff && (avctx->codec_tag == MKTAG('A', 'N', 'I', 'M'))) { if (avctx->pix_fmt == AV_PIX_FMT_PAL8) -memcpy(s->pal, s->frame->data[1], 256 * 4); +memcpy(s->pal, frame->data[1], 256 * 4); } switch (s->compression) { -- 2.34.1 ___ 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 7/7] avcodec/iff: Use unsigned to avoid compiler warning
GCC 12 apparently believes that negative palette sizes are possible (they are not, as this has already been checked during init) and therefore emits a -Wstringop-overflow= for the memcpy. Using unsigned avoids this. (To be honest, there might be a compiler bug involved.) Signed-off-by: Andreas Rheinhardt --- libavcodec/iff.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/iff.c b/libavcodec/iff.c index ad96bd9191..0bc2e3ca21 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -152,9 +152,10 @@ static av_always_inline uint32_t gray2rgb(const uint32_t x) { static int cmap_read_palette(AVCodecContext *avctx, uint32_t *pal) { IffContext *s = avctx->priv_data; -int count, i; +unsigned count, i; const uint8_t *const palette = avctx->extradata + AV_RB16(avctx->extradata); -int palette_size = avctx->extradata_size - AV_RB16(avctx->extradata); +/* extract_header() already checked that the RHS is >= 0. */ +unsigned palette_size = avctx->extradata_size - AV_RB16(avctx->extradata); if (avctx->bits_per_coded_sample > 8) { av_log(avctx, AV_LOG_ERROR, "bits_per_coded_sample > 8 not supported\n"); -- 2.34.1 ___ 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] Error in input
On Tue, Jul 12, 2022, 13:02 Abhishek Gorecha wrote: > Hi, When we try to give rtp stream as input we are not able to process. > Can anyone help us out here > > > > Wrong list. Post on ffmpeg-user. Also provide full details, like this no > one can help you of course ___ 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 1/6] fflcms2: move to libavcodec
On Wed, 06 Jul 2022 16:18:21 +0200 Andreas Rheinhardt wrote: > Niklas Haas: > > From: Niklas Haas > > > > We will need this helper inside libavcodec in the future, so move it > > there, leaving behind an #include to the raw source file in its old > > location in libvfilter. This approach is inspired by the handling of > > vulkan.c, and avoids us needing to expose any of it publicly (or > > semi-publicly) in e.g. libavutil, thus avoiding any ABI headaches. > > This is only correct if you work under the assumption that when building > with static libraries, all the static libraries come from the same > commit. If you e.g. allow to build with an older libavfilter and a newer > libavcodec (like with shared libs), this assumption breaks down: if the > newer version of this file exports another function, you get linker > (ODR) errors because both versions might be pulled in. > Behaviour/signature changes by any function or modifications to any of > the structs would be similarly catastrophic. > > A way out of this mess would be to version everything in the header like so: > #define FFLCMS2_VERSION 1 > > void AV_JOIN(ff_icc_context_uninit, FFLCMS2_VERSION)(FFIccContext *s); > > (of course, there should be a dedicated macro for this to reduce typing.) > > A patch that makes any of the "catastrophic" modifications described > above would need to bump the version. If one uses compatible versions, > the files would be deduplicated for static builds. > It would of course have the downside that these macros would be > everywhere where it is used, not only in fflcms2.[ch]. I suppose you could also version this API on a symbol-by-symbol basis, with v1 being the current version (and then v2 getting a 2 suffix, and so on). In that case, we don't need to do anything currently, rather the first patch to modify this API would have to worry about making sure the new symbol doesn't conflict. > > > > > It's debatable whether the actual code belongs in libavcodec or > > libavfilter, but I decided to put it into libavcodec because it > > conceptually deals with encoding and decoding ICC profiles, and will be > > used to decode embedded ICC profiles in image files. > > > > Signed-off-by: Niklas Haas > > --- > > libavcodec/Makefile | 1 + > > libavcodec/fflcms2.c | 311 ++ > > libavcodec/fflcms2.h | 87 > > libavfilter/fflcms2.c | 294 +-- > > libavfilter/fflcms2.h | 65 + > > 5 files changed, 401 insertions(+), 357 deletions(-) > > create mode 100644 libavcodec/fflcms2.c > > create mode 100644 libavcodec/fflcms2.h > > > > ___ > 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 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 3/8] avutil/mem: Add av_fast_realloc_array()
Andreas Rheinhardt: > From: Andreas Rheinhardt > > This is an array-equivalent of av_fast_realloc(). Its advantages > compared to using av_fast_realloc() for allocating arrays are as > follows: > > a) It performs its own overflow checks for the multiplication that is > implicit in array allocations. (And it only needs to perform these > checks (as well as the multiplication itself) in case the array needs to > be reallocated.) > b) It allows to limit the number of elements to an upper bound given > by the caller. This allows to restrict the number of allocated elements > to fit into an int and therefore makes this function usable with > counters of this type. It can also be used to avoid overflow checks in > the caller: E.g. setting it to UINT_MAX - 1 elements makes it safe to > increase the desired number of elements in steps of one. And it avoids > overallocations in situations where one already has an upper bound. > c) av_fast_realloc_array() will always allocate in multiples of array > elements; no memory is wasted with partial elements. > d) By returning an int, av_fast_realloc_array() can distinguish between > ordinary allocation failures (meriting AVERROR(ENOMEM)) and failures > because of allocation limits (by returning AVERROR(ERANGE)). > e) It is no longer possible for the user to accidentally lose the > pointer by using ptr = av_fast_realloc(ptr, ...). > > Because of e) there is no need to set the number of allocated elements > to zero on failure. > > av_fast_realloc() usually allocates size + size / 16 + 32 bytes if size > bytes are desired and if the already existing buffer isn't big enough. > av_fast_realloc_array() instead allocates nb + (nb + 14) / 16. Rounding > up is done in order not to reallocate in steps of one if the current > number is < 16; adding 14 instead of 15 has the effect of only > allocating one element if one element is desired. This is done with an > eye towards applications where arrays might commonly only contain one > element (as happens with the Matroska CueTrackPositions). > > Which of the two functions allocates faster depends upon the size of > the elements. E.g. if the elements have a size of 32B and the desired > size is incremented in steps of one, allocations happen at > 1, 3, 5, 7, 9, 11, 13, 15, 17, 20, 23, 26 ... for av_fast_realloc(), > 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 21, 24 ... for > av_fast_realloc_array(). For element sizes of 96B, the numbers are > 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 21, 23, 25, 27, 30 ... > for av_fast_realloc() whereas the pattern for av_fast_realloc_array() is > unchanged. > > Signed-off-by: Andreas Rheinhardt > --- > This patch (and some of the other patches of this patchset) > are mostly the same as the one in these threads: > https://ffmpeg.org/pipermail/ffmpeg-devel/2019-December/254836.html > https://ffmpeg.org/pipermail/ffmpeg-devel/2020-January/255182.html > > doc/APIchanges | 3 +++ > libavutil/mem.c | 33 + > libavutil/mem.h | 30 ++ > libavutil/version.h | 2 +- > 4 files changed, 67 insertions(+), 1 deletion(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index 20b944933a..f633ae6fee 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -14,6 +14,9 @@ libavutil: 2021-04-27 > > API changes, most recent first: > > +2022-07-05 - xx - lavu 57.28.100 - mem.h > + Add av_fast_realloc_array() to simplify reallocating of arrays. > + > 2022-06-12 - xx - lavf 59.25.100 - avio.h >Add avio_vprintf(), similar to avio_printf() but allow to use it >from within a function taking a variable argument list as input. > diff --git a/libavutil/mem.c b/libavutil/mem.c > index 18aff5291f..6e3942ae63 100644 > --- a/libavutil/mem.c > +++ b/libavutil/mem.c > @@ -532,6 +532,39 @@ void *av_fast_realloc(void *ptr, unsigned int *size, > size_t min_size) > return ptr; > } > > +int av_fast_realloc_array(void *ptr, size_t *nb_allocated, > + size_t min_nb, size_t max_nb, size_t elsize) > +{ > +void *array; > +size_t nb, max_alloc_size_bytes; > + > +if (min_nb <= *nb_allocated) > +return 0; > + > +max_alloc_size_bytes = atomic_load_explicit(&max_alloc_size, > memory_order_relaxed); > +max_nb = FFMIN(max_nb, max_alloc_size_bytes / elsize); > + > +if (min_nb > max_nb) > +return AVERROR(ERANGE); > + > +nb = min_nb + (min_nb + 14) / 16; > + > +/* If min_nb is so big that the above calculation overflowed, > + * just allocate as much as we are allowed to. */ > +nb = nb < min_nb ? max_nb : FFMIN(nb, max_nb); > + > +memcpy(&array, ptr, sizeof(array)); > + > +array = av_realloc(array, nb * elsize); > +if (!array) > +return AVERROR(ENOMEM); > + > +memcpy(ptr, &array, sizeof(array)); > +*nb_allocated = nb; > + > +return 0; > +} > + > static inline void fast_malloc(void *ptr, unsigned int *size, size_t
[FFmpeg-devel] [PATCH] avfilter/vf_xfade: fixed slideleft/slideright/slideup/slidedown bug
zx and zy comparison were wrong when zx=0 or zy=0. This resulted in the wrong column/row being chosen. This can be seen best when using xfade on streams with transparency. For example: in case of a slideleft transition, the first column from the first input will overwrite the first column of the second stream throught the transition. https://www.youtube.com/shorts/qSMuDSg_K9g Signed-off-by: George Floarea --- libavfilter/vf_xfade.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_xfade.c b/libavfilter/vf_xfade.c index 294928c134..9f66927365 100644 --- a/libavfilter/vf_xfade.c +++ b/libavfilter/vf_xfade.c @@ -433,7 +433,7 @@ static void slideleft##name##_transition(AVFilterContext *ctx, for (int x = 0; x < width; x++) { \ const int zx = z + x; \ const int zz = zx % width + width * (zx < 0); \ -dst[x] = (zx > 0) && (zx < width) ? xf1[zz] : xf0[zz]; \ +dst[x] = (zx >= 0) && (zx < width) ? xf1[zz] : xf0[zz]; \ } \ \ dst += out->linesize[p] / div; \ @@ -466,7 +466,7 @@ static void slideright##name##_transition(AVFilterContext *ctx, for (int x = 0; x < out->width; x++) { \ const int zx = z + x; \ const int zz = zx % width + width * (zx < 0); \ -dst[x] = (zx > 0) && (zx < width) ? xf1[zz] : xf0[zz]; \ +dst[x] = (zx >= 0) && (zx < width) ? xf1[zz] : xf0[zz]; \ } \ \ dst += out->linesize[p] / div; \ @@ -499,7 +499,7 @@ static void slideup##name##_transition(AVFilterContext *ctx, const type *xf1 = (const type *)(b->data[p] + zz * b->linesize[p]); \ \ for (int x = 0; x < out->width; x++) { \ -dst[x] = (zy > 0) && (zy < height) ? xf1[x] : xf0[x]; \ +dst[x] = (zy >= 0) && (zy < height) ? xf1[x] : xf0[x]; \ } \ \ dst += out->linesize[p] / div; \ @@ -530,7 +530,7 @@ static void slidedown##name##_transition(AVFilterContext *ctx, const type *xf1 = (const type *)(b->data[p] + zz * b->linesize[p]); \ \ for (int x = 0; x < out->width; x++) { \ -dst[x] = (zy > 0) && (zy < height) ? xf1[x] : xf0[x]; \ +dst[x] = (zy >= 0) && (zy < height) ? xf1[x] : xf0[x]; \ } \ \ dst += out->linesize[p] / div; \ -- 2.25.1 ___ 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 2/2] avformat/mov: Support parsing of still AVIF Alpha Channel
On Tue, Jul 5, 2022 at 9:54 AM Anton Khirnov wrote: > > Quoting Vignesh Venkatasubramanian (2022-07-02 23:15:35) > > > As for encoding, not fully sure how it should be integrated, if any > > > encoders actually at this moment do proper alpha coding, or do all API > > > clients have to separately encode with one context the primary image, > > > and the alpha with another? > > > > I am not sure about other codecs, but in the case of AVIF/AV1, the > > encoder does not understand/support alpha channels. The only way to do > > it is to use two separate encoders. > > Can this not be handled in our encoder wrapper? > By encoder wrapper, you mean codec wrappers in libavcodec like libaomenc.c right ? Yes, it is possible to do this in the encoder wrapper by keeping multiple instances of the encoder. But each encoder wrapper has to be updated to support it. AV1, for example, has three different encoders that can be used as of today (aom, rav1e and svt-av1). > We should strive as much as possible to shield our callers from > codec-specific implementation details. > > -- > Anton Khirnov > ___ > 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". -- Vignesh ___ 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] Request: make framepool visible externally
Hi all I'm using Libav libraries (version 4.1.6) to make operations on audio/video AVFrame: conversions, decoding, encoding, etc. To improve performances I'd like to use framepool. So I need to include "libavfilter/framepool.h", but I cannot, because this file is not exported. Should be possible to add "framepool.h" to HEADERS in "libavfilter\Makefile" ? Code:"NAME = avfilterDESC = FFmpeg audio/video filtering library HEADERS = avfilter.h \ buffersink.h \ buffersrc.h \ version.h \ framepool.h \ ... " Thank YouMarco Vianini ___ 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] Request: make framepool visible externally
On 12.07.2022 18:28, Marco Vianini wrote: Hi all I'm using Libav libraries (version 4.1.6) to make operations on audio/video AVFrame: conversions, decoding, encoding, etc. That is a really old version, and you should desperately update. To improve performances I'd like to use framepool. So I need to include "libavfilter/framepool.h", but I cannot, because this file is not exported. Should be possible to add "framepool.h" to HEADERS in "libavfilter\Makefile" ? Code:"NAME = avfilterDESC = FFmpeg audio/video filtering library HEADERS = avfilter.h \ buffersink.h \ buffersrc.h \ version.h \ framepool.h framepool.h is not a public header, and contains no publicly exported functions. Even if you got the header, you couldn't use the functions since they're not exported from the library. So no, you can't use any of the stuff in there outside of libavfilter. It's also not in any way stable, so can break its API at any random point. ___ 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] Request: make framepool visible externally
On 7/12/2022 1:28 PM, Marco Vianini wrote: Hi all I'm using Libav libraries (version 4.1.6) to make operations on audio/video AVFrame: conversions, decoding, encoding, etc. To improve performances I'd like to use framepool. So I need to include "libavfilter/framepool.h", but I cannot, because this file is not exported. Should be possible to add "framepool.h" to HEADERS in "libavfilter\Makefile" ? Code:"NAME = avfilterDESC = FFmpeg audio/video filtering library HEADERS = avfilter.h \ buffersink.h \ buffersrc.h \ version.h \ framepool.h \ ... " Thank YouMarco Vianini What you want is to use the bufferpool API in libavutil for your frames. ___ 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] [EXTERNAL] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG.
Hello, Can someone please have a look at this patch request? Thank you in advance. Bryce Bryce Chester Newman | Principal Developer p: +12069255045 | From: Bryce Chester Newman Date: Wednesday, February 2, 2022 at 4:22 PM To: ffmpeg-devel@ffmpeg.org Cc: Bryce Newman , Bryce Newman Subject: [EXTERNAL] [PATCH] [PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG. From: Bryce Chester Newman I need the ability to derive the poster time found in the mvhd, so I can use that value to create a thumbnail from ffmpeg. More details can be found here https://www.mail-archive.com/ffmpeg-user@ffmpeg.org/msg30003.html Signed-off-by: Bryce Chester Newman --- libavformat/mov: Expose Quicktime poster_time value as metadata TAG. I need the ability to derive the poster time found in the mvhd, so I can use that value to create a thumbnail from ffmpeg. More details can be found here https://www.mail-archive.com/ffmpeg-user@ffmpeg.org/msg30003.html Signed-off-by: Bryce Chester Newman bryce.new...@gettyimages.com Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-21%2Fbrycechesternewman%2Fpatch-poster-time-tag-v1 Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-21/brycechesternewman/patch-poster-time-tag-v1 Pull-Request: https://github.com/ffstaging/FFmpeg/pull/21 libavformat/mov.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index a80fcc1606..3d36f6563f 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1487,6 +1487,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) { int i; int64_t creation_time; +int32_t poster_time; int version = avio_r8(pb); /* version */ avio_rb24(pb); /* flags */ @@ -1525,12 +1526,21 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb32(pb); /* preview time */ avio_rb32(pb); /* preview duration */ -avio_rb32(pb); /* poster time */ +poster_time = avio_rb32(pb); /* poster time */ avio_rb32(pb); /* selection time */ avio_rb32(pb); /* selection duration */ avio_rb32(pb); /* current time */ avio_rb32(pb); /* next track ID */ +av_log(c->fc, AV_LOG_TRACE, "poster_time = %i, time_scale = %i\n", poster_time, c->time_scale); +if(poster_time && c->time_scale && c->time_scale > 0) { +char buffer[32]; +float poster_time_location = (float)poster_time / c->time_scale; +snprintf(buffer, sizeof(buffer), "%.2f", poster_time_location); +/* This will appear as a TAG in the format section of FFProbe output using -show_format */ +av_dict_set(&c->fc->metadata, "poster_time", buffer, 0); +} + return 0; } base-commit: 2e82c610553efd69b4d9b6c359423a19c2868255 -- ffmpeg-codebot ___ 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] avformat/mov: h264 cenc entryption file decryption_key failed
On Sat, 9 Jul 2022, Marton Balint wrote: On Sat, 9 Jul 2022, lishuangxi wrote: Please help review it, thanks. You should describe why the old logic of encrypting in 16 byte chunks is uneeded in the commit message. Applied with fixed commit message. Thanks, Marton Code process -- Fixes ticket #9807. -- Fixes ticket #9777. The file in linked in ticket #9807 is still unplayable for me after your patch. As for the other ticket, the reported did not include a sample, so there is no way to know for sure if your patch fixes it. Regards, Marton ___ 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 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 3/3] tools/target_dec_fuzzer: Adjust threshold for ANM
On Mon, Jul 11, 2022 at 11:44:17PM +0200, Michael Niedermayer wrote: > Fixes: Timeout > Fixes: > 48923/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ANM_fuzzer-6391662321991680 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > tools/target_dec_fuzzer.c | 1 + > 1 file changed, 1 insertion(+) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When the tyrant has disposed of foreign enemies by conquest or treaty, and there is nothing more to fear from them, then he is always stirring up some war or other, in order that the people may require a leader. -- Plato 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/ffv1dec_template: Fix indention
On Sun, Jul 03, 2022 at 04:18:08PM +0200, Michael Niedermayer wrote: > Signed-off-by: Michael Niedermayer > --- > libavcodec/ffv1dec_template.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Republics decline into democracies and democracies degenerate into despotisms. -- 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 1/3] tools/target_dec_fuzzer: Adjust threshold for CFHD
On Tue, Jul 05, 2022 at 12:30:32AM +0200, Michael Niedermayer wrote: > Fixes: Timeout > Fixes: > 46504/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-6376835606249472 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > tools/target_dec_fuzzer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato 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 2/3] tools/target_dec_fuzzer: Adjust threshold for MVC2
On Tue, Jul 05, 2022 at 12:30:33AM +0200, Michael Niedermayer wrote: > Fixes: Timeout > Fixes: > 48689/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVC2_fuzzer-6436301427048448 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > tools/target_dec_fuzzer.c | 1 + > 1 file changed, 1 insertion(+) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Democracy is the form of government in which you can choose your dictator 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 3/3] avformat/iff: simplify duration calculation
On Tue, Jul 05, 2022 at 12:30:34AM +0200, Michael Niedermayer wrote: > Fixes: signed integer overflow: 315680096256 * 134215943 cannot be > represented in type 'long long' > Fixes: > 48713/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5886272312311808 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavformat/iff.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Complexity theory is the science of finding the exact solution to an approximation. Benchmarking OTOH is finding an approximation of the exact 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 2/6] tools/target_dec_fuzzer: Adjust threshold for WCMV
On Sun, Jul 03, 2022 at 02:31:48AM +0200, Michael Niedermayer wrote: > Fixes: Timeout > Fixes: > 48377/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5053331682230272 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > tools/target_dec_fuzzer.c | 1 + > 1 file changed, 1 insertion(+) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Opposition brings concord. Out of discord comes the fairest harmony. -- Heraclitus 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 5/6] tools/target_dec_fuzzer: Adjust threshold for ylc
On Sun, Jul 03, 2022 at 02:31:51AM +0200, Michael Niedermayer wrote: > Fixes: timeout > Fixes: > 48523/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_YLC_fuzzer-5779666425741312 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > tools/target_dec_fuzzer.c | 1 + > 1 file changed, 1 insertion(+) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The greatest way to live with honor in this world is to be what we pretend to be. -- Socrates 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 6/6] tools/target_dec_fuzzer: Adjust threshold for LOCO
On Sun, Jul 03, 2022 at 02:31:52AM +0200, Michael Niedermayer wrote: > Fixes: Timeout > Fixes: > 48584/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5741269015461888 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > tools/target_dec_fuzzer.c | 1 + > 1 file changed, 1 insertion(+) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Does the universe only have a finite lifespan? No, its going to go on forever, its just that you wont like living in it. -- Hiranya Peiri 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] avformat/aaxdec: Check for empty segments
On Tue, Jun 28, 2022 at 09:28:30PM +0200, Michael Niedermayer wrote: > On Tue, Jun 28, 2022 at 08:26:54AM -0300, James Almer wrote: > > > > > > On 6/28/2022 2:21 AM, Anton Khirnov wrote: > > > Quoting Michael Niedermayer (2022-06-27 10:43:47) > > > > Fixes: Timeout > > > > Fixes: > > > > 48154/clusterfuzz-testcase-minimized-ffmpeg_dem_AAX_fuzzer-5149094353436672 > > > > > > > > Found-by: continuous fuzzing process > > > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > > > Signed-off-by: Michael Niedermayer > > > > --- > > > > libavformat/aaxdec.c | 2 ++ > > > > 1 file changed, 2 insertions(+) > > > > > > > > diff --git a/libavformat/aaxdec.c b/libavformat/aaxdec.c > > > > index dd1fbde736..bcbff216db 100644 > > > > --- a/libavformat/aaxdec.c > > > > +++ b/libavformat/aaxdec.c > > > > @@ -252,6 +252,8 @@ static int aax_read_header(AVFormatContext *s) > > > > size = avio_rb32(pb); > > > > a->segments[r].start = start + a->data_offset; > > > > a->segments[r].end = a->segments[r].start + size; > > > > +if (!size) > > > > +return AVERROR_INVALIDDATA; > > > > > > Why check for invalid size only after some things are set based on it > > > and not before? > > moved it up will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I know you won't believe me, but the highest form of Human Excellence is to question oneself and others. -- Socrates 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/qpeldsp: copy less for the mc0x cases
On Mon, Jun 27, 2022 at 02:40:04PM +0200, Michael Niedermayer wrote: > On Mon, Jun 27, 2022 at 07:57:06AM +0200, Andreas Rheinhardt wrote: > > Michael Niedermayer: > > > Fixes: out of array access > > > Fixes: > > > 47936/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5745039940124672 > > > > > > Found-by: continuous fuzzing process > > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > > Signed-off-by: Michael Niedermayer > > > --- > > > libavcodec/qpeldsp.c | 12 ++-- > > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > > > diff --git a/libavcodec/qpeldsp.c b/libavcodec/qpeldsp.c > > > index 2b9146ceb1..5f937f9d9e 100644 > > > --- a/libavcodec/qpeldsp.c > > > +++ b/libavcodec/qpeldsp.c > > > @@ -199,7 +199,7 @@ static void OPNAME ## qpel8_mc01_c(uint8_t *dst, > > > const uint8_t *src, \ > > > uint8_t full[16 * 9]; > > > \ > > > uint8_t half[64]; > > > \ > > > > > > \ > > > -copy_block9(full, src, 16, stride, 9); > > > \ > > > +copy_block8(full, src, 16, stride, 9); > > > \ > > > put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16); > > > \ > > > OPNAME ## pixels8_l2_8(dst, full, half, stride, 16, 8, 8); > > > \ > > > } > > > \ > > > @@ -209,7 +209,7 @@ static void OPNAME ## qpel8_mc02_c(uint8_t *dst, > > > const uint8_t *src, \ > > > { > > > \ > > > uint8_t full[16 * 9]; > > > \ > > > > > > \ > > > -copy_block9(full, src, 16, stride, 9); > > > \ > > > +copy_block8(full, src, 16, stride, 9); > > > \ > > > OPNAME ## mpeg4_qpel8_v_lowpass(dst, full, stride, 16); > > > \ > > > } > > > \ > > > > > > \ > > > @@ -219,7 +219,7 @@ static void OPNAME ## qpel8_mc03_c(uint8_t *dst, > > > const uint8_t *src, \ > > > uint8_t full[16 * 9]; > > > \ > > > uint8_t half[64]; > > > \ > > > > > > \ > > > -copy_block9(full, src, 16, stride, 9); > > > \ > > > +copy_block8(full, src, 16, stride, 9); > > > \ > > > put ## RND ## mpeg4_qpel8_v_lowpass(half, full, 8, 16); > > > \ > > > OPNAME ## pixels8_l2_8(dst, full + 16, half, stride, 16, 8, 8); > > > \ > > > } > > > \ > > > @@ -459,7 +459,7 @@ static void OPNAME ## qpel16_mc01_c(uint8_t *dst, > > > const uint8_t *src, \ > > > uint8_t full[24 * 17]; > > > \ > > > uint8_t half[256]; > > > \ > > > > > > \ > > > -copy_block17(full, src, 24, stride, 17); > > > \ > > > +copy_block16(full, src, 24, stride, 17); > > > \ > > > put ## RND ## mpeg4_qpel16_v_lowpass(half, full, 16, 24); > > > \ > > > OPNAME ## pixels16_l2_8(dst, full, half, stride, 24, 16, 16); > > > \ > > > } > > > \ > > > @@ -469,7 +469,7 @@ static void OPNAME ## qpel16_mc02_c(uint8_t *dst, > > > const uint8_t *src, \ > > > { > > > \ > > > uint8_t full[24 * 17]; > > > \ > > > > > > \ > > > -copy_block17(full, src, 24, stride, 17); > > > \ > > > +copy_block16(full, src, 24, stride, 17); > > > \ > > > OPNAME ## mpeg4_qpel16_v_lowpass(dst, full, stride, 24); > > > \ > > > } > > > \ > > >
Re: [FFmpeg-devel] [PATCH 3/3] tools/target_dec_fuzzer: adjust threshold for cinepak
On Sat, Jul 02, 2022 at 02:22:50PM +0200, Michael Niedermayer wrote: > Fixes: Timeout > Fixes: > 48158/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CINEPAK_fuzzer-5986526573494272 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > tools/target_dec_fuzzer.c | 1 + > 1 file changed, 1 insertion(+) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- 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 2/2] avcodec/tiff: Check pixel format types for dng
On Fri, Jul 01, 2022 at 09:25:53PM +0200, Michael Niedermayer wrote: > Fixes: out of array access > Fixes: > 48271/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6149705769287680 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/tiff.c | 3 +++ > 1 file changed, 3 insertions(+) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In a rich man's house there is no place to spit but his face. -- Diogenes of Sinope 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] tools/target_dec_fuzzer: Adjust threshold for AASC
On Sat, Jun 18, 2022 at 09:16:37PM +0200, Michael Niedermayer wrote: > Fixes: Timeout > Fixes: > 47919/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AASC_fuzzer-5176435830030336 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > tools/target_dec_fuzzer.c | 1 + > 1 file changed, 1 insertion(+) will apply [...] -- 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 2/3] avcodec/hevcdsp_template: stay within tables in sao_band_filter()
On Thu, Jun 09, 2022 at 11:37:40PM +0200, Michael Niedermayer wrote: > Fixes: out of array read > Fixes: > 47875/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5719393113341952 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answer. 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 3/3] avcodec/bink: disallow odd positioned scaled blocks
On Tue, Jun 14, 2022 at 12:09:59AM +0200, Michael Niedermayer wrote: > On Tue, Jun 14, 2022 at 12:01:14AM +0200, Paul B Mahol wrote: > > On Mon, Jun 13, 2022 at 11:55 PM Michael Niedermayer > > > > wrote: > > > > > On Mon, Jun 13, 2022 at 10:02:24AM +0200, Paul B Mahol wrote: > > > > Have you checked this with longer samples? > > > > > > ive tested it with the files in the bink directory on samples > > > anything else i should test it with ? > > > > > > > Something longer, where is big gap between keyframes. > > I would have thought that some of the 46 files in the samples archieve > would have adequate gaps. > Can you share some better test file ? ping ? anyone has more files i should test ? if not, i suggest to apply this thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have never wished to cater to the crowd; for what I know they do not approve, and what they approve I do not know. -- Epicurus 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 2/2] avformat/rtsp: break on unknown protocols
On Fri, May 20, 2022 at 01:43:12AM +0200, Michael Niedermayer wrote: > This function needs more cleanup and it lacks error handling > > Fixes: use of uninitialized memory > Fixes: CID700776 > > Signed-off-by: Michael Niedermayer > --- > libavformat/rtsp.c | 2 ++ > 1 file changed, 2 insertions(+) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- 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 2/2] avfilter/vf_signature: Fix integer overflow in filter_frame()
On Wed, May 18, 2022 at 05:55:05PM +0200, Michael Niedermayer wrote: > Fixes: CID1403233 > > The second of the 2 changes may be unneeded but will help coverity > > Signed-off-by: Michael Niedermayer > --- > libavfilter/vf_signature.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you drop bombs on a foreign country and kill a hundred thousand innocent people, expect your government to call the consequence "unprovoked inhuman terrorist attacks" and use it to justify dropping more bombs and killing more people. The technology changed, the idea is old. 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/pixlet: consider minimum plane header in the minimal packet size
On Sun, May 01, 2022 at 03:37:58PM +0200, Michael Niedermayer wrote: > Fixes: Timeout > Fixes: > 46956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PIXLET_fuzzer-5698161106092032 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/pixlet.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Any man who breaks a law that conscience tells him is unjust and willingly accepts the penalty by staying in jail in order to arouse the conscience of the community on the injustice of the law is at that moment expressing the very highest respect for law. - Martin Luther King Jr 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/sbrdsp_fixed: Fix integer overflows in sbr_qmf_deint_neg_c()
On Mon, May 02, 2022 at 05:07:39PM +0200, Michael Niedermayer wrote: > Fixes: signed integer overflow: 2147483645 + 16 cannot be represented in type > 'int' > Fixes: > 46993/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-4759025234870272 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/sbrdsp_fixed.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In fact, the RIAA has been known to suggest that students drop out of college or go to community college in order to be able to afford settlements. -- The RIAA 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/h264dec: Skip late SEI
On Thu, Apr 28, 2022 at 08:25:52PM +0200, Michael Niedermayer wrote: > Fixes: Race condition > Fixes: > clusterfuzz-testcase-minimized-mediasource_MP2T_AVC_pipeline_integration_fuzzer-6282675434094592 > > Found-by: google ClusterFuzz > Tested-by: Dan Sanders > Signed-off-by: Michael Niedermayer > --- > libavcodec/h264dec.c | 4 > 1 file changed, 4 insertions(+) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The educated differ from the uneducated as much as the living from the dead. -- 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".
[FFmpeg-devel] [PATCH 3/3] avformat/flvdec: Check for EOF in index reading
Fixes: Timeout Fixes: 47992/clusterfuzz-testcase-minimized-ffmpeg_dem_LIVE_FLV_fuzzer-6020443879899136 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/flvdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index c5d3c63bd0..8dba92661b 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -463,6 +463,8 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, int64_t m goto invalid; if (current_array == × && (d <= INT64_MIN / 1000 || d >= INT64_MAX / 1000)) goto invalid; +if (avio_feof(ioc)) +goto invalid; current_array[0][i] = d; } if (times && filepositions) { -- 2.17.1 ___ 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/3] avcodec/lagarith: Check dst/src in zero run code
Fixes: out of array access Fixes: 48799/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LAGARITH_fuzzer-4764457825337344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/lagarith.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index 3aeb1c8a99..00e8005222 100644 --- a/libavcodec/lagarith.c +++ b/libavcodec/lagarith.c @@ -409,6 +409,9 @@ output_zeros: if (zero_run) { zero_run = 0; i += esc_count; +if (i > end - dst || +i >= src_end - src) +return AVERROR_INVALIDDATA; memcpy(dst, src, i); dst += i; l->zeros_rem = lag_calc_zero_run(src[i]); -- 2.17.1 ___ 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/3] avformat/nutdec: Check get_packetheader() in mainheader
Fixes; Timeout Fixes: 48794/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6524604713140224 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/nutdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 0db3d03f6c..8cc56615ad 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -200,6 +200,8 @@ static int decode_main_header(NUTContext *nut) int tmp_stream, tmp_mul, tmp_pts, tmp_size, tmp_res, tmp_head_idx; length = get_packetheader(nut, bc, 1, MAIN_STARTCODE); +if (length == (uint64_t)-1) +return AVERROR_INVALIDDATA; end = length + avio_tell(bc); nut->version = ffio_read_varlen(bc); -- 2.17.1 ___ 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] swscale: add NV16 input/output
Le ven. 1 juil. 2022, 10:08, Matthieu Bouron a écrit : > On Sat, Jun 11, 2022 at 5:35 PM Michael Niedermayer < > mich...@niedermayer.cc> wrote: > >> On Fri, Jun 10, 2022 at 04:11:10PM +0200, Matthieu Bouron wrote: >> > On Thu, Jun 2, 2022 at 9:13 PM Michael Niedermayer < >> mich...@niedermayer.cc> >> > wrote: >> > >> > > On Wed, Jun 01, 2022 at 10:33:37PM +0200, Matthieu Bouron wrote: >> > > > --- >> > > > libswscale/input.c | 1 + >> > > > libswscale/utils.c | 1 + >> > > > libswscale/version.h | 2 +- >> > > > tests/ref/fate/filter-pixdesc-nv16 | 1 + >> > > > tests/ref/fate/filter-pixfmts-copy | 1 + >> > > > tests/ref/fate/filter-pixfmts-crop | 1 + >> > > > tests/ref/fate/filter-pixfmts-field | 1 + >> > > > tests/ref/fate/filter-pixfmts-fieldorder | 1 + >> > > > tests/ref/fate/filter-pixfmts-hflip | 1 + >> > > > tests/ref/fate/filter-pixfmts-il | 1 + >> > > > tests/ref/fate/filter-pixfmts-null | 1 + >> > > > tests/ref/fate/filter-pixfmts-pad| 1 + >> > > > tests/ref/fate/filter-pixfmts-scale | 1 + >> > > > tests/ref/fate/filter-pixfmts-vflip | 1 + >> > > > 14 files changed, 14 insertions(+), 1 deletion(-) >> > > > create mode 100644 tests/ref/fate/filter-pixdesc-nv16 >> > > >> > > >> > Sorry for the late reply >> > >> > >> > > has this been tested ? (various scaled and non scaled) variants ? >> > > >> > >> > I only tested the non scaled variant using the command line doing >> multiple >> > round trips to/from nv16. >> > Is there a particular test procedure to validate every variants ? >> >> you can test manually or use something like >> libswscale/tests/swscale.c >> > > I manually tested without any issue: il, field, fieldorder, copy, crop, > hflip, null, pad, scale and vflip. > Ping. ___ 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] Tags in video
Is it possible to allow ffmpeg to read tags off from videos? Tags were manually inputted in Windows 10. https://emby.media/community/index.php?/topic/110246-allow-scan-media-to-detect-tags-in-videos/#comment-1162342 ___ 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 v2 1/2] avformat: refactor ff_stream_encode_params_copy() to ff_stream_params_copy()
From: Pierre-Anthony Lemieux As discussed at https://ffmpeg.org/pipermail/ffmpeg-devel/2022-July/298491.html --- libavformat/avformat.c | 38 ++ libavformat/fifo.c | 2 +- libavformat/internal.h | 9 + libavformat/mux.h| 9 - libavformat/mux_utils.c | 28 libavformat/segment.c| 2 +- libavformat/tee.c| 2 +- libavformat/webm_chunk.c | 2 +- 8 files changed, 51 insertions(+), 41 deletions(-) diff --git a/libavformat/avformat.c b/libavformat/avformat.c index 30d6ea6a49..a4aa92cd22 100644 --- a/libavformat/avformat.c +++ b/libavformat/avformat.c @@ -235,6 +235,44 @@ int ff_stream_side_data_copy(AVStream *dst, const AVStream *src) return 0; } +int ff_stream_params_copy(AVStream *dst, const AVStream *src) +{ +int ret; + +dst->id = src->id; +dst->index = src->index; +dst->time_base = src->time_base; +dst->start_time = src->start_time; +dst->duration= src->duration; +dst->nb_frames = src->nb_frames; +dst->disposition = src->disposition; +dst->discard = src->discard; +dst->sample_aspect_ratio = src->sample_aspect_ratio; +dst->avg_frame_rate = src->avg_frame_rate; +dst->event_flags = src->event_flags; +dst->r_frame_rate= src->r_frame_rate; +dst->pts_wrap_bits = src->pts_wrap_bits; + +av_dict_free(&dst->metadata); +ret = av_dict_copy(&dst->metadata, src->metadata, 0); +if (ret < 0) +return ret; + +ret = avcodec_parameters_copy(dst->codecpar, src->codecpar); +if (ret < 0) +return ret; + +ret = ff_stream_side_data_copy(dst, src); +if (ret < 0) +return ret; + +ret = av_packet_ref(&dst->attached_pic, &src->attached_pic); +if (ret < 0) +return ret; + +return 0; +} + AVProgram *av_new_program(AVFormatContext *ac, int id) { AVProgram *program = NULL; diff --git a/libavformat/fifo.c b/libavformat/fifo.c index ead2bdc5cf..fef116d040 100644 --- a/libavformat/fifo.c +++ b/libavformat/fifo.c @@ -509,7 +509,7 @@ static int fifo_mux_init(AVFormatContext *avf, const AVOutputFormat *oformat, if (!st) return AVERROR(ENOMEM); -ret = ff_stream_encode_params_copy(st, avf->streams[i]); +ret = ff_stream_params_copy(st, avf->streams[i]); if (ret < 0) return ret; } diff --git a/libavformat/internal.h b/libavformat/internal.h index b6b8fbf56f..f89da85e22 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -625,6 +625,15 @@ enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags); */ int ff_stream_side_data_copy(AVStream *dst, const AVStream *src); +/** + * Copy all stream parameters from source to destination stream + * + * @param dst pointer to destination AVStream + * @param src pointer to source AVStream + * @return >=0 on success, AVERROR code on error + */ +int ff_stream_params_copy(AVStream *dst, const AVStream *src); + /** * Wrap ffurl_move() and log if error happens. * diff --git a/libavformat/mux.h b/libavformat/mux.h index c01da82194..1bfcaf795f 100644 --- a/libavformat/mux.h +++ b/libavformat/mux.h @@ -113,15 +113,6 @@ int ff_format_shift_data(AVFormatContext *s, int64_t read_start, int shift_size) */ int ff_format_output_open(AVFormatContext *s, const char *url, AVDictionary **options); -/** - * Copy encoding parameters from source to destination stream - * - * @param dst pointer to destination AVStream - * @param src pointer to source AVStream - * @return >=0 on success, AVERROR code on error - */ -int ff_stream_encode_params_copy(AVStream *dst, const AVStream *src); - /** * Parse creation_time in AVFormatContext metadata if exists and warn if the * parsing fails. diff --git a/libavformat/mux_utils.c b/libavformat/mux_utils.c index eb8ea3d560..2fa2ab5b0f 100644 --- a/libavformat/mux_utils.c +++ b/libavformat/mux_utils.c @@ -121,34 +121,6 @@ int ff_format_output_open(AVFormatContext *s, const char *url, AVDictionary **op return 0; } -int ff_stream_encode_params_copy(AVStream *dst, const AVStream *src) -{ -int ret; - -dst->id = src->id; -dst->time_base = src->time_base; -dst->nb_frames = src->nb_frames; -dst->disposition = src->disposition; -dst->sample_aspect_ratio = src->sample_aspect_ratio; -dst->avg_frame_rate = src->avg_frame_rate; -dst->r_frame_rate= src->r_frame_rate; - -av_dict_free(&dst->metadata); -ret = av_dict_copy(&dst->metadata, src->metadata, 0); -if (ret < 0) -return ret; - -ret = avcodec_parameters_copy(dst->codecpar, src->codecpar); -if (ret < 0) -return ret; - -ret = ff_stream_side_data_copy(dst, src); -if (ret < 0) -return ret; - -return 0; -} - int ff_parse
[FFmpeg-devel] [PATCH v2 2/2] avformat/imfdec: preserve stream information
From: Pierre-Anthony Lemieux As discussed at https://trac.ffmpeg.org/ticket/9818, the IMF demuxer does not currently preserve stream information such as language in the case of audio streams. --- libavformat/imfdec.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 71dfb26958..4cd6a56a09 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -579,12 +579,15 @@ static int set_context_streams_from_tracks(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "Could not create stream\n"); return AVERROR(ENOMEM); } -asset_stream->id = i; -ret = avcodec_parameters_copy(asset_stream->codecpar, first_resource_stream->codecpar); + +ret = ff_stream_params_copy(asset_stream, first_resource_stream); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Could not copy stream parameters\n"); return ret; } + +asset_stream->id = i; +asset_stream->nb_frames = 0; avpriv_set_pts_info(asset_stream, first_resource_stream->pts_wrap_bits, first_resource_stream->time_base.num, -- 2.25.1 ___ 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] ffprobe: use pkt->dts to compute interval ts when pts is missing
For some samples the pkt->pts is always missing, use the pkt->dts instead. Fix trac issue http://trac.ffmpeg.org/ticket/4427. --- fftools/ffprobe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index f156663019..8824b1c044 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -2844,9 +2844,10 @@ static int read_interval_packets(WriterContext *w, InputFile *ifile, } if (selected_streams[pkt->stream_index]) { AVRational tb = ifile->streams[pkt->stream_index].st->time_base; +int64_t pts = pkt->pts != AV_NOPTS_VALUE ? pkt->pts : pkt->dts; -if (pkt->pts != AV_NOPTS_VALUE) -*cur_ts = av_rescale_q(pkt->pts, tb, AV_TIME_BASE_Q); +if (pts != AV_NOPTS_VALUE) +*cur_ts = av_rescale_q(pts, tb, AV_TIME_BASE_Q); if (!has_start && *cur_ts != AV_NOPTS_VALUE) { start = *cur_ts; -- 2.25.1 ___ 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".