Re: [FFmpeg-devel] [PATCH] avcodec/av1dec: Check tiles sizes, fix assert, don't read bytes bitwise
On 9/17/2020 12:19 AM, Andreas Rheinhardt wrote: > Tiles have a size field with a length from one to four bytes. As such it > is not possible to read it all at once with a call to get_bits() as this > only allows to read up to 25 bits; this is guarded by an av_assert2. Yet > this is done by the AV1 decoder in get_tiles_info(). It has been done > despite said size fields being byte-aligned. This commit fixes this by > using the bytestream2 API instead. > > Furthermore, it is now explicitly checked whether the data is > consistent, i.e. whether the data that is supposed to be there extends > beyond the end of the data actually present. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/av1dec.c | 40 > 1 file changed, 20 insertions(+), 20 deletions(-) > > diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c > index cb46801202..0bb04a3e44 100644 > --- a/libavcodec/av1dec.c > +++ b/libavcodec/av1dec.c > @@ -21,7 +21,7 @@ > #include "libavutil/pixdesc.h" > #include "avcodec.h" > #include "av1dec.h" > -#include "get_bits.h" > +#include "bytestream.h" > #include "hwconfig.h" > #include "internal.h" > #include "profiles.h" > @@ -205,18 +205,12 @@ static int init_tile_data(AV1DecContext *s) > static int get_tiles_info(AVCodecContext *avctx, const AV1RawTileGroup > *tile_group) > { > AV1DecContext *s = avctx->priv_data; > -GetBitContext gb; > +GetByteContext gb; > uint16_t tile_num, tile_row, tile_col; > -uint32_t size = 0, size_bytes = 0, offset = 0; > -int ret; > - > -if ((ret = init_get_bits8(&gb, > - tile_group->tile_data.data, > - tile_group->tile_data.data_size)) < 0) { > -av_log(avctx, AV_LOG_ERROR, "Failed to initialize bitstream > reader.\n"); > -return ret; > -} > +uint32_t size = 0, size_bytes = 0; > > +bytestream2_init(&gb, tile_group->tile_data.data, > + tile_group->tile_data.data_size); > s->tg_start = tile_group->tg_start; > s->tg_end = tile_group->tg_end; > > @@ -225,24 +219,28 @@ static int get_tiles_info(AVCodecContext *avctx, const > AV1RawTileGroup *tile_gro > tile_col = tile_num % s->raw_frame_header->tile_cols; > > if (tile_num == tile_group->tg_end) { > -s->tile_group_info[tile_num].tile_size = get_bits_left(&gb) / 8; > -s->tile_group_info[tile_num].tile_offset = offset; > +s->tile_group_info[tile_num].tile_size = > bytestream2_get_bytes_left(&gb); > +s->tile_group_info[tile_num].tile_offset = bytestream2_tell(&gb); > s->tile_group_info[tile_num].tile_row = tile_row; > s->tile_group_info[tile_num].tile_column = tile_col; > return 0; > } > size_bytes = s->raw_frame_header->tile_size_bytes_minus1 + 1; > -size = get_bits_le(&gb, size_bytes * 8) + 1; > -skip_bits(&gb, size * 8); > - > -offset += size_bytes; > +if (bytestream2_get_bytes_left(&gb) < size_bytes) > +return AVERROR_INVALIDDATA; > +size = 0; > +for (int i = 0; i < size_bytes; i++) > +size |= bytestream2_get_byteu(&gb) << 8 * i; > +if (bytestream2_get_bytes_left(&gb) <= size) > +return AVERROR_INVALIDDATA; > +size++; > > s->tile_group_info[tile_num].tile_size = size; > -s->tile_group_info[tile_num].tile_offset = offset; > +s->tile_group_info[tile_num].tile_offset = bytestream2_tell(&gb); > s->tile_group_info[tile_num].tile_row = tile_row; > s->tile_group_info[tile_num].tile_column = tile_col; > > -offset += size; > +bytestream2_skipu(&gb, size); > } > > return 0; > @@ -778,7 +776,9 @@ static int av1_decode_frame(AVCodecContext *avctx, void > *frame, > else > raw_tile_group = &obu->obu.tile_group; > > -get_tiles_info(avctx, raw_tile_group); > +ret = get_tiles_info(avctx, raw_tile_group); > +if (ret < 0) > +goto end; > > if (avctx->hwaccel) { > ret = avctx->hwaccel->decode_slice(avctx, Should be ok. ___ 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/hevcdec: fix per-frame signaling of color_trc
On Wed, 16. Sep 18:14, Pavel Koshevoy wrote: > This is a partial revert of f2ad6238e4c0e99e2fc131ee14c586e87b045680 > It fixes per-frame color_trc signaling of arib-std-b67 frames. > > Reproducible with: > ffprobe -show_frames lg_4k_hlg.ts | grep color_transfer= > --- > libavcodec/hevcdec.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c > index c1de75abe1..e3d1e3f693 100644 > --- a/libavcodec/hevcdec.c > +++ b/libavcodec/hevcdec.c > @@ -2810,6 +2810,12 @@ static int set_side_data(HEVCContext *s) > s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; > } > > +if (s->sei.alternative_transfer.present && > + > av_color_transfer_name(s->sei.alternative_transfer.preferred_transfer_characteristics) > && > +s->sei.alternative_transfer.preferred_transfer_characteristics != > AVCOL_TRC_UNSPECIFIED) { > +s->avctx->color_trc = out->color_trc = > s->sei.alternative_transfer.preferred_transfer_characteristics; > +} > + > for (int i = 0; i < s->sei.unregistered.nb_buf_ref; i++) { > HEVCSEIUnregistered *unreg = &s->sei.unregistered; > Haven't looked in detail but patch appears to fix https://trac.ffmpeg.org/ticket/8610 -- Andriy ___ 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 40/40] avcodec/ffwavesynth: Cleanup generically after init failure
Andreas Rheinhardt: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/ffwavesynth.c | 14 -- > 1 file changed, 4 insertions(+), 10 deletions(-) > > diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c > index d92bb38c45..c99bac90ea 100644 > --- a/libavcodec/ffwavesynth.c > +++ b/libavcodec/ffwavesynth.c > @@ -323,13 +323,11 @@ static av_cold int wavesynth_init(AVCodecContext *avc) > r = wavesynth_parse_extradata(avc); > if (r < 0) { > av_log(avc, AV_LOG_ERROR, "Invalid intervals definitions.\n"); > -goto fail; > +return r; > } > ws->sin = av_malloc(sizeof(*ws->sin) << SIN_BITS); > -if (!ws->sin) { > -r = AVERROR(ENOMEM); > -goto fail; > -} > +if (!ws->sin) > +return AVERROR(ENOMEM); > for (i = 0; i < 1 << SIN_BITS; i++) > ws->sin[i] = floor(32767 * sin(2 * M_PI * i / (1 << SIN_BITS))); > ws->dither_state = MKTAG('D','I','T','H'); > @@ -340,11 +338,6 @@ static av_cold int wavesynth_init(AVCodecContext *avc) > wavesynth_seek(ws, 0); > avc->sample_fmt = AV_SAMPLE_FMT_S16; > return 0; > - > -fail: > -av_freep(&ws->inter); > -av_freep(&ws->sin); > -return r; > } > > static void wavesynth_synth_sample(struct wavesynth_context *ws, int64_t ts, > @@ -476,4 +469,5 @@ AVCodec ff_ffwavesynth_decoder = { > .close = wavesynth_close, > .decode = wavesynth_decode, > .capabilities = AV_CODEC_CAP_DR1, > +.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, > }; > Will apply the rest of this patchset tomorrow if there are no objections. - 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".
[FFmpeg-devel] [PATCH] avcodec/av1dec: Check tiles sizes, fix assert, don't read bytes bitwise
Tiles have a size field with a length from one to four bytes. As such it is not possible to read it all at once with a call to get_bits() as this only allows to read up to 25 bits; this is guarded by an av_assert2. Yet this is done by the AV1 decoder in get_tiles_info(). It has been done despite said size fields being byte-aligned. This commit fixes this by using the bytestream2 API instead. Furthermore, it is now explicitly checked whether the data is consistent, i.e. whether the data that is supposed to be there extends beyond the end of the data actually present. Signed-off-by: Andreas Rheinhardt --- libavcodec/av1dec.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index cb46801202..0bb04a3e44 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -21,7 +21,7 @@ #include "libavutil/pixdesc.h" #include "avcodec.h" #include "av1dec.h" -#include "get_bits.h" +#include "bytestream.h" #include "hwconfig.h" #include "internal.h" #include "profiles.h" @@ -205,18 +205,12 @@ static int init_tile_data(AV1DecContext *s) static int get_tiles_info(AVCodecContext *avctx, const AV1RawTileGroup *tile_group) { AV1DecContext *s = avctx->priv_data; -GetBitContext gb; +GetByteContext gb; uint16_t tile_num, tile_row, tile_col; -uint32_t size = 0, size_bytes = 0, offset = 0; -int ret; - -if ((ret = init_get_bits8(&gb, - tile_group->tile_data.data, - tile_group->tile_data.data_size)) < 0) { -av_log(avctx, AV_LOG_ERROR, "Failed to initialize bitstream reader.\n"); -return ret; -} +uint32_t size = 0, size_bytes = 0; +bytestream2_init(&gb, tile_group->tile_data.data, + tile_group->tile_data.data_size); s->tg_start = tile_group->tg_start; s->tg_end = tile_group->tg_end; @@ -225,24 +219,28 @@ static int get_tiles_info(AVCodecContext *avctx, const AV1RawTileGroup *tile_gro tile_col = tile_num % s->raw_frame_header->tile_cols; if (tile_num == tile_group->tg_end) { -s->tile_group_info[tile_num].tile_size = get_bits_left(&gb) / 8; -s->tile_group_info[tile_num].tile_offset = offset; +s->tile_group_info[tile_num].tile_size = bytestream2_get_bytes_left(&gb); +s->tile_group_info[tile_num].tile_offset = bytestream2_tell(&gb); s->tile_group_info[tile_num].tile_row = tile_row; s->tile_group_info[tile_num].tile_column = tile_col; return 0; } size_bytes = s->raw_frame_header->tile_size_bytes_minus1 + 1; -size = get_bits_le(&gb, size_bytes * 8) + 1; -skip_bits(&gb, size * 8); - -offset += size_bytes; +if (bytestream2_get_bytes_left(&gb) < size_bytes) +return AVERROR_INVALIDDATA; +size = 0; +for (int i = 0; i < size_bytes; i++) +size |= bytestream2_get_byteu(&gb) << 8 * i; +if (bytestream2_get_bytes_left(&gb) <= size) +return AVERROR_INVALIDDATA; +size++; s->tile_group_info[tile_num].tile_size = size; -s->tile_group_info[tile_num].tile_offset = offset; +s->tile_group_info[tile_num].tile_offset = bytestream2_tell(&gb); s->tile_group_info[tile_num].tile_row = tile_row; s->tile_group_info[tile_num].tile_column = tile_col; -offset += size; +bytestream2_skipu(&gb, size); } return 0; @@ -778,7 +776,9 @@ static int av1_decode_frame(AVCodecContext *avctx, void *frame, else raw_tile_group = &obu->obu.tile_group; -get_tiles_info(avctx, raw_tile_group); +ret = get_tiles_info(avctx, raw_tile_group); +if (ret < 0) +goto end; if (avctx->hwaccel) { ret = avctx->hwaccel->decode_slice(avctx, -- 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 v3 2/2] dnn_backend_native_layer_conv2d.c: refine code.
> -Original Message- > From: ffmpeg-devel On Behalf Of > xuju...@sjtu.edu.cn > Sent: 2020年9月16日 18:07 > To: ffmpeg-devel@ffmpeg.org > Cc: xuju...@sjtu.edu.cn > Subject: [FFmpeg-devel] [PATCH v3 2/2] dnn_backend_native_layer_conv2d.c: > refine code. > > From: Xu Jun > > Move thread area allocate out of thread function into main thread. > > Signed-off-by: Xu Jun > --- > .../dnn/dnn_backend_native_layer_conv2d.c | 30 +-- > 1 file changed, 14 insertions(+), 16 deletions(-) LGTM, will push soon, 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 0/6] qsv: Fix compiler errors when using libmfx 2.0 (oneVPL)
On Wed, 2020-09-16 at 20:44 +, Soft Works wrote: > > -Original Message- > > From: ffmpeg-devel On Behalf Of > > Xiang, Haihao > > Sent: Wednesday, September 16, 2020 10:30 AM > > To: ffmpeg-devel@ffmpeg.org > > Subject: Re: [FFmpeg-devel] [PATCH 0/6] qsv: Fix compiler errors when using > > libmfx 2.0 (oneVPL) > > > > On Wed, 2020-09-16 at 08:12 +, Soft Works wrote: > > > > -Original Message- > > > > From: ffmpeg-devel On Behalf Of > > > > Haihao Xiang > > > > Sent: Wednesday, September 16, 2020 8:45 AM > > > > To: ffmpeg-devel@ffmpeg.org > > > > Cc: Haihao Xiang > > > > Subject: [FFmpeg-devel] [PATCH 0/6] qsv: Fix compiler errors when > > > > using libmfx 2.0 (oneVPL) > > > > > > > > The oneAPI Video Processing Library (oneVPL) is a single interface > > > > for encode, decode and video processing, the obsolete features in > > > > Intel Media Software Development Kit are removed from oneVPL. > > > > > > > > The oneVPL specification: > > > > > > > > https://spec.oneapi.com/versions/latest/elements/oneVPL/source/index > > > > .ht > > > > ml > > > > The oneVPL source code: > > > > https://github.com/oneapi-src/oneVPL > > > > > > > > Haihao Xiang (6): > > > > qsv: add ${includedir}/mfx to the search path for old versions of > > > > libmfx > > > > qsv: libmfx no longer supports user plugin since version 2.0 (oneVPL) > > > > qsv: libmfx no longer supports audio since version 2.0 (oneVPL) > > > > qsvenc: libmfx no longer supports multi-frame encode since version 2.0 > > > > (oneVPL) > > > > qsvenc: libmfx no longer supports MFX_RATECONTROL_LA_EXT since > > > > version > > > > 2.0 (oneVPL) > > > > qsv: libmfx no longer supports OPAQUE memory since version 2.0 > > > > (oneVPL) > > > > > > Hi, > > > > > > MFX => ClearVideo => QuickSync => MediaSDK => oneVPL > > > > > > Is there actually something new in "oneVPL 2.0" or is this just MSDK > > > 1.34 with many things removed and once another name added? > > > > You may refer to > > https://spec.oneapi.com/versions/latest/elements/oneVPL/source/VPL_int > > el_media_sdk.html#new-apis-in-onevpl > > for the new APIs/features. > > Hi, > > Thanks for the link. So, at this time there doesn't seem to be anything where > ffmpeg would benefit from using it. Hopefully there will be something > interesting in the future. It is in the todo list to use the new APIs. The first step is to build FFmpeg against oneVPL without compiler errors. > > > > > > > PS: How about VPP tone-mapping? > > > > Do you mean libmfx based tone-mapping? > > Yes, correct. The implementation already exists in VAAPI, but afaik it is not > yet available via libmfx. Do you know about any plans regarding this? I'm sorry I also don't know the plan about it. You'd be better to file an issue on https://github.com/Intel-Media-SDK/MediaSDK/issues if you are interested onthis feature. Thanks Haihao > > Thanks and kind regards, > softworkz > ___ > 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 v2 1/2] avcodec/av1dec: Fix segfault upon allocation error
On 9/16/2020 9:08 PM, Andreas Rheinhardt wrote: > Up until now, the AV1 decoder always checks before calling its wrapper > around ff_thread_release_buffer() whether the ThreadFrame was used at > all, i.e. it checked whether the first data buffer of the AVFrame > contained therein is NULL or not. Yet this presumes that the AVFrame has > been successfully allocated, even though this can of course fail; and if > it did, one would encounter a segfault. > Fix this by removing the checks altogether: ff_thread_release_buffer() > can handle both unallocated as well as empty frames (since commit > f6774f905fb3cfdc319523ac640be30b14c1bc55). > > Signed-off-by: Andreas Rheinhardt > --- > Removing the checks is based upon a suggestion by James Almer. I have > not removed the checks from the other callers of av1_frame_unref() as I > don't know how probable it is for the frame to be empty at this point. > I tested this as well as I can, but I have no hardware with AV1 hardware > acceleration. You can remove the check that aborts when no hwaccel is present, which lets get_format() successfully return a software pixel format. This will make the decoder "work", simply outputting zeroed buffers into frames, which is enough to test behavior like the above. > > libavcodec/av1dec.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c > index bd8acdaafe..871db76b4d 100644 > --- a/libavcodec/av1dec.c > +++ b/libavcodec/av1dec.c > @@ -388,12 +388,10 @@ static av_cold int av1_decode_free(AVCodecContext > *avctx) > AV1DecContext *s = avctx->priv_data; > > for (int i = 0; i < FF_ARRAY_ELEMS(s->ref); i++) { > -if (s->ref[i].tf.f->buf[0]) > -av1_frame_unref(avctx, &s->ref[i]); > +av1_frame_unref(avctx, &s->ref[i]); > av_frame_free(&s->ref[i].tf.f); > } > -if (s->cur_frame.tf.f->buf[0]) > -av1_frame_unref(avctx, &s->cur_frame); > +av1_frame_unref(avctx, &s->cur_frame); > av_frame_free(&s->cur_frame.tf.f); > > av_buffer_unref(&s->seq_ref); > LGTM. ___ 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/hevcdec: fix per-frame signaling of color_trc
On 9/16/2020 9:14 PM, Pavel Koshevoy wrote: > This is a partial revert of f2ad6238e4c0e99e2fc131ee14c586e87b045680 > It fixes per-frame color_trc signaling of arib-std-b67 frames. > > Reproducible with: > ffprobe -show_frames lg_4k_hlg.ts | grep color_transfer= > --- > libavcodec/hevcdec.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c > index c1de75abe1..e3d1e3f693 100644 > --- a/libavcodec/hevcdec.c > +++ b/libavcodec/hevcdec.c > @@ -2810,6 +2810,12 @@ static int set_side_data(HEVCContext *s) > s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; > } > > +if (s->sei.alternative_transfer.present && > + > av_color_transfer_name(s->sei.alternative_transfer.preferred_transfer_characteristics) > && > +s->sei.alternative_transfer.preferred_transfer_characteristics != > AVCOL_TRC_UNSPECIFIED) { > +s->avctx->color_trc = out->color_trc = > s->sei.alternative_transfer.preferred_transfer_characteristics; > +} > + > for (int i = 0; i < s->sei.unregistered.nb_buf_ref; i++) { > HEVCSEIUnregistered *unreg = &s->sei.unregistered; I have an alternative approach. Will send 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".
[FFmpeg-devel] [PATCH] avocdec/hevcdec: set SEI derived AVCodecContext fields as soon as they are parsed
export_stream_params() may not be called in some scenarios, for example leaving both the AVCodecContext and subsequent output frames with the color_trc value taken from the VUI instead of the Alternative Transfer Characteristics SEI. Signed-off-by: James Almer --- libavcodec/hevcdec.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index c1de75abe1..2f1e469c94 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -369,12 +369,6 @@ static void export_stream_params(HEVCContext *s, const HEVCSPS *sps) if (num != 0 && den != 0) av_reduce(&avctx->framerate.den, &avctx->framerate.num, num, den, 1 << 30); - -if (s->sei.alternative_transfer.present && - av_color_transfer_name(s->sei.alternative_transfer.preferred_transfer_characteristics) && -s->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) { -avctx->color_trc = s->sei.alternative_transfer.preferred_transfer_characteristics; -} } static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) @@ -2806,8 +2800,6 @@ static int set_side_data(HEVCContext *s) if (!sd) av_buffer_unref(&a53->buf_ref); a53->buf_ref = NULL; - -s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; } for (int i = 0; i < s->sei.unregistered.nb_buf_ref; i++) { @@ -2853,6 +2845,22 @@ static int set_side_data(HEVCContext *s) return 0; } +static int export_stream_params_from_sei(HEVCContext *s) +{ +AVCodecContext *avctx = s->avctx; + +if (s->sei.a53_caption.buf_ref) +s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; + +if (s->sei.alternative_transfer.present && + av_color_transfer_name(s->sei.alternative_transfer.preferred_transfer_characteristics) && +s->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) { +avctx->color_trc = s->sei.alternative_transfer.preferred_transfer_characteristics; +} + +return 0; +} + static int hevc_frame_start(HEVCContext *s) { HEVCLocalContext *lc = s->HEVClc; @@ -2974,6 +2982,9 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal) goto fail; } ret = ff_hevc_decode_nal_sei(gb, s->avctx, &s->sei, &s->ps, s->nal_unit_type); +if (ret < 0) +goto fail; +ret = export_stream_params_from_sei(s); if (ret < 0) goto fail; break; -- 2.27.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 v2 2/2] avcodec/av1dec: Remove redundant second free
On 9/16/2020 9:08 PM, Andreas Rheinhardt wrote: > The AV1 decoder has the FF_CODEC_CAP_INIT_CLEANUP flag set and yet > the decoder's close function is called manually on some error paths. > This is unnecessary and has been removed in this commit. > > Signed-off-by: Andreas Rheinhardt > --- > Unchanged since last time. > > libavcodec/av1dec.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c > index 871db76b4d..cb46801202 100644 > --- a/libavcodec/av1dec.c > +++ b/libavcodec/av1dec.c > @@ -480,7 +480,6 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) > for (int i = 0; i < FF_ARRAY_ELEMS(s->ref); i++) { > s->ref[i].tf.f = av_frame_alloc(); > if (!s->ref[i].tf.f) { > -av1_decode_free(avctx); > av_log(avctx, AV_LOG_ERROR, > "Failed to allocate reference frame buffer %d.\n", i); > return AVERROR(ENOMEM); > @@ -489,7 +488,6 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) > > s->cur_frame.tf.f = av_frame_alloc(); > if (!s->cur_frame.tf.f) { > -av1_decode_free(avctx); > av_log(avctx, AV_LOG_ERROR, > "Failed to allocate current frame buffer.\n"); > return AVERROR(ENOMEM); > @@ -504,7 +502,7 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) >avctx->extradata_size); > if (ret < 0) { > av_log(avctx, AV_LOG_WARNING, "Failed to read extradata.\n"); > -goto end; > +return ret; > } > > seq = ((CodedBitstreamAV1Context > *)(s->cbc->priv_data))->sequence_header; LGTM. ___ 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] AVFrame.color_trc wrong since f2ad6238e4c0e99e2fc131ee14c586e87b045680
On 9/15/20 9:24 PM, James Almer wrote: On 9/15/2020 10:57 PM, Pavel Koshevoy wrote: that should be color_transfer=arib-std-b67 Would anyone object if I restored previous behavior? I'd prefer avoid reimplementing SEI parsing outside of libav just to get the correct per-frame color_trc... Yes, the point of the change was to set color_trc before the frame buffers were allocated, so a full revert would break that. Can you share the sample that reproduces this? I've privately sent a Google Drive link to James for a different smaller sample that reproduces the same problem, lg_4k_hlg.ts Pavel. ___ 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] avcodec/hevcdec: fix per-frame signaling of color_trc
This is a partial revert of f2ad6238e4c0e99e2fc131ee14c586e87b045680 It fixes per-frame color_trc signaling of arib-std-b67 frames. Reproducible with: ffprobe -show_frames lg_4k_hlg.ts | grep color_transfer= --- libavcodec/hevcdec.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index c1de75abe1..e3d1e3f693 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -2810,6 +2810,12 @@ static int set_side_data(HEVCContext *s) s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; } +if (s->sei.alternative_transfer.present && + av_color_transfer_name(s->sei.alternative_transfer.preferred_transfer_characteristics) && +s->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) { +s->avctx->color_trc = out->color_trc = s->sei.alternative_transfer.preferred_transfer_characteristics; +} + for (int i = 0; i < s->sei.unregistered.nb_buf_ref; i++) { HEVCSEIUnregistered *unreg = &s->sei.unregistered; -- 2.26.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 v2 1/2] avcodec/av1dec: Fix segfault upon allocation error
Up until now, the AV1 decoder always checks before calling its wrapper around ff_thread_release_buffer() whether the ThreadFrame was used at all, i.e. it checked whether the first data buffer of the AVFrame contained therein is NULL or not. Yet this presumes that the AVFrame has been successfully allocated, even though this can of course fail; and if it did, one would encounter a segfault. Fix this by removing the checks altogether: ff_thread_release_buffer() can handle both unallocated as well as empty frames (since commit f6774f905fb3cfdc319523ac640be30b14c1bc55). Signed-off-by: Andreas Rheinhardt --- Removing the checks is based upon a suggestion by James Almer. I have not removed the checks from the other callers of av1_frame_unref() as I don't know how probable it is for the frame to be empty at this point. I tested this as well as I can, but I have no hardware with AV1 hardware acceleration. libavcodec/av1dec.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index bd8acdaafe..871db76b4d 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -388,12 +388,10 @@ static av_cold int av1_decode_free(AVCodecContext *avctx) AV1DecContext *s = avctx->priv_data; for (int i = 0; i < FF_ARRAY_ELEMS(s->ref); i++) { -if (s->ref[i].tf.f->buf[0]) -av1_frame_unref(avctx, &s->ref[i]); +av1_frame_unref(avctx, &s->ref[i]); av_frame_free(&s->ref[i].tf.f); } -if (s->cur_frame.tf.f->buf[0]) -av1_frame_unref(avctx, &s->cur_frame); +av1_frame_unref(avctx, &s->cur_frame); av_frame_free(&s->cur_frame.tf.f); av_buffer_unref(&s->seq_ref); -- 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 v2 2/2] avcodec/av1dec: Remove redundant second free
The AV1 decoder has the FF_CODEC_CAP_INIT_CLEANUP flag set and yet the decoder's close function is called manually on some error paths. This is unnecessary and has been removed in this commit. Signed-off-by: Andreas Rheinhardt --- Unchanged since last time. libavcodec/av1dec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 871db76b4d..cb46801202 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -480,7 +480,6 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) for (int i = 0; i < FF_ARRAY_ELEMS(s->ref); i++) { s->ref[i].tf.f = av_frame_alloc(); if (!s->ref[i].tf.f) { -av1_decode_free(avctx); av_log(avctx, AV_LOG_ERROR, "Failed to allocate reference frame buffer %d.\n", i); return AVERROR(ENOMEM); @@ -489,7 +488,6 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) s->cur_frame.tf.f = av_frame_alloc(); if (!s->cur_frame.tf.f) { -av1_decode_free(avctx); av_log(avctx, AV_LOG_ERROR, "Failed to allocate current frame buffer.\n"); return AVERROR(ENOMEM); @@ -504,7 +502,7 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) avctx->extradata_size); if (ret < 0) { av_log(avctx, AV_LOG_WARNING, "Failed to read extradata.\n"); -goto end; +return ret; } seq = ((CodedBitstreamAV1Context *)(s->cbc->priv_data))->sequence_header; -- 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] web: link GH Actions based Windows-Builds by BtbN
On Wed, Sep 16, 2020 at 01:15:34PM +0200, Timo Rothenpieler wrote: > --- > src/download | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/download b/src/download > index 706d402..0f090b8 100644 > --- a/src/download > +++ b/src/download > @@ -79,6 +79,9 @@ > Windows EXE Files > > > + href="https://github.com/BtbN/FFmpeg-Builds/releases";> > +Windows builds by BtbN > + nice i was wondering (before seeing this) if the binaries built by fate clients could serve as builds. Making the fate client binaries downloadable seemed like an interresting solution too thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Freedom in capitalist society always remains about the same as it was in ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin 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: add DAT CCTV demuxer
On Wed, Sep 16, 2020 at 11:44:01PM +0200, Andreas Rheinhardt wrote: > Paul B Mahol: > > On Sat, Sep 12, 2020 at 11:28:33AM +0200, Paul B Mahol wrote: > >> Signed-off-by: Paul B Mahol > >> --- > >> libavformat/Makefile | 1 + > >> libavformat/allformats.c | 1 + > >> libavformat/luodatdec.c | 129 +++ > >> 3 files changed, 131 insertions(+) > >> create mode 100644 libavformat/luodatdec.c > >> > > > > will apply > > Is this demuxer based upon REing with this one sample from ticket #? > That's not much. Why not ask for more samples in this ticket (with > different settings for his camera)? I have enough samples. Do not worry. Will apply. > > - 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". ___ 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/2] avcodec/wmalosslessdec: Check remaining space before padding and channel residue
On Mon, Sep 14, 2020 at 12:11:02AM +0200, Michael Niedermayer wrote: > Fixes: Timeout (1101sec -> 0.4sec) > Fixes: > 24491/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5725337036783616 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/wmalosslessdec.c | 2 ++ > 1 file changed, 2 insertions(+) will apply patchset [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB it is not once nor twice but times without number that the same ideas make their appearance in the world. -- 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] avformat: add DAT CCTV demuxer
Paul B Mahol: > On Sat, Sep 12, 2020 at 11:28:33AM +0200, Paul B Mahol wrote: >> Signed-off-by: Paul B Mahol >> --- >> libavformat/Makefile | 1 + >> libavformat/allformats.c | 1 + >> libavformat/luodatdec.c | 129 +++ >> 3 files changed, 131 insertions(+) >> create mode 100644 libavformat/luodatdec.c >> > > will apply Is this demuxer based upon REing with this one sample from ticket #? That's not much. Why not ask for more samples in this ticket (with different settings for his camera)? - 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] avformat: add DAT CCTV demuxer
On Sat, Sep 12, 2020 at 11:28:33AM +0200, Paul B Mahol wrote: > Signed-off-by: Paul B Mahol > --- > libavformat/Makefile | 1 + > libavformat/allformats.c | 1 + > libavformat/luodatdec.c | 129 +++ > 3 files changed, 131 insertions(+) > create mode 100644 libavformat/luodatdec.c > will apply ___ 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] libavformat/rmdec.c: Fix Use-of-uninitialized-value in ff_codec_get_id
On Mon, Sep 14, 2020 at 10:49 AM Thierry Foucu wrote: > In case the pb does not contain 4 bytes, the buf[256] will not be > initialize before we pass it to ff_codec_get_id > --- > libavformat/rmdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c > index a36e693ab2..220aa8aee2 100644 > --- a/libavformat/rmdec.c > +++ b/libavformat/rmdec.c > @@ -180,12 +180,12 @@ static int rm_read_audio_stream_info(AVFormatContext > *s, AVIOContext *pb, > st->codecpar->sample_rate = avio_rb16(pb); > avio_rb32(pb); > st->codecpar->channels = avio_rb16(pb); > +AV_WL32(buf, 0); > if (version == 5) { > ast->deint_id = avio_rl32(pb); > avio_read(pb, buf, 4); > buf[4] = 0; > } else { > -AV_WL32(buf, 0); > get_str8(pb, buf, sizeof(buf)); /* desc */ > ast->deint_id = AV_RL32(buf); > get_str8(pb, buf, sizeof(buf)); /* desc */ > -- > 2.28.0.618.gf4bc123cb7-goog > > ping? -- Thierry Foucu ___ 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/2] web/download: remove Zeranoe links
On Wed Sep 16 12:23:52 EEST 2020 Gyan wrote: > ffmpeg.zeranoe.com will close on Sep 18, 2020 > > Last published builds are from Aug 31 2020. > --- > src/download | 6 -- > 1 file changed, 6 deletions(-) Patchset pushed. 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 1/2] web/download: remove Zeranoe links
Great. I'll use that in the future. Thanks Tom On Wed, 16 Sep 2020, 14:27 James Almer, wrote: > On 9/16/2020 10:00 AM, Tom Needham wrote: > > Is there a known alternative for windows which provides the same features > > of Zeranoe? If not I would be interested in setting something up but I'm > > having trouble building all the external libs for windows. If anyone has > > any tips or guidance please let me know. > > > > Thanks > > Tom > > Timo Rothenpieler set up https://github.com/BtbN/FFmpeg-Builds/releases > as a replacement. The link will be added to ffmpeg.org 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". ___ 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] avformat/aviobuf: fix broken logic in ffio_ensure_seekback()
This removes big CPU overhead for demuxing chained ogg streams. Signed-off-by: Paul B Mahol --- libavformat/aviobuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index a77517d712..9dfef2377e 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -999,10 +999,10 @@ int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size) int filled = s->buf_end - s->buffer; ptrdiff_t checksum_ptr_offset = s->checksum_ptr ? s->checksum_ptr - s->buffer : -1; -buf_size += s->buf_ptr - s->buffer + max_buffer_size; - if (buf_size < filled || s->seekable || !s->read_packet) return 0; +buf_size += s->buf_end - s->buf_ptr + max_buffer_size; + av_assert0(!s->write_flag); buffer = av_malloc(buf_size); -- 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 0/6] qsv: Fix compiler errors when using libmfx 2.0 (oneVPL)
> -Original Message- > From: ffmpeg-devel On Behalf Of > Xiang, Haihao > Sent: Wednesday, September 16, 2020 10:30 AM > To: ffmpeg-devel@ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH 0/6] qsv: Fix compiler errors when using > libmfx 2.0 (oneVPL) > > On Wed, 2020-09-16 at 08:12 +, Soft Works wrote: > > > -Original Message- > > > From: ffmpeg-devel On Behalf Of > > > Haihao Xiang > > > Sent: Wednesday, September 16, 2020 8:45 AM > > > To: ffmpeg-devel@ffmpeg.org > > > Cc: Haihao Xiang > > > Subject: [FFmpeg-devel] [PATCH 0/6] qsv: Fix compiler errors when > > > using libmfx 2.0 (oneVPL) > > > > > > The oneAPI Video Processing Library (oneVPL) is a single interface > > > for encode, decode and video processing, the obsolete features in > > > Intel Media Software Development Kit are removed from oneVPL. > > > > > > The oneVPL specification: > > > > https://spec.oneapi.com/versions/latest/elements/oneVPL/source/index > > > .ht > > > ml > > > The oneVPL source code: > > > https://github.com/oneapi-src/oneVPL > > > > > > Haihao Xiang (6): > > > qsv: add ${includedir}/mfx to the search path for old versions of > > > libmfx > > > qsv: libmfx no longer supports user plugin since version 2.0 (oneVPL) > > > qsv: libmfx no longer supports audio since version 2.0 (oneVPL) > > > qsvenc: libmfx no longer supports multi-frame encode since version 2.0 > > > (oneVPL) > > > qsvenc: libmfx no longer supports MFX_RATECONTROL_LA_EXT since > > > version > > > 2.0 (oneVPL) > > > qsv: libmfx no longer supports OPAQUE memory since version 2.0 > > > (oneVPL) > > > > Hi, > > > > MFX => ClearVideo => QuickSync => MediaSDK => oneVPL > > > > Is there actually something new in "oneVPL 2.0" or is this just MSDK > > 1.34 with many things removed and once another name added? > > You may refer to > https://spec.oneapi.com/versions/latest/elements/oneVPL/source/VPL_int > el_media_sdk.html#new-apis-in-onevpl > for the new APIs/features. Hi, Thanks for the link. So, at this time there doesn't seem to be anything where ffmpeg would benefit from using it. Hopefully there will be something interesting in the future. > > > > PS: How about VPP tone-mapping? > > Do you mean libmfx based tone-mapping? Yes, correct. The implementation already exists in VAAPI, but afaik it is not yet available via libmfx. Do you know about any plans regarding this? Thanks and kind regards, softworkz ___ 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] avfilter/vf_scale: set RGB to always be full range
On Wed, Sep 16, 2020 at 11:38 PM Michael Niedermayer wrote: > > On Wed, Sep 16, 2020 at 12:16:43AM +0300, Jan Ekström wrote: > > This value - while it looks like the actual range of the content - > > is nothing but the internal value of swscale. > > > > Thus, if we have RGB content, force the value to 1. Swscale will > > ignore it, but at least the value of the output AVFrame will now > > properly be "full range" instead of "limited range", as it is right > > now. > > --- > > libavfilter/vf_scale.c | 17 + > > 1 file changed, 17 insertions(+) > > > > diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c > > index 58eee96744..12df27edf4 100644 > > --- a/libavfilter/vf_scale.c > > +++ b/libavfilter/vf_scale.c > [...] > > @@ -768,7 +777,15 @@ scale: > > else if (in_range != AVCOL_RANGE_UNSPECIFIED) > > in_full = (in_range == AVCOL_RANGE_JPEG); > > if (scale->out_range != AVCOL_RANGE_UNSPECIFIED) > > +// note: this can be silently overridden by > > +// sws_setColorspaceDetails for non-YCbCr formats > > out_full = (scale->out_range == AVCOL_RANGE_JPEG); > > +else if (out_desc->flags & AV_PIX_FMT_FLAG_RGB) > > +// the range values received from swscale are its internal > > +// identifiers, and will not be nonzero for any sort of RGB. > > +// thus, if we do not set it to nonzero ourselves, this will > > +// be incorrect. > > +out_full = 1; > > Does anything document the meaning of range or AVCOL_RANGE for RGB ? > The enum is documented as "MPEG vs JPEG YUV range." > > What is limited range RGB ? what would the ranges of R,G,B be and where > is that specified ? > > That said, changing it to full range for RGB as done by this patch is > probably ok if it helps some code (for example allows simplifications) > I am not here to say that we would have to support limited range RGB, which I mostly only see mentioned as the PC graphics output for devices such as video projectors. The problem is just that vf_scale took that internal swscale flag and attempted to interpret that as full|limited range flag as-is. Anyways, posted a v2 which actually verifies the requested flags against the actually configured ones, while keeping the translation between swscale internal value and "is this stuff going to be full range or not". Possibly simpler to follow/read than this one :) , even though clearly more complex. Jan ___ 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] avfilter/vf_scale: set RGB to always be full range
On Wed, Sep 16, 2020 at 12:16:43AM +0300, Jan Ekström wrote: > This value - while it looks like the actual range of the content - > is nothing but the internal value of swscale. > > Thus, if we have RGB content, force the value to 1. Swscale will > ignore it, but at least the value of the output AVFrame will now > properly be "full range" instead of "limited range", as it is right > now. > --- > libavfilter/vf_scale.c | 17 + > 1 file changed, 17 insertions(+) > > diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c > index 58eee96744..12df27edf4 100644 > --- a/libavfilter/vf_scale.c > +++ b/libavfilter/vf_scale.c [...] > @@ -768,7 +777,15 @@ scale: > else if (in_range != AVCOL_RANGE_UNSPECIFIED) > in_full = (in_range == AVCOL_RANGE_JPEG); > if (scale->out_range != AVCOL_RANGE_UNSPECIFIED) > +// note: this can be silently overridden by > +// sws_setColorspaceDetails for non-YCbCr formats > out_full = (scale->out_range == AVCOL_RANGE_JPEG); > +else if (out_desc->flags & AV_PIX_FMT_FLAG_RGB) > +// the range values received from swscale are its internal > +// identifiers, and will not be nonzero for any sort of RGB. > +// thus, if we do not set it to nonzero ourselves, this will > +// be incorrect. > +out_full = 1; Does anything document the meaning of range or AVCOL_RANGE for RGB ? The enum is documented as "MPEG vs JPEG YUV range." What is limited range RGB ? what would the ranges of R,G,B be and where is that specified ? That said, changing it to full range for RGB as done by this patch is probably ok if it helps some code (for example allows simplifications) thx [...] -- 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".
[FFmpeg-devel] [PATCH v2] avfilter/vf_scale: translate and verify swscale internal range flag
This value - while it looks like the actual range of the content - is nothing but the internal value of swscale. Thus, if we have RGB content, force the value to 1. Swscale will ignore it, but at least the value of the output AVFrame will now properly be "full range" instead of "limited range", as it is right now. Additionally, after calling sws_setColorspaceDetails double-check the configured internal flag for the color range. Warn if this is different to the requested value. Finally, utilize the translated configured output value into the output AVFrame's color_range. --- libavfilter/vf_scale.c | 51 +- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index 58eee96744..592e4a344e 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -750,11 +750,30 @@ scale: || in_range != AVCOL_RANGE_UNSPECIFIED || scale->out_range != AVCOL_RANGE_UNSPECIFIED) { int in_full, out_full, brightness, contrast, saturation; +int configured_in_full_range_flag, configured_out_full_range_flag; const int *inv_table, *table; +const AVPixFmtDescriptor *in_desc = av_pix_fmt_desc_get(in->format); +const AVPixFmtDescriptor *out_desc = av_pix_fmt_desc_get(out->format); +if (!in_desc || !out_desc) { +av_log(ctx, AV_LOG_ERROR, + "Failed to get one or more of the pixel format descriptors " + "for formats - in: %d (%s), out: %d (%s)!\n", + in->format, in_desc ? "OK" : "bad", + out->format, out_desc ? "OK": "bad"); +av_frame_free(&in); +av_frame_free(frame_out); +return AVERROR_INVALIDDATA; +} sws_getColorspaceDetails(scale->sws, (int **)&inv_table, &in_full, (int **)&table, &out_full, &brightness, &contrast, &saturation); +// translate the swscale internal range flags to hold true +// for RGB +in_full = in_desc->flags & AV_PIX_FMT_FLAG_RGB ? + 1 : in_full; +out_full = out_desc->flags & AV_PIX_FMT_FLAG_RGB ? + 1 : out_full; if (scale->in_color_matrix) inv_table = parse_yuv_type(scale->in_color_matrix, in->colorspace); @@ -782,7 +801,37 @@ scale: table, out_full, brightness, contrast, saturation); -out->color_range = out_full ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; +// double-check what was actually just configured, +// since swscale can silently ignore the color range +// value in sws_setColorspaceDetails. +sws_getColorspaceDetails(scale->sws, (int **)&inv_table, + &configured_in_full_range_flag, + (int **)&table, + &configured_out_full_range_flag, + &brightness, &contrast, &saturation); + +// translate the actually configured internal range flags to hold true +// for RGB as well. +configured_in_full_range_flag = in_desc->flags & AV_PIX_FMT_FLAG_RGB ? +1 : configured_in_full_range_flag; +configured_out_full_range_flag = out_desc->flags & AV_PIX_FMT_FLAG_RGB ? + 1 : configured_out_full_range_flag; + +if (in_full != configured_in_full_range_flag || +out_full != configured_out_full_range_flag) { +av_log(ctx, AV_LOG_WARNING, + "swscale overrode set input/output range value as it " + "considered it an invalid configuration! " + "(input: requested: %s, configured: %s), " + "(output: requested: %s, configured: %s)!\n", + in_full ? "full" : "limited", + configured_in_full_range_flag ? "full" : "limited", + out_full ? "full" : "limited", + configured_out_full_range_flag ? "full" : "limited"); +} + +out->color_range = configured_out_full_range_flag ? + AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG; } av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den, -- 2.26.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".
Re: [FFmpeg-devel] [PATCH] avformat/aviobuf: fix broken logic in ffio_ensure_seekback()
Paul B Mahol: > This removes big CPU overhead for demuxing chained ogg streams. > > Signed-off-by: Paul B Mahol > --- > libavformat/aviobuf.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c > index a77517d712..88cc0b4030 100644 > --- a/libavformat/aviobuf.c > +++ b/libavformat/aviobuf.c > @@ -999,8 +999,6 @@ int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size) > int filled = s->buf_end - s->buffer; > ptrdiff_t checksum_ptr_offset = s->checksum_ptr ? s->checksum_ptr - > s->buffer : -1; > > -buf_size += s->buf_ptr - s->buffer + max_buffer_size; > - > if (buf_size < filled || s->seekable || !s->read_packet) > return 0; > av_assert0(!s->write_flag); > This will make the buffer smaller (even very small) if not enough data is in the buffer (and if it is unseekable). There are several users of this function that use quite small numbers and if the buffer got shrunk, future I/O operations will be really slow. - 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".
[FFmpeg-devel] [PATCH] avformat/aviobuf: fix broken logic in ffio_ensure_seekback()
This removes big CPU overhead for demuxing chained ogg streams. Signed-off-by: Paul B Mahol --- libavformat/aviobuf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index a77517d712..88cc0b4030 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -999,8 +999,6 @@ int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size) int filled = s->buf_end - s->buffer; ptrdiff_t checksum_ptr_offset = s->checksum_ptr ? s->checksum_ptr - s->buffer : -1; -buf_size += s->buf_ptr - s->buffer + max_buffer_size; - if (buf_size < filled || s->seekable || !s->read_packet) return 0; av_assert0(!s->write_flag); -- 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] avformat/aviobuf: fix broken logic in ffio_ensure_seekback()
Paul B Mahol: > This removes big CPU overhead for demuxing chained ogg streams. > > Signed-off-by: Paul B Mahol > --- > libavformat/aviobuf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c > index a77517d712..c27d564602 100644 > --- a/libavformat/aviobuf.c > +++ b/libavformat/aviobuf.c > @@ -999,7 +999,7 @@ int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size) > int filled = s->buf_end - s->buffer; > ptrdiff_t checksum_ptr_offset = s->checksum_ptr ? s->checksum_ptr - > s->buffer : -1; > > -buf_size += s->buf_ptr - s->buffer + max_buffer_size; > +buf_size += (s->buf_end - s->buf_ptr) + max_buffer_size; > > if (buf_size < filled || s->seekable || !s->read_packet) > return 0; > Wouldn't it actually be enough to check whether buf_size < filled (which should probably be renamed to available) without adding anything to buf_size at all (at least not before doing the check)? (Btw: avio_seek() does not always perform seeks within the buffer, even when it could: It doesn't do so if the direct flag is set and if there is a seek function; but does the existence of the latter really imply that the stream is actually seekable?) - 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".
[FFmpeg-devel] [PATCH] avformat/aviobuf: fix broken logic in ffio_ensure_seekback()
This removes big CPU overhead for demuxing chained ogg streams. Signed-off-by: Paul B Mahol --- libavformat/aviobuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index a77517d712..c27d564602 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -999,7 +999,7 @@ int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size) int filled = s->buf_end - s->buffer; ptrdiff_t checksum_ptr_offset = s->checksum_ptr ? s->checksum_ptr - s->buffer : -1; -buf_size += s->buf_ptr - s->buffer + max_buffer_size; +buf_size += (s->buf_end - s->buf_ptr) + max_buffer_size; if (buf_size < filled || s->seekable || !s->read_packet) return 0; -- 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] fate: add scale filters for big-endian architectures.
Michael Niedermayer: > On Mon, Sep 14, 2020 at 09:26:53PM +0200, Nicolas George wrote: >> Filters mostly work in native endianness, but they must output >> a specified endianness, usually little: that requires a final >> conversion for big endian. >> >> I do not know what's the deal with gif-deal: inserting explicitly > > I think this is a typo I thought the same upon reading, but we really have a gif-deal test and it is the only one where Nicolas has enabled auto_conversion_filters. > > >> the filters that are implicitly inserted result in less frames in >> output. Probably a strange problem of duration. >> >> Signed-off-by: Nicolas George >> --- >> tests/fate/bmp.mak | 6 +++--- >> tests/fate/dnxhd.mak| 4 ++-- >> tests/fate/filter-video.mak | 18 +- >> tests/fate/fits.mak | 8 >> tests/fate/gif.mak | 10 +- >> tests/fate/h264.mak | 34 +- >> tests/fate/hevc.mak | 12 ++-- >> tests/fate/image.mak| 2 +- >> tests/fate/microsoft.mak| 4 ++-- >> tests/fate/pixlet.mak | 2 +- >> tests/fate/prores.mak | 16 >> tests/fate/video.mak| 16 >> tests/fate/vpx.mak | 4 ++-- >> 13 files changed, 68 insertions(+), 68 deletions(-) > > confirmed to work on qemu mips > so should be ok > > thx > > [...] > > > ___ > 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] fate: add scale filters for big-endian architectures.
On Mon, Sep 14, 2020 at 09:26:53PM +0200, Nicolas George wrote: > Filters mostly work in native endianness, but they must output > a specified endianness, usually little: that requires a final > conversion for big endian. > > I do not know what's the deal with gif-deal: inserting explicitly I think this is a typo > the filters that are implicitly inserted result in less frames in > output. Probably a strange problem of duration. > > Signed-off-by: Nicolas George > --- > tests/fate/bmp.mak | 6 +++--- > tests/fate/dnxhd.mak| 4 ++-- > tests/fate/filter-video.mak | 18 +- > tests/fate/fits.mak | 8 > tests/fate/gif.mak | 10 +- > tests/fate/h264.mak | 34 +- > tests/fate/hevc.mak | 12 ++-- > tests/fate/image.mak| 2 +- > tests/fate/microsoft.mak| 4 ++-- > tests/fate/pixlet.mak | 2 +- > tests/fate/prores.mak | 16 > tests/fate/video.mak| 16 > tests/fate/vpx.mak | 4 ++-- > 13 files changed, 68 insertions(+), 68 deletions(-) confirmed to work on qemu mips so should be ok thx [...] -- 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 39/40] avcodec/ffv1: Simplify cleanup after allocation failure
On Mon, Sep 14, 2020 at 07:27:46AM +0200, Andreas Rheinhardt wrote: > Now that ff_ffv1_close() for both the FFV1 encoder and decoder, > the code contained therein can be used to free the partially allocated > slice contexts if allocating the slice contexts failed. One just has to > set the correct number of slice contexts on error. This allows to remove > the code for freeing partially allocated slice contexts in > ff_ffv1_init_slice_contexts(). > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/ffv1.c | 16 > 1 file changed, 4 insertions(+), 12 deletions(-) LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Nations do behave wisely once they have exhausted all other alternatives. -- Abba Eban 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 37/40] avcodec/ffv1: Fix segfaults on allocation error
On Mon, Sep 14, 2020 at 07:27:44AM +0200, Andreas Rheinhardt wrote: > When allocating FFV1 slice contexts fails, ff_ffv1_init_slice_contexts() > frees everything that it has allocated, yet it does not reset the > counter for the number of allocated slice contexts. This inconsistent > state leads to segfaults lateron in ff_ffv1_close(), because said > function presumes that the slice contexts have been allocated. > Fix this by making sure that the number of slice contexts on error is > consistent (namely zero). > > (This issue only affected the FFV1 decoder, because the encoder does not > clean up after itself on init failure.) > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/ffv1.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) LGTM thx -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Modern terrorism, a quick summary: Need oil, start war with country that has oil, kill hundread thousand in war. Let country fall into chaos, be surprised about raise of fundamantalists. Drop more bombs, kill more people, be surprised about them taking revenge and drop even more bombs and strip your own citizens of their rights and freedoms. to be continued 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 38/40] avcodec/ffv1enc: Fix memleaks on init failure
On Mon, Sep 14, 2020 at 07:27:45AM +0200, Andreas Rheinhardt wrote: > The FFV1 encoder has so far not cleaned up after itself in this case; > but it can be done easily by setting the FF_CODEC_CAP_INIT_CLEANUP flag. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/ffv1enc.c | 1 + > 1 file changed, 1 insertion(+) probably ok thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB "I am not trying to be anyone's saviour, I'm trying to think about the future and not be sad" - Elon Musk 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/aviobuf: realloc memory in ffio_ensure_seekback()
On Tue, Sep 15, 2020 at 01:35:25PM +0200, Paul B Mahol wrote: > This removes big CPU overhead for demuxing chained ogg streams. > > Signed-off-by: Paul B Mahol > --- > libavformat/aviobuf.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c > index a77517d712..6d01150f66 100644 > --- a/libavformat/aviobuf.c > +++ b/libavformat/aviobuf.c > @@ -1005,12 +1005,11 @@ int ffio_ensure_seekback(AVIOContext *s, int64_t > buf_size) > return 0; > av_assert0(!s->write_flag); > > -buffer = av_malloc(buf_size); > +buffer = s->buffer; > +buffer = av_realloc(buffer, buf_size); > if (!buffer) > return AVERROR(ENOMEM); This would reduce the guranteed alignment. If that is not an issue then this patch could be ok thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends. -- Gandalf 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] avfilter/vf_scale: set RGB to always be full range
Jan Ekström (12020-09-16): > This value - while it looks like the actual range of the content - > is nothing but the internal value of swscale. > > Thus, if we have RGB content, force the value to 1. Swscale will > ignore it, but at least the value of the output AVFrame will now > properly be "full range" instead of "limited range", as it is right > now. > --- > libavfilter/vf_scale.c | 17 + > 1 file changed, 17 insertions(+) > > diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c > index 58eee96744..12df27edf4 100644 > --- a/libavfilter/vf_scale.c > +++ b/libavfilter/vf_scale.c > @@ -751,6 +751,15 @@ scale: > || scale->out_range != AVCOL_RANGE_UNSPECIFIED) { > int in_full, out_full, brightness, contrast, saturation; > const int *inv_table, *table; > +const AVPixFmtDescriptor *out_desc = > av_pix_fmt_desc_get(out->format); > +if (!out_desc) { > +av_log(ctx, AV_LOG_ERROR, > + "Failed to get the pixel format descriptor for format > %d!\n", > + out->format); > +av_frame_free(&in); > +av_frame_free(frame_out); > +return AVERROR_INVALIDDATA; > +} Since the format is negotiated, I think it can be considered a severe internal bug that out_desc is not found, i.e. checked by an assert. > > sws_getColorspaceDetails(scale->sws, (int **)&inv_table, &in_full, > (int **)&table, &out_full, > @@ -768,7 +777,15 @@ scale: > else if (in_range != AVCOL_RANGE_UNSPECIFIED) > in_full = (in_range == AVCOL_RANGE_JPEG); > if (scale->out_range != AVCOL_RANGE_UNSPECIFIED) > +// note: this can be silently overridden by > +// sws_setColorspaceDetails for non-YCbCr formats > out_full = (scale->out_range == AVCOL_RANGE_JPEG); > +else if (out_desc->flags & AV_PIX_FMT_FLAG_RGB) > +// the range values received from swscale are its internal > +// identifiers, and will not be nonzero for any sort of RGB. > +// thus, if we do not set it to nonzero ourselves, this will > +// be incorrect. > +out_full = 1; > > sws_setColorspaceDetails(scale->sws, inv_table, in_full, > table, out_full, With you explanation, I think it is ok, but I do not know the topic enough to be sure. Regards, -- Nicolas George 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: link GH Actions based Windows-Builds by BtbN
On Wed, Sep 16, 2020 at 2:16 PM Timo Rothenpieler wrote: > > --- > src/download | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/src/download b/src/download > index 706d402..0f090b8 100644 > --- a/src/download > +++ b/src/download > @@ -79,6 +79,9 @@ > Windows EXE Files > > > + href="https://github.com/BtbN/FFmpeg-Builds/releases";> > +Windows builds by BtbN > + > > > > -- > 2.25.1 > I'd say this is quite acceptable: - Community member. - Is on IRC so can be easily contacted. - Whole setup is open source on github. Thus anyone wanting to duplicate should be capable of doing it relatively easily. Jan ___ 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/2] web/download: remove Zeranoe links
On 9/16/2020 10:00 AM, Tom Needham wrote: > Is there a known alternative for windows which provides the same features > of Zeranoe? If not I would be interested in setting something up but I'm > having trouble building all the external libs for windows. If anyone has > any tips or guidance please let me know. > > Thanks > Tom Timo Rothenpieler set up https://github.com/BtbN/FFmpeg-Builds/releases as a replacement. The link will be added to ffmpeg.org 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 1/2] web/download: remove Zeranoe links
Is there a known alternative for windows which provides the same features of Zeranoe? If not I would be interested in setting something up but I'm having trouble building all the external libs for windows. If anyone has any tips or guidance please let me know. Thanks Tom On Wed, 16 Sep 2020 at 11:56, Steven Liu wrote: > Gyan Doshi 于2020年9月16日周三 下午5:24写道: > > > > ffmpeg.zeranoe.com will close on Sep 18, 2020 > > > > Last published builds are from Aug 31 2020. > > --- > > src/download | 6 -- > > 1 file changed, 6 deletions(-) > > > > diff --git a/src/download b/src/download > > index 02e2fe7..34fa093 100644 > > --- a/src/download > > +++ b/src/download > > @@ -79,9 +79,6 @@ > > Windows EXE Files > > > > > > - https://ffmpeg.zeranoe.com/builds/";> > > -Windows builds by Zeranoe > > - > > > > > > > > @@ -93,9 +90,6 @@ > >https://evermeet.cx/ffmpeg/";> > > Static builds for macOS 64-bit > > > > - https://ffmpeg.zeranoe.com/builds/";> > > -Static and shared builds for macOS > 64-bit > > - > > > > > > > > -- > > 2.27.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". > > lgtm > > Thanks > Steven > ___ > 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] .NET video processing with FFMPEG
There is a great wrapper for invoking FFmpeg in .NET available here https://github.com/tomaszzmuda/Xabe.FFmpeg/ however it does not support calling the C API directly. I am not aware of any tools or libraries that have this functionality. Thanks Tom On Wed, 16 Sep 2020 at 12:06, Timo Rothenpieler wrote: > The ffmpeg project does not provide any bindings for other languages > that can't interact with a C API on their own. > You will have to find and talk to the author of that wrapper. > ___ > 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] web: link GH Actions based Windows-Builds by BtbN
--- src/download | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/download b/src/download index 706d402..0f090b8 100644 --- a/src/download +++ b/src/download @@ -79,6 +79,9 @@ Windows EXE Files + https://github.com/BtbN/FFmpeg-Builds/releases";> +Windows builds by BtbN + -- 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] WHIP - Webrtc Http Ingest Protocol
On 11/09/2020 22:51, Kieran Kunhya wrote: Because when you have a WebRTC server/service, you need WebRTC ingest. You may be surprised by the amount of mixed RTC/streaming services that are being implemented as we speak since COVID. Why is that the case? Mainly because if you already have WebRTC implemented in your server for receiving and delivering media from and to the web browsers, it is much easier to implement and to maintain a webrtc ingest than add SRT. Basically, you don't have to do anything new, neither maintain two different input paths, solve bugs, monitoring, stats, etc. Also, WebRTC offers some end to end capabilities that are very difficult (if possible) to maintain if you mix protocols. I don't want to enter in a protocol comparative, but keeping a good quality with the lowest delay is not feasible if you mix protocols. Not taking into account the extra cpu cost for protocol conversion (may be minimal, but when you handle hundreds of connections in a server, everything adds up), with webrtc you just need to forward rtp packets on server with minimal state. If we have to do transcoding (for example AAC to OPUS in RTMP) things get much worse. Again, this might be not useful for the non-webrtc community, but I can tell you that it would help A LOT to the ones that are doing webrtc. Best regards Sergio ___ 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] .NET video processing with FFMPEG
The ffmpeg project does not provide any bindings for other languages that can't interact with a C API on their own. You will have to find and talk to the author of that wrapper. ___ 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/2] web/download: remove Zeranoe links
Gyan Doshi 于2020年9月16日周三 下午5:24写道: > > ffmpeg.zeranoe.com will close on Sep 18, 2020 > > Last published builds are from Aug 31 2020. > --- > src/download | 6 -- > 1 file changed, 6 deletions(-) > > diff --git a/src/download b/src/download > index 02e2fe7..34fa093 100644 > --- a/src/download > +++ b/src/download > @@ -79,9 +79,6 @@ > Windows EXE Files > > > - href="https://ffmpeg.zeranoe.com/builds/";> > -Windows builds by Zeranoe > - > > > > @@ -93,9 +90,6 @@ >https://evermeet.cx/ffmpeg/";> > Static builds for macOS 64-bit > > - href="https://ffmpeg.zeranoe.com/builds/";> > -Static and shared builds for macOS 64-bit > - > > > > -- > 2.27.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". lgtm Thanks Steven ___ 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/5] avformat/argo_asf: add ff_argo_asf_read()
On Wed, 16 Sep 2020 11:26:55 +0200 "Paul B Mahol" wrote: > > +pkt->stream_index = st->index; > > +pkt->duration = ckhdr->num_samples * (ret / > > st->codecpar->block_align); > > +*blocks_read += (ret / st->codecpar->block_align); > > This line breaks seeking. > > Ultimately you want to support seeking in demuxer(s). This isn't a seekable format, each block depends on the previous. There's nowhere to seek to other than the start. ___ 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/4 v2] ffmpeg: move A/V non-streamcopy initialization to a later point
On Wed, Sep 16, 2020 at 12:24 AM Michael Niedermayer wrote: > > On Mon, Sep 14, 2020 at 12:33:14AM +0300, Jan Ekström wrote: > > - For video, this means a single initialization point in do_video_out. > > - For audio we unfortunately need to do it in two places just > > before the buffer sink is utilized (if av_buffersink_get_samples > > would still work according to its specification after a call to > > avfilter_graph_request_oldest was made, we could at least remove > > the one in transcode_step). > > > > Other adjustments to make things work: > > - As the AVFrame PTS adjustment to encoder time base needs the encoder > > to be initialized, so it is now moved to do_{video,audio}_out, > > right after the encoder has been initialized. Due to this, > > the additional parameter in do_video_out is removed as it is no > > longer necessary. > > --- > > fftools/ffmpeg.c | 112 --- > > 1 file changed, 77 insertions(+), 35 deletions(-) > > breaks this: > ./ffmpeg -ss 30.0 -i ~/tickets/1745/1745-Sample.mkv -f vob -c:a copy > -bitexact -t 1 -f framecrc - > (sample file is linked in the ticket https://trac.ffmpeg.org/ticket/1745) > > (Too many packets buffered for output stream 0:1. Conversion failed!) > > thx With an initial look with -debug_ts -v verbose -max_muxing_queue_size 1 , it appears that audio packets start at about -5.5 seconds, and video is getting skipped until an exact zero point is hit. So either the offset is incorrect, or we should also be dropping the audio packets as well until zero point is found. Jan ___ 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 v3 2/2] dnn_backend_native_layer_conv2d.c: refine code.
From: Xu Jun Move thread area allocate out of thread function into main thread. Signed-off-by: Xu Jun --- .../dnn/dnn_backend_native_layer_conv2d.c | 30 +-- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c index 5c313454f7..2aaa4162df 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c +++ b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c @@ -33,12 +33,11 @@ typedef struct thread_common_param{ const void *parameters; NativeContext *ctx; float *output_data; -int thread_num; } thread_common_param; typedef struct thread_param{ thread_common_param *thread_common_param; -int thread_index; +int thread_start, thread_end; } thread_param; int dnn_load_layer_conv2d(Layer *layer, AVIOContext *model_file_context, int file_size, int operands_num) @@ -125,16 +124,12 @@ static void * dnn_execute_layer_conv2d_thread(void *threadarg) int filter_size = conv_params->kernel_size * filter_linesize; int pad_size = (conv_params->padding_method == VALID) ? (conv_params->kernel_size - 1) / 2 * conv_params->dilation : 0; -int thread_stride = (height - pad_size * 2) / thread_common_param->thread_num; -int thread_start = thread_stride * thread_param->thread_index + pad_size; -int thread_end = (thread_param->thread_index == thread_common_param->thread_num - 1) ? (height - pad_size) : (thread_start + thread_stride); - float *output = thread_common_param->output_data; -output += (conv_params->output_num) * (width - 2 * pad_size) * (thread_start - pad_size); +output += (conv_params->output_num) * (width - 2 * pad_size) * (thread_param->thread_start - pad_size); av_assert0(channel == conv_params->input_num); -for (int y = thread_start; y < thread_end; ++y) { +for (int y = thread_param->thread_start; y < thread_param->thread_end; ++y) { for (int x = pad_size; x < width - pad_size; ++x) { for (int n_filter = 0; n_filter < conv_params->output_num; ++n_filter) { if (conv_params->has_bias) @@ -193,16 +188,19 @@ int dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_ ? (av_cpu_count() + 1) : (ctx->options.conv2d_threads); #if HAVE_PTHREAD_CANCEL pthread_t *thread_id = av_malloc(thread_num * sizeof(pthread_t)); +int thread_stride; #endif thread_param **thread_param = av_malloc(thread_num * sizeof(*thread_param)); thread_common_param thread_common_param; const ConvolutionalParams *conv_params = (const ConvolutionalParams *)(parameters); +int height = operands[input_operand_indexes[0]].dims[1]; +int width = operands[input_operand_indexes[0]].dims[2]; int pad_size = (conv_params->padding_method == VALID) ? (conv_params->kernel_size - 1) / 2 * conv_params->dilation : 0; DnnOperand *output_operand = &operands[output_operand_index]; output_operand->dims[0] = operands[input_operand_indexes[0]].dims[0]; -output_operand->dims[1] = operands[input_operand_indexes[0]].dims[1] - pad_size * 2; -output_operand->dims[2] = operands[input_operand_indexes[0]].dims[2] - pad_size * 2; +output_operand->dims[1] = height - pad_size * 2; +output_operand->dims[2] = width - pad_size * 2; output_operand->dims[3] = conv_params->output_num; output_operand->data_type = operands[input_operand_indexes[0]].data_type; output_operand->length = calculate_operand_data_length(output_operand); @@ -223,13 +221,13 @@ int dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_ thread_common_param.ctx = ctx; #if HAVE_PTHREAD_CANCEL -thread_common_param.thread_num = thread_num; - +thread_stride = (height - pad_size * 2) / thread_num; //create threads for (int i = 0; i < thread_num; i++){ thread_param[i] = av_malloc(sizeof(**thread_param)); thread_param[i]->thread_common_param = &thread_common_param; -thread_param[i]->thread_index = i; +thread_param[i]->thread_start = thread_stride * i + pad_size; +thread_param[i]->thread_end = (i == thread_num - 1) ? (height - pad_size) : (thread_param[i]->thread_start + thread_stride); pthread_create(&thread_id[i], NULL, dnn_execute_layer_conv2d_thread, (void *)thread_param[i]); } @@ -245,10 +243,10 @@ int dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_ av_free(thread_param[i]); } #else -thread_common_param.thread_num = 1; -thread_param[0] = av_malloc(sizeof(thread_param)); +thread_param[0] = av_malloc(sizeof(**thread_param)); thread_param[0]->thread_common_param = &thread_common_param; -thread_param[0]->thread_index = 0; +thread_param[0]->thread_start = 0; +thread_param[0]->thread_end = height - pad_size; dnn_execute_layer_conv2d_thread((void *)thread_param
[FFmpeg-devel] [PATCH v3 1/2] dnn_backend_native_layer_conv2d.c: fix memory allocation bug in multithread function.
From: Xu Jun Before patch, memory was allocated in each thread functions, which may cause more than one time of memory allocation and cause crash. After patch, memory is allocated in the main thread once, an index was parsed into thread functions. Bug fixed. Signed-off-by: Xu Jun --- v3: fix build warnings .../dnn/dnn_backend_native_layer_conv2d.c | 57 +-- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c index c52725aa2b..5c313454f7 100644 --- a/libavfilter/dnn/dnn_backend_native_layer_conv2d.c +++ b/libavfilter/dnn/dnn_backend_native_layer_conv2d.c @@ -32,6 +32,7 @@ typedef struct thread_common_param{ int32_t output_operand_index; const void *parameters; NativeContext *ctx; +float *output_data; int thread_num; } thread_common_param; @@ -111,9 +112,7 @@ static void * dnn_execute_layer_conv2d_thread(void *threadarg) thread_param *thread_param = (struct thread_param *)threadarg; thread_common_param *thread_common_param = thread_param->thread_common_param; DnnOperand *operands = thread_common_param->operands; -float *output; int32_t input_operand_index = thread_common_param->input_operand_indexes[0]; -int number = operands[input_operand_index].dims[0]; int height = operands[input_operand_index].dims[1]; int width = operands[input_operand_index].dims[2]; int channel = operands[input_operand_index].dims[3]; @@ -130,24 +129,7 @@ static void * dnn_execute_layer_conv2d_thread(void *threadarg) int thread_start = thread_stride * thread_param->thread_index + pad_size; int thread_end = (thread_param->thread_index == thread_common_param->thread_num - 1) ? (height - pad_size) : (thread_start + thread_stride); -DnnOperand *output_operand = &operands[thread_common_param->output_operand_index]; -output_operand->dims[0] = number; -output_operand->dims[1] = height - pad_size * 2; -output_operand->dims[2] = width - pad_size * 2; -output_operand->dims[3] = conv_params->output_num; -output_operand->data_type = operands[input_operand_index].data_type; -output_operand->length = calculate_operand_data_length(output_operand); -if (output_operand->length <= 0) { -av_log(thread_common_param->ctx, AV_LOG_ERROR, "The output data length overflow\n"); -return (void *)DNN_ERROR; -} -output_operand->data = av_realloc(output_operand->data, output_operand->length); -if (!output_operand->data) { -av_log(thread_common_param->ctx, AV_LOG_ERROR, "Failed to reallocate memory for output\n"); -return (void *)DNN_ERROR; -} - -output = output_operand->data; +float *output = thread_common_param->output_data; output += (conv_params->output_num) * (width - 2 * pad_size) * (thread_start - pad_size); av_assert0(channel == conv_params->input_num); @@ -213,16 +195,33 @@ int dnn_execute_layer_conv2d(DnnOperand *operands, const int32_t *input_operand_ pthread_t *thread_id = av_malloc(thread_num * sizeof(pthread_t)); #endif thread_param **thread_param = av_malloc(thread_num * sizeof(*thread_param)); -void *res; -int error_flag = DNN_SUCCESS; - -//struct used to pass parameters thread_common_param thread_common_param; +const ConvolutionalParams *conv_params = (const ConvolutionalParams *)(parameters); +int pad_size = (conv_params->padding_method == VALID) ? (conv_params->kernel_size - 1) / 2 * conv_params->dilation : 0; +DnnOperand *output_operand = &operands[output_operand_index]; + +output_operand->dims[0] = operands[input_operand_indexes[0]].dims[0]; +output_operand->dims[1] = operands[input_operand_indexes[0]].dims[1] - pad_size * 2; +output_operand->dims[2] = operands[input_operand_indexes[0]].dims[2] - pad_size * 2; +output_operand->dims[3] = conv_params->output_num; +output_operand->data_type = operands[input_operand_indexes[0]].data_type; +output_operand->length = calculate_operand_data_length(output_operand); +if (output_operand->length <= 0) { +av_log(ctx, AV_LOG_ERROR, "The output data length overflow\n"); +return DNN_ERROR; +} +output_operand->data = av_realloc(output_operand->data, output_operand->length); +if (!output_operand->data) { +av_log(ctx, AV_LOG_ERROR, "Failed to reallocate memory for output\n"); +return DNN_ERROR; +} +thread_common_param.output_data = output_operand->data; thread_common_param.operands = operands; thread_common_param.input_operand_indexes = input_operand_indexes; thread_common_param.output_operand_index = output_operand_index; thread_common_param.parameters = parameters; thread_common_param.ctx = ctx; + #if HAVE_PTHREAD_CANCEL thread_common_param.thread_num = thread_num; @@ -236,9 +235,7 @@ int dnn_execute_layer_conv2d(DnnOperand *o
Re: [FFmpeg-devel] [PATCH] fate: Add aa-demux test
On Tue, Sep 15, 2020 at 11:07:30PM +0200, Michael Niedermayer wrote: > This should help fuzzer coverage > > The sample file can be generated by > dd > if=samples/audible/2004FirstPresidentialDebateBushvs.Kerry93004_acelp85_maihde.aa > of=bush.aa count=110 > > Signed-off-by: Michael Niedermayer > --- > tests/fate/demux.mak| 3 + > tests/ref/fate/aa-demux | 283 > 2 files changed, 286 insertions(+) > create mode 100644 tests/ref/fate/aa-demux > should be ok ___ 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/5] avformat/argo_asf: add ff_argo_asf_read()
On Wed, Sep 16, 2020 at 07:39:21AM +, Zane van Iperen wrote: > For the argo_brp demuxer. > > Signed-off-by: Zane van Iperen > --- > libavformat/argo_asf.c | 50 ++ > libavformat/argo_asf.h | 2 ++ > 2 files changed, 28 insertions(+), 24 deletions(-) > > diff --git a/libavformat/argo_asf.c b/libavformat/argo_asf.c > index deb64f7b1c..58d0c4fd23 100644 > --- a/libavformat/argo_asf.c > +++ b/libavformat/argo_asf.c > @@ -143,6 +143,31 @@ int ff_argo_asf_fill_stream(AVStream *st, const > ArgoASFFileHeader *fhdr, > return 0; > } > > +int ff_argo_asf_read(AVIOContext *pb, AVStream *st, AVPacket *pkt, > + const ArgoASFChunkHeader *ckhdr, uint32_t *blocks_read) > +{ > +int64_t ret; > + > +if (*blocks_read >= ckhdr->num_blocks) > +return AVERROR_EOF; > + > +ret = av_get_packet(pb, pkt, st->codecpar->block_align * > +FFMIN(ASF_NB_BLOCKS, ckhdr->num_blocks - > *blocks_read)); > +if (ret < 0) > +return ret; > + > +/* Something real screwy is going on. */ > +if (ret % st->codecpar->block_align != 0) > +return AVERROR_INVALIDDATA; > + > +pkt->stream_index = st->index; > +pkt->duration = ckhdr->num_samples * (ret / > st->codecpar->block_align); > +*blocks_read += (ret / st->codecpar->block_align); This line breaks seeking. Ultimately you want to support seeking in demuxer(s). > + > +pkt->flags &= ~AV_PKT_FLAG_CORRUPT; > +return 0; > +} > + > #if CONFIG_ARGO_ASF_DEMUXER > /* > * Known versions: > @@ -214,30 +239,7 @@ static int argo_asf_read_header(AVFormatContext *s) > static int argo_asf_read_packet(AVFormatContext *s, AVPacket *pkt) > { > ArgoASFDemuxContext *asf = s->priv_data; > - > -AVStream *st = s->streams[0]; > -AVIOContext *pb = s->pb; > -int ret; > - > -if (asf->blocks_read >= asf->ckhdr.num_blocks) > -return AVERROR_EOF; > - > -ret = av_get_packet(pb, pkt, st->codecpar->block_align * > -FFMIN(ASF_NB_BLOCKS, asf->ckhdr.num_blocks - > asf->blocks_read)); > -if (ret < 0) > -return ret; > - > -/* Something real screwy is going on. */ > -if (ret % st->codecpar->block_align != 0) > -return AVERROR_INVALIDDATA; > - > - > -pkt->stream_index = st->index; > -pkt->duration = asf->ckhdr.num_samples * (ret / > st->codecpar->block_align); > -asf->blocks_read += (ret / st->codecpar->block_align); > - > -pkt->flags &= ~AV_PKT_FLAG_CORRUPT; > -return 0; > +return ff_argo_asf_read(s->pb, s->streams[0], pkt, &asf->ckhdr, > &asf->blocks_read); > } > > /* > diff --git a/libavformat/argo_asf.h b/libavformat/argo_asf.h > index eb2669a63f..0fd6aced58 100644 > --- a/libavformat/argo_asf.h > +++ b/libavformat/argo_asf.h > @@ -67,5 +67,7 @@ int ff_argo_asf_validate_file_header(AVFormatContext *s, > const ArgoASFFileHeade > void ff_argo_asf_parse_chunk_header(ArgoASFChunkHeader *hdr, const uint8_t > *buf); > int ff_argo_asf_fill_stream(AVStream *st, const ArgoASFFileHeader *fhdr, > const ArgoASFChunkHeader *ckhdr); > +int ff_argo_asf_read(AVIOContext *pb, AVStream *st, AVPacket *pkt, > + const ArgoASFChunkHeader *ckhdr, uint32_t > *blocks_read); > > #endif /* AVFORMAT_ARGO_ASF_H */ > -- > 2.25.4 > > > ___ > 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/2] web/download: remove Zeranoe links
ffmpeg.zeranoe.com will close on Sep 18, 2020 Last published builds are from Aug 31 2020. --- src/download | 6 -- 1 file changed, 6 deletions(-) diff --git a/src/download b/src/download index 02e2fe7..34fa093 100644 --- a/src/download +++ b/src/download @@ -79,9 +79,6 @@ Windows EXE Files - https://ffmpeg.zeranoe.com/builds/";> -Windows builds by Zeranoe - @@ -93,9 +90,6 @@ https://evermeet.cx/ffmpeg/";> Static builds for macOS 64-bit - https://ffmpeg.zeranoe.com/builds/";> -Static and shared builds for macOS 64-bit - -- 2.27.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] web/download: add gyan.dev for Windows builds
--- src/download | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/download b/src/download index 34fa093..cc427a5 100644 --- a/src/download +++ b/src/download @@ -79,6 +79,9 @@ Windows EXE Files + https://www.gyan.dev/ffmpeg/builds/";> +Windows builds from gyan.dev + -- 2.27.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 28/40] avcodec/c93: Cleanup generically after init failure
On Mon, Sep 14, 2020 at 07:27:35AM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/c93.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > lgtm ___ 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 24/40] avcodec/av1dec: Fix segfault upon allocation error
On Mon, Sep 14, 2020 at 07:27:31AM +0200, Andreas Rheinhardt wrote: > The decoder's close function simply presumed that some AVFrames have > been successfully allocated although this can of course fail. > > Signed-off-by: Andreas Rheinhardt > --- > Once could btw return immediately as soon as one encounters an AVFrame > that is NULL, because these frames are the first things to be allocated > in init (and in the same order as they are freed); yet I wanted to avoid > this additional dependency. > > libavcodec/av1dec.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > probably ok ___ 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] .NET video processing with FFMPEG
Dear FFMPEG Team, I am developing SW with C# .NET for video processing purposes, and I would like to know information about the existing nuget packages related with FFPMEG. I found the FFMEG.Nightly package, but I am not able to find documentation about it. I would like to know which classes and methods are in this package, in order to perform actions like thumbnail generation from a video. ¿Does this package allows me to do functionality like that? ¿Do you have any guide or documentation in order to do that? A lot of thanks, Regards. P Please consider the environment before printing this e-mail. ___ 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 0/6] qsv: Fix compiler errors when using libmfx 2.0 (oneVPL)
On Wed, 2020-09-16 at 08:12 +, Soft Works wrote: > > -Original Message- > > From: ffmpeg-devel On Behalf Of > > Haihao Xiang > > Sent: Wednesday, September 16, 2020 8:45 AM > > To: ffmpeg-devel@ffmpeg.org > > Cc: Haihao Xiang > > Subject: [FFmpeg-devel] [PATCH 0/6] qsv: Fix compiler errors when using > > libmfx 2.0 (oneVPL) > > > > The oneAPI Video Processing Library (oneVPL) is a single interface for > > encode, decode and video processing, the obsolete features in Intel Media > > Software Development Kit are removed from oneVPL. > > > > The oneVPL specification: > > https://spec.oneapi.com/versions/latest/elements/oneVPL/source/index.ht > > ml > > The oneVPL source code: > > https://github.com/oneapi-src/oneVPL > > > > Haihao Xiang (6): > > qsv: add ${includedir}/mfx to the search path for old versions of > > libmfx > > qsv: libmfx no longer supports user plugin since version 2.0 (oneVPL) > > qsv: libmfx no longer supports audio since version 2.0 (oneVPL) > > qsvenc: libmfx no longer supports multi-frame encode since version 2.0 > > (oneVPL) > > qsvenc: libmfx no longer supports MFX_RATECONTROL_LA_EXT since > > version > > 2.0 (oneVPL) > > qsv: libmfx no longer supports OPAQUE memory since version 2.0 > > (oneVPL) > > Hi, > > MFX => ClearVideo => QuickSync => MediaSDK => oneVPL > > Is there actually something new in "oneVPL 2.0" or is this just MSDK 1.34 with > many things removed and once another name added? You may refer to https://spec.oneapi.com/versions/latest/elements/oneVPL/source/VPL_intel_media_sdk.html#new-apis-in-onevpl for the new APIs/features. > > PS: How about VPP tone-mapping? Do you mean libmfx based tone-mapping? Thanks Haihao > > Kind regards, > softworkz > ___ > 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 0/6] qsv: Fix compiler errors when using libmfx 2.0 (oneVPL)
> -Original Message- > From: ffmpeg-devel On Behalf Of > Haihao Xiang > Sent: Wednesday, September 16, 2020 8:45 AM > To: ffmpeg-devel@ffmpeg.org > Cc: Haihao Xiang > Subject: [FFmpeg-devel] [PATCH 0/6] qsv: Fix compiler errors when using > libmfx 2.0 (oneVPL) > > The oneAPI Video Processing Library (oneVPL) is a single interface for > encode, decode and video processing, the obsolete features in Intel Media > Software Development Kit are removed from oneVPL. > > The oneVPL specification: > https://spec.oneapi.com/versions/latest/elements/oneVPL/source/index.ht > ml > The oneVPL source code: > https://github.com/oneapi-src/oneVPL > > Haihao Xiang (6): > qsv: add ${includedir}/mfx to the search path for old versions of > libmfx > qsv: libmfx no longer supports user plugin since version 2.0 (oneVPL) > qsv: libmfx no longer supports audio since version 2.0 (oneVPL) > qsvenc: libmfx no longer supports multi-frame encode since version 2.0 > (oneVPL) > qsvenc: libmfx no longer supports MFX_RATECONTROL_LA_EXT since > version > 2.0 (oneVPL) > qsv: libmfx no longer supports OPAQUE memory since version 2.0 > (oneVPL) Hi, MFX => ClearVideo => QuickSync => MediaSDK => oneVPL Is there actually something new in "oneVPL 2.0" or is this just MSDK 1.34 with many things removed and once another name added? PS: How about VPP tone-mapping? Kind regards, softworkz ___ 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/5] avformat/argo_brp: support reading multiple ASF blocks at once
Signed-off-by: Zane van Iperen --- libavformat/argo_brp.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libavformat/argo_brp.c b/libavformat/argo_brp.c index 122f616ecc..4716ad85eb 100644 --- a/libavformat/argo_brp.c +++ b/libavformat/argo_brp.c @@ -86,7 +86,7 @@ typedef struct ArgoBRPDemuxContext { struct { int index; ArgoASFChunkHeader ckhdr; -int64_t blocks_read; +uint32_tblocks_read; int64_t offset; /* ms, not samples. */ int64_t lastpts; @@ -340,13 +340,14 @@ static int argo_brp_read_basf(AVFormatContext *s, AVPacket *pkt, ArgoBRPDemuxContext *brp, int ignorepts) { ArgoASFChunkHeader *ckhdr = &brp->basf.ckhdr; -AVCodecParameters *par; +AVStream *st; int64_t ret, old; +uint32_t blocks_read; if (brp->basf.index < 0) return 0; -par = s->streams[brp->basf.index]->codecpar; +st = s->streams[brp->basf.index]; if (brp->basf.blocks_read >= ckhdr->num_blocks) return 0; @@ -364,7 +365,8 @@ static int argo_brp_read_basf(AVFormatContext *s, AVPacket *pkt, else if (ret != brp->basf.offset) return AVERROR(EIO); -if ((ret = av_get_packet(s->pb, pkt, par->frame_size)) < 0) +blocks_read = brp->basf.blocks_read; +if ((ret = ff_argo_asf_read(s->pb, st, pkt, ckhdr, &blocks_read)) < 0) return ret; if ((ret = avio_seek(s->pb, old, SEEK_SET)) < 0) @@ -372,11 +374,8 @@ static int argo_brp_read_basf(AVFormatContext *s, AVPacket *pkt, else if (ret != old) return AVERROR(EIO); -pkt->stream_index = brp->basf.index; -pkt->duration = ckhdr->num_samples; - brp->basf.offset += pkt->size; -brp->basf.blocks_read += 1; +brp->basf.blocks_read = blocks_read; /* Need the ceil() because ((32 * 1000) / 44100) < 1 */ brp->basf.lastpts += ceilf((ckhdr->num_samples * 1000.0f) / ckhdr->sample_rate); return 1; -- 2.25.4 ___ 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/5] avformat/argo_asf: add ff_argo_asf_read()
For the argo_brp demuxer. Signed-off-by: Zane van Iperen --- libavformat/argo_asf.c | 50 ++ libavformat/argo_asf.h | 2 ++ 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/libavformat/argo_asf.c b/libavformat/argo_asf.c index deb64f7b1c..58d0c4fd23 100644 --- a/libavformat/argo_asf.c +++ b/libavformat/argo_asf.c @@ -143,6 +143,31 @@ int ff_argo_asf_fill_stream(AVStream *st, const ArgoASFFileHeader *fhdr, return 0; } +int ff_argo_asf_read(AVIOContext *pb, AVStream *st, AVPacket *pkt, + const ArgoASFChunkHeader *ckhdr, uint32_t *blocks_read) +{ +int64_t ret; + +if (*blocks_read >= ckhdr->num_blocks) +return AVERROR_EOF; + +ret = av_get_packet(pb, pkt, st->codecpar->block_align * +FFMIN(ASF_NB_BLOCKS, ckhdr->num_blocks - *blocks_read)); +if (ret < 0) +return ret; + +/* Something real screwy is going on. */ +if (ret % st->codecpar->block_align != 0) +return AVERROR_INVALIDDATA; + +pkt->stream_index = st->index; +pkt->duration = ckhdr->num_samples * (ret / st->codecpar->block_align); +*blocks_read += (ret / st->codecpar->block_align); + +pkt->flags &= ~AV_PKT_FLAG_CORRUPT; +return 0; +} + #if CONFIG_ARGO_ASF_DEMUXER /* * Known versions: @@ -214,30 +239,7 @@ static int argo_asf_read_header(AVFormatContext *s) static int argo_asf_read_packet(AVFormatContext *s, AVPacket *pkt) { ArgoASFDemuxContext *asf = s->priv_data; - -AVStream *st = s->streams[0]; -AVIOContext *pb = s->pb; -int ret; - -if (asf->blocks_read >= asf->ckhdr.num_blocks) -return AVERROR_EOF; - -ret = av_get_packet(pb, pkt, st->codecpar->block_align * -FFMIN(ASF_NB_BLOCKS, asf->ckhdr.num_blocks - asf->blocks_read)); -if (ret < 0) -return ret; - -/* Something real screwy is going on. */ -if (ret % st->codecpar->block_align != 0) -return AVERROR_INVALIDDATA; - - -pkt->stream_index = st->index; -pkt->duration = asf->ckhdr.num_samples * (ret / st->codecpar->block_align); -asf->blocks_read += (ret / st->codecpar->block_align); - -pkt->flags &= ~AV_PKT_FLAG_CORRUPT; -return 0; +return ff_argo_asf_read(s->pb, s->streams[0], pkt, &asf->ckhdr, &asf->blocks_read); } /* diff --git a/libavformat/argo_asf.h b/libavformat/argo_asf.h index eb2669a63f..0fd6aced58 100644 --- a/libavformat/argo_asf.h +++ b/libavformat/argo_asf.h @@ -67,5 +67,7 @@ int ff_argo_asf_validate_file_header(AVFormatContext *s, const ArgoASFFileHeade void ff_argo_asf_parse_chunk_header(ArgoASFChunkHeader *hdr, const uint8_t *buf); int ff_argo_asf_fill_stream(AVStream *st, const ArgoASFFileHeader *fhdr, const ArgoASFChunkHeader *ckhdr); +int ff_argo_asf_read(AVIOContext *pb, AVStream *st, AVPacket *pkt, + const ArgoASFChunkHeader *ckhdr, uint32_t *blocks_read); #endif /* AVFORMAT_ARGO_ASF_H */ -- 2.25.4 ___ 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/5] avformat/argo_asf: read multiple blocks at once
Signed-off-by: Zane van Iperen --- libavformat/argo_asf.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/libavformat/argo_asf.c b/libavformat/argo_asf.c index b1632f3ba5..deb64f7b1c 100644 --- a/libavformat/argo_asf.c +++ b/libavformat/argo_asf.c @@ -26,6 +26,9 @@ #include "libavutil/opt.h" #include "argo_asf.h" +/* Maximum number of blocks to read at once. */ +#define ASF_NB_BLOCKS 32 + typedef struct ArgoASFDemuxContext { ArgoASFFileHeader fhdr; ArgoASFChunkHeader ckhdr; @@ -125,12 +128,10 @@ int ff_argo_asf_fill_stream(AVStream *st, const ArgoASFFileHeader *fhdr, * (nchannel control bytes) + ((bytes_per_channel) * nchannel) * For mono, this is 17. For stereo, this is 34. */ -st->codecpar->frame_size= st->codecpar->channels + +st->codecpar->block_align = st->codecpar->channels + (ckhdr->num_samples / 2) * st->codecpar->channels; -st->codecpar->block_align = st->codecpar->frame_size; - st->codecpar->bit_rate = st->codecpar->channels * st->codecpar->sample_rate * st->codecpar->bits_per_coded_sample; @@ -221,15 +222,21 @@ static int argo_asf_read_packet(AVFormatContext *s, AVPacket *pkt) if (asf->blocks_read >= asf->ckhdr.num_blocks) return AVERROR_EOF; -if ((ret = av_get_packet(pb, pkt, st->codecpar->frame_size)) < 0) +ret = av_get_packet(pb, pkt, st->codecpar->block_align * +FFMIN(ASF_NB_BLOCKS, asf->ckhdr.num_blocks - asf->blocks_read)); +if (ret < 0) return ret; -else if (ret != st->codecpar->frame_size) + +/* Something real screwy is going on. */ +if (ret % st->codecpar->block_align != 0) return AVERROR_INVALIDDATA; + pkt->stream_index = st->index; -pkt->duration = asf->ckhdr.num_samples; +pkt->duration = asf->ckhdr.num_samples * (ret / st->codecpar->block_align); +asf->blocks_read += (ret / st->codecpar->block_align); -++asf->blocks_read; +pkt->flags &= ~AV_PKT_FLAG_CORRUPT; return 0; } -- 2.25.4 ___ 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/5] avcodec/adpcm_{psx, argo}: add missing indent
Signed-off-by: Zane van Iperen --- libavcodec/adpcm.c | 86 +++--- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 14be1f4f88..4755308824 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -1966,42 +1966,42 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, case AV_CODEC_ID_ADPCM_PSX: for (int block = 0; block < avpkt->size / FFMAX(avctx->block_align, 16 * avctx->channels); block++) { int nb_samples_per_block = 28 * FFMAX(avctx->block_align, 16 * avctx->channels) / (16 * avctx->channels); -for (channel = 0; channel < avctx->channels; channel++) { -samples = samples_p[channel] + block * nb_samples_per_block; - -/* Read in every sample for this channel. */ -for (i = 0; i < nb_samples_per_block / 28; i++) { -int filter, shift, flag, byte; - -filter = bytestream2_get_byteu(&gb); -shift = filter & 0xf; -filter = filter >> 4; -if (filter >= FF_ARRAY_ELEMS(xa_adpcm_table)) -return AVERROR_INVALIDDATA; -flag = bytestream2_get_byteu(&gb); - -/* Decode 28 samples. */ -for (n = 0; n < 28; n++) { -int sample = 0, scale; - -if (flag < 0x07) { -if (n & 1) { -scale = sign_extend(byte >> 4, 4); -} else { -byte = bytestream2_get_byteu(&gb); -scale = sign_extend(byte, 4); +for (channel = 0; channel < avctx->channels; channel++) { +samples = samples_p[channel] + block * nb_samples_per_block; + +/* Read in every sample for this channel. */ +for (i = 0; i < nb_samples_per_block / 28; i++) { +int filter, shift, flag, byte; + +filter = bytestream2_get_byteu(&gb); +shift = filter & 0xf; +filter = filter >> 4; +if (filter >= FF_ARRAY_ELEMS(xa_adpcm_table)) +return AVERROR_INVALIDDATA; +flag = bytestream2_get_byteu(&gb); + +/* Decode 28 samples. */ +for (n = 0; n < 28; n++) { +int sample = 0, scale; + +if (flag < 0x07) { +if (n & 1) { +scale = sign_extend(byte >> 4, 4); +} else { +byte = bytestream2_get_byteu(&gb); +scale = sign_extend(byte, 4); +} + +scale = scale * (1 << 12); +sample = (int)((scale >> shift) + (c->status[channel].sample1 * xa_adpcm_table[filter][0] + c->status[channel].sample2 * xa_adpcm_table[filter][1]) / 64); } - -scale = scale * (1 << 12); -sample = (int)((scale >> shift) + (c->status[channel].sample1 * xa_adpcm_table[filter][0] + c->status[channel].sample2 * xa_adpcm_table[filter][1]) / 64); +*samples++ = av_clip_int16(sample); +c->status[channel].sample2 = c->status[channel].sample1; +c->status[channel].sample1 = sample; } -*samples++ = av_clip_int16(sample); -c->status[channel].sample2 = c->status[channel].sample1; -c->status[channel].sample1 = sample; } } } -} break; case AV_CODEC_ID_ADPCM_ARGO: /* @@ -2022,23 +2022,23 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, * They should be 0 initially. */ for (int block = 0; block < avpkt->size / avctx->block_align; block++) { -for (channel = 0; channel < avctx->channels; channel++) { -int control, shift; +for (channel = 0; channel < avctx->channels; channel++) { +int control, shift; -samples = samples_p[channel] + block * 32; -cs = c->status + channel; +samples = samples_p[channel] + block * 32; +cs = c->status + channel; -/* Get the control byte and decode the samples, 2 at a time. */ -control = bytestream2_get_byteu(&gb); -shift = (control >> 4) + 2; +/* Get the control byte and decode the samples, 2 at a time. */ +control = bytestream2_get_byteu(&gb); +shift = (control >> 4) + 2; -for (n = 0; n < 16; n++) { -int sample = bytestream2_get_byteu(&gb); -
[FFmpeg-devel] [PATCH 1/5] avcodec/adpcm_argo: support decoding multiple frames
Increases decode speed significantly. Signed-off-by: Zane van Iperen --- libavcodec/adpcm.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index e409a3aa6a..14be1f4f88 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -181,7 +181,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) c->vqa_version = AV_RL16(avctx->extradata); break; case AV_CODEC_ID_ADPCM_ARGO: -if (avctx->bits_per_coded_sample != 4) +if (avctx->bits_per_coded_sample != 4 || avctx->block_align != 17 * avctx->channels) return AVERROR_INVALIDDATA; break; case AV_CODEC_ID_ADPCM_ZORK: @@ -745,11 +745,6 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb, return 0; nb_samples = 64; break; -case AV_CODEC_ID_ADPCM_ARGO: -if (buf_size < 17 * ch) -return 0; -nb_samples = 32; -break; /* simple 4-bit adpcm */ case AV_CODEC_ID_ADPCM_CT: case AV_CODEC_ID_ADPCM_IMA_APC: @@ -922,6 +917,9 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb, case AV_CODEC_ID_ADPCM_PSX: nb_samples = buf_size / (16 * ch) * 28; break; +case AV_CODEC_ID_ADPCM_ARGO: +nb_samples = buf_size / avctx->block_align * 32; +break; case AV_CODEC_ID_ADPCM_ZORK: nb_samples = buf_size / ch; break; @@ -2023,22 +2021,24 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, * Each block relies on the previous two samples of each channel. * They should be 0 initially. */ +for (int block = 0; block < avpkt->size / avctx->block_align; block++) { for (channel = 0; channel < avctx->channels; channel++) { int control, shift; -samples = samples_p[channel]; +samples = samples_p[channel] + block * 32; cs = c->status + channel; /* Get the control byte and decode the samples, 2 at a time. */ control = bytestream2_get_byteu(&gb); shift = (control >> 4) + 2; -for (n = 0; n < nb_samples / 2; n++) { +for (n = 0; n < 16; n++) { int sample = bytestream2_get_byteu(&gb); *samples++ = ff_adpcm_argo_expand_nibble(cs, sample >> 4, shift, control & 0x04); *samples++ = ff_adpcm_argo_expand_nibble(cs, sample >> 0, shift, control & 0x04); } } +} break; case AV_CODEC_ID_ADPCM_ZORK: if (!c->has_status) { -- 2.25.4 ___ 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] lavc/qsvdec: Add QSV AV1 decoder
AV1 decoder is supported on Tiger Lake+ platforms since libmfx 1.34 Signed-off-by: Haihao Xiang --- Changelog | 1 + configure | 1 + libavcodec/allcodecs.c| 1 + libavcodec/qsv.c | 4 libavcodec/qsvdec_other.c | 31 ++- 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 261b6b261a..1f93d6dd14 100644 --- a/Changelog +++ b/Changelog @@ -25,6 +25,7 @@ version : - AV1 decoder (Hardware acceleration used only) - SVS demuxer - Argonaut Games BRP demuxer +- Intel QSV-accelerated AV1 decoding version 4.3: diff --git a/configure b/configure index 5d68695192..591067a7a8 100755 --- a/configure +++ b/configure @@ -3139,6 +3139,7 @@ vp9_qsv_encoder_deps="libmfx MFX_CODEC_VP9" vp9_qsv_encoder_select="qsvenc" vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m" wmv3_crystalhd_decoder_select="crystalhd" +av1_qsv_decoder_select="qsvdec" # parsers aac_parser_select="adts_header" diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 713c5686a4..ae5642829e 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -820,6 +820,7 @@ extern AVCodec ff_vp9_mediacodec_decoder; extern AVCodec ff_vp9_qsv_decoder; extern AVCodec ff_vp9_vaapi_encoder; extern AVCodec ff_vp9_qsv_encoder; +extern AVCodec ff_av1_qsv_decoder; // The iterate API is not usable with ossfuzz due to the excessive size of binaries created #if CONFIG_OSSFUZZ diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 17720070f1..7816d2f93c 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -64,6 +64,10 @@ int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id) case AV_CODEC_ID_VP9: return MFX_CODEC_VP9; #endif +#if QSV_VERSION_ATLEAST(1, 34) +case AV_CODEC_ID_AV1: +return MFX_CODEC_AV1; +#endif default: break; diff --git a/libavcodec/qsvdec_other.c b/libavcodec/qsvdec_other.c index b4df76739c..2775e07955 100644 --- a/libavcodec/qsvdec_other.c +++ b/libavcodec/qsvdec_other.c @@ -1,5 +1,5 @@ /* - * Intel MediaSDK QSV based MPEG-2, VC-1, VP8, MJPEG and VP9 decoders + * Intel MediaSDK QSV based MPEG-2, VC-1, VP8, MJPEG, VP9 and AV1 decoders * * copyright (c) 2015 Anton Khirnov * @@ -327,3 +327,32 @@ AVCodec ff_vp9_qsv_decoder = { .wrapper_name = "qsv", }; #endif + +#if CONFIG_AV1_QSV_DECODER +static const AVClass av1_qsv_class = { +.class_name = "av1_qsv", +.item_name = av_default_item_name, +.option = options, +.version= LIBAVUTIL_VERSION_INT, +}; + +AVCodec ff_av1_qsv_decoder = { +.name = "av1_qsv", +.long_name = NULL_IF_CONFIG_SMALL("AV1 video (Intel Quick Sync Video acceleration)"), +.priv_data_size = sizeof(QSVOtherContext), +.type = AVMEDIA_TYPE_VIDEO, +.id = AV_CODEC_ID_AV1, +.init = qsv_decode_init, +.decode = qsv_decode_frame, +.flush = qsv_decode_flush, +.close = qsv_decode_close, +.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID, +.priv_class = &av1_qsv_class, +.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, +AV_PIX_FMT_P010, +AV_PIX_FMT_QSV, +AV_PIX_FMT_NONE }, +.hw_configs = ff_qsv_hw_configs, +.wrapper_name = "qsv", +}; +#endif -- 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".