[FFmpeg-devel] [PATCH v2 2/2] lavc/vulkan_av1: Use av1dec reference order hint information
--- Changes over v1: fix the OrderHints field as well; move things into the loop over reference names rather than the loop over reference slots. libavcodec/vulkan_av1.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/libavcodec/vulkan_av1.c b/libavcodec/vulkan_av1.c index c9e398eaec..fcc9a4f03b 100644 --- a/libavcodec/vulkan_av1.c +++ b/libavcodec/vulkan_av1.c @@ -76,7 +76,7 @@ static int vk_av1_fill_pict(AVCodecContext *avctx, const AV1Frame **ref_src, StdVideoDecodeAV1ReferenceInfo *vkav1_std_ref, VkVideoDecodeAV1DpbSlotInfoKHR *vkav1_ref, /* Goes in ^ */ const AV1Frame *pic, int is_current, int has_grain, -int *saved_order_hints) +const uint8_t *saved_order_hints) { FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; AV1VulkanDecodePicture *hp = pic->hwaccel_picture_private; @@ -242,7 +242,6 @@ static int vk_av1_start_frame(AVCodecContext *avctx, const AV1RawFrameHeader *frame_header = s->raw_frame_header; const AV1RawFilmGrainParams *film_grain = &s->cur_frame.film_grain; -CodedBitstreamAV1Context *cbs_ctx = (CodedBitstreamAV1Context *)(s->cbc->priv_data); const int apply_grain = !(avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) && film_grain->apply_grain; @@ -272,7 +271,7 @@ static int vk_av1_start_frame(AVCodecContext *avctx, ap->ref_frame_sign_bias_mask = 0x0; for (int i = 0; i < STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME; i++) -ap->ref_frame_sign_bias_mask |= cbs_ctx->ref_frame_sign_bias[i] << i; +ap->ref_frame_sign_bias_mask |= pic->ref_frame_sign_bias[i] << i; for (int i = 0; i < STD_VIDEO_AV1_REFS_PER_FRAME; i++) { const int idx = pic->raw_frame_header->ref_frame_idx[i]; @@ -294,7 +293,7 @@ static int vk_av1_start_frame(AVCodecContext *avctx, err = vk_av1_fill_pict(avctx, &ap->ref_src[ref_count], &vp->ref_slots[ref_count], &vp->refs[ref_count], &ap->std_refs[ref_count], &ap->vkav1_refs[ref_count], - ref_frame, 0, 0, cbs_ctx->ref[idx].saved_order_hints); + ref_frame, 0, 0, ref_frame->order_hints); if (err < 0) return err; @@ -491,8 +490,14 @@ static int vk_av1_start_frame(AVCodecContext *avctx, } } -for (int i = 0; i < STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME; i++) +for (int i = 0; i < STD_VIDEO_AV1_TOTAL_REFS_PER_FRAME; i++) { +ap->std_pic_info.OrderHints[i] = pic->order_hints[i]; ap->loop_filter.loop_filter_ref_deltas[i] = frame_header->loop_filter_ref_deltas[i]; +ap->global_motion.GmType[i] = s->cur_frame.gm_type[i]; +for (int j = 0; j < STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS; j++) { +ap->global_motion.gm_params[i][j] = s->cur_frame.gm_params[i][j]; +} +} for (int i = 0; i < STD_VIDEO_AV1_MAX_CDEF_FILTER_STRENGTHS; i++) { ap->cdef.cdef_y_pri_strength[i] = frame_header->cdef_y_pri_strength[i]; @@ -501,14 +506,6 @@ static int vk_av1_start_frame(AVCodecContext *avctx, ap->cdef.cdef_uv_sec_strength[i] = frame_header->cdef_uv_sec_strength[i]; } -for (int i = 0; i < STD_VIDEO_AV1_NUM_REF_FRAMES; i++) { -ap->std_pic_info.OrderHints[i] = frame_header->ref_order_hint[i]; -ap->global_motion.GmType[i] = s->cur_frame.gm_type[i]; -for (int j = 0; j < STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS; j++) { -ap->global_motion.gm_params[i][j] = s->cur_frame.gm_params[i][j]; -} -} - if (apply_grain) { for (int i = 0; i < STD_VIDEO_AV1_MAX_NUM_Y_POINTS; i++) { ap->film_grain.point_y_value[i] = film_grain->point_y_value[i]; -- 2.43.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH v2 1/2] lavc/av1: Record reference ordering information for each frame
This is needed by Vulkan. Constructing this can't be delegated to CBS because packets might contain multiple frames (when non-shown frames are present) but we need separate snapshots immediately before each frame for the decoder. --- Changes over v1: rename the order hint field and document exactly what the new fields contain. libavcodec/av1dec.c | 26 ++ libavcodec/av1dec.h | 8 2 files changed, 34 insertions(+) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 824725c031..b4b741054a 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -359,6 +359,25 @@ static void coded_lossless_param(AV1DecContext *s) } } +static void order_hint_info(AV1DecContext *s) +{ +const AV1RawFrameHeader *header = s->raw_frame_header; +const AV1RawSequenceHeader *seq = s->raw_seq; +AV1Frame *frame = &s->cur_frame; + +frame->order_hint = header->order_hint; + +for (int i = 0; i < AV1_REFS_PER_FRAME; i++) { +int ref_name = i + AV1_REF_FRAME_LAST; +int ref_slot = header->ref_frame_idx[i]; +int ref_order_hint = s->ref[ref_slot].order_hint; + +frame->order_hints[ref_name] = ref_order_hint; +frame->ref_frame_sign_bias[ref_name] = +get_relative_dist(seq, ref_order_hint, frame->order_hint); +} +} + static void load_grain_params(AV1DecContext *s) { const AV1RawFrameHeader *header = s->raw_frame_header; @@ -701,6 +720,12 @@ static int av1_frame_ref(AVCodecContext *avctx, AV1Frame *dst, const AV1Frame *s sizeof(dst->film_grain)); dst->coded_lossless = src->coded_lossless; +dst->order_hint = src->order_hint; +memcpy(dst->ref_frame_sign_bias, src->ref_frame_sign_bias, + sizeof(dst->ref_frame_sign_bias)); +memcpy(dst->order_hints, src->order_hints, + sizeof(dst->order_hints)); + return 0; fail: @@ -1257,6 +1282,7 @@ static int get_current_frame(AVCodecContext *avctx) global_motion_params(s); skip_mode_params(s); coded_lossless_param(s); +order_hint_info(s); load_grain_params(s); return ret; diff --git a/libavcodec/av1dec.h b/libavcodec/av1dec.h index 336eb61359..79a0be510b 100644 --- a/libavcodec/av1dec.h +++ b/libavcodec/av1dec.h @@ -53,6 +53,14 @@ typedef struct AV1Frame { AV1RawFilmGrainParams film_grain; uint8_t coded_lossless; + +// OrderHint for this frame. +uint8_t order_hint; +// RefFrameSignBias[] used when decoding this frame. +uint8_t ref_frame_sign_bias[AV1_TOTAL_REFS_PER_FRAME]; +// OrderHints[] when this is the current frame, otherwise +// SavedOrderHints[s][] when is the reference frame in slot s. +uint8_t order_hints[AV1_TOTAL_REFS_PER_FRAME]; } AV1Frame; typedef struct TileGroupInfo { -- 2.43.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2 2/2] avcodec/nvenc: Multi NVENC Split Frame Encoding in HEVC and AV1
squashed, added version bump and applied 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 v5] avcodec/h2645_sei: validate Mastering Display Colour Volume SEI values
On Sat, 13 Apr 2024 17:21:08 +0200 Kacper Michajłow wrote: > As we can read in ST 2086: > > Values outside the specified ranges of luminance and chromaticity values > are not reserved by SMPTE, and can be used for purposes outside the > scope of this standard. > > This is further acknowledged by ITU-T H.264 and ITU-T H.265. Which says > that values out of range are unknown or unspecified or specified by > other means not specified in this Specification. > > Signed-off-by: Kacper Michajłow > --- > libavcodec/h2645_sei.c | 55 ++ > 1 file changed, 39 insertions(+), 16 deletions(-) > > diff --git a/libavcodec/h2645_sei.c b/libavcodec/h2645_sei.c > index 933975f076..96a22e7cf6 100644 > --- a/libavcodec/h2645_sei.c > +++ b/libavcodec/h2645_sei.c > @@ -587,38 +587,61 @@ static int h2645_sei_to_side_data(AVCodecContext > *avctx, H2645SEI *sei, > return ret; > > if (metadata) { > +metadata->has_luminance = 1; > +metadata->has_primaries = 1; > + > for (i = 0; i < 3; i++) { > const int j = mapping[i]; > metadata->display_primaries[i][0].num = > sei->mastering_display.display_primaries[j][0]; > metadata->display_primaries[i][0].den = chroma_den; > +metadata->has_primaries &= > sei->mastering_display.display_primaries[j][0] >= 5 && > + > sei->mastering_display.display_primaries[j][0] <= 37000; > + > metadata->display_primaries[i][1].num = > sei->mastering_display.display_primaries[j][1]; > metadata->display_primaries[i][1].den = chroma_den; > +metadata->has_primaries &= > sei->mastering_display.display_primaries[j][1] >= 5 && > + > sei->mastering_display.display_primaries[j][1] <= 42000; > } > metadata->white_point[0].num = > sei->mastering_display.white_point[0]; > metadata->white_point[0].den = chroma_den; > +metadata->has_primaries &= sei->mastering_display.white_point[0] > >= 5 && > + sei->mastering_display.white_point[0] > <= 37000; > + > metadata->white_point[1].num = > sei->mastering_display.white_point[1]; > metadata->white_point[1].den = chroma_den; > +metadata->has_primaries &= sei->mastering_display.white_point[1] > >= 5 && > + sei->mastering_display.white_point[1] > <= 42000; > > metadata->max_luminance.num = > sei->mastering_display.max_luminance; > metadata->max_luminance.den = luma_den; > +metadata->has_luminance &= sei->mastering_display.max_luminance > >= 5 && > + sei->mastering_display.max_luminance > <= 1; > + > metadata->min_luminance.num = > sei->mastering_display.min_luminance; > metadata->min_luminance.den = luma_den; > -metadata->has_luminance = 1; > -metadata->has_primaries = 1; > - > -av_log(avctx, AV_LOG_DEBUG, "Mastering Display Metadata:\n"); > -av_log(avctx, AV_LOG_DEBUG, > - "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, > %5.4f)\n", > - av_q2d(metadata->display_primaries[0][0]), > - av_q2d(metadata->display_primaries[0][1]), > - av_q2d(metadata->display_primaries[1][0]), > - av_q2d(metadata->display_primaries[1][1]), > - av_q2d(metadata->display_primaries[2][0]), > - av_q2d(metadata->display_primaries[2][1]), > - av_q2d(metadata->white_point[0]), > av_q2d(metadata->white_point[1])); > -av_log(avctx, AV_LOG_DEBUG, > - "min_luminance=%f, max_luminance=%f\n", > - av_q2d(metadata->min_luminance), > av_q2d(metadata->max_luminance)); > +metadata->has_luminance &= sei->mastering_display.min_luminance > >= 1 && > + sei->mastering_display.min_luminance > <= 5 && > + sei->mastering_display.min_luminance < > + sei->mastering_display.max_luminance; > + > +if (metadata->has_luminance || metadata->has_primaries) > +av_log(avctx, AV_LOG_DEBUG, "Mastering Display Metadata:\n"); > +if (metadata->has_primaries) { > +av_log(avctx, AV_LOG_DEBUG, > + "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) > wp(%5.4f, %5.4f)\n", > + av_q2d(metadata->display_primaries[0][0]), > + av_q2d(metadata->display_primaries[0][1]), > + av_q2d(metadata->display_primaries[1][0]), > + av_q2d(meta
[FFmpeg-devel] [PATCH v5] avcodec/h2645_sei: validate Mastering Display Colour Volume SEI values
As we can read in ST 2086: Values outside the specified ranges of luminance and chromaticity values are not reserved by SMPTE, and can be used for purposes outside the scope of this standard. This is further acknowledged by ITU-T H.264 and ITU-T H.265. Which says that values out of range are unknown or unspecified or specified by other means not specified in this Specification. Signed-off-by: Kacper Michajłow --- libavcodec/h2645_sei.c | 55 ++ 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/libavcodec/h2645_sei.c b/libavcodec/h2645_sei.c index 933975f076..96a22e7cf6 100644 --- a/libavcodec/h2645_sei.c +++ b/libavcodec/h2645_sei.c @@ -587,38 +587,61 @@ static int h2645_sei_to_side_data(AVCodecContext *avctx, H2645SEI *sei, return ret; if (metadata) { +metadata->has_luminance = 1; +metadata->has_primaries = 1; + for (i = 0; i < 3; i++) { const int j = mapping[i]; metadata->display_primaries[i][0].num = sei->mastering_display.display_primaries[j][0]; metadata->display_primaries[i][0].den = chroma_den; +metadata->has_primaries &= sei->mastering_display.display_primaries[j][0] >= 5 && + sei->mastering_display.display_primaries[j][0] <= 37000; + metadata->display_primaries[i][1].num = sei->mastering_display.display_primaries[j][1]; metadata->display_primaries[i][1].den = chroma_den; +metadata->has_primaries &= sei->mastering_display.display_primaries[j][1] >= 5 && + sei->mastering_display.display_primaries[j][1] <= 42000; } metadata->white_point[0].num = sei->mastering_display.white_point[0]; metadata->white_point[0].den = chroma_den; +metadata->has_primaries &= sei->mastering_display.white_point[0] >= 5 && + sei->mastering_display.white_point[0] <= 37000; + metadata->white_point[1].num = sei->mastering_display.white_point[1]; metadata->white_point[1].den = chroma_den; +metadata->has_primaries &= sei->mastering_display.white_point[1] >= 5 && + sei->mastering_display.white_point[1] <= 42000; metadata->max_luminance.num = sei->mastering_display.max_luminance; metadata->max_luminance.den = luma_den; +metadata->has_luminance &= sei->mastering_display.max_luminance >= 5 && + sei->mastering_display.max_luminance <= 1; + metadata->min_luminance.num = sei->mastering_display.min_luminance; metadata->min_luminance.den = luma_den; -metadata->has_luminance = 1; -metadata->has_primaries = 1; - -av_log(avctx, AV_LOG_DEBUG, "Mastering Display Metadata:\n"); -av_log(avctx, AV_LOG_DEBUG, - "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f)\n", - av_q2d(metadata->display_primaries[0][0]), - av_q2d(metadata->display_primaries[0][1]), - av_q2d(metadata->display_primaries[1][0]), - av_q2d(metadata->display_primaries[1][1]), - av_q2d(metadata->display_primaries[2][0]), - av_q2d(metadata->display_primaries[2][1]), - av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1])); -av_log(avctx, AV_LOG_DEBUG, - "min_luminance=%f, max_luminance=%f\n", - av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance)); +metadata->has_luminance &= sei->mastering_display.min_luminance >= 1 && + sei->mastering_display.min_luminance <= 5 && + sei->mastering_display.min_luminance < + sei->mastering_display.max_luminance; + +if (metadata->has_luminance || metadata->has_primaries) +av_log(avctx, AV_LOG_DEBUG, "Mastering Display Metadata:\n"); +if (metadata->has_primaries) { +av_log(avctx, AV_LOG_DEBUG, + "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f)\n", + av_q2d(metadata->display_primaries[0][0]), + av_q2d(metadata->display_primaries[0][1]), + av_q2d(metadata->display_primaries[1][0]), + av_q2d(metadata->display_primaries[1][1]), + av_q2d(metadata->display_primaries[2][0]), + av_q2d(metadata->display_primaries[2][1]), + av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1])); +} +
[FFmpeg-devel] [PATCH 3/3] avcodec/libzvbi-teletextdec: change new lines to \n in ASS header
Fixes remaining \r\n is ASS header after 57c545090d. Fixes AVERROR_BUG error during init as this decoder expected `\r\n` in default ASS header. strstr(..., "\r\n[Events]\r\n") failed after changes in 57c545090d. Fixes: 57c545090d --- libavcodec/libzvbi-teletextdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c index 68ffe1f76c..e02ecb8b3a 100644 --- a/libavcodec/libzvbi-teletextdec.c +++ b/libavcodec/libzvbi-teletextdec.c @@ -91,7 +91,7 @@ static int my_ass_subtitle_header(AVCodecContext *avctx) if (ret < 0) return ret; -event_pos = strstr(avctx->subtitle_header, "\r\n[Events]\r\n"); +event_pos = strstr(avctx->subtitle_header, "\n[Events]\n"); if (!event_pos) return AVERROR_BUG; @@ -106,7 +106,7 @@ static int my_ass_subtitle_header(AVCodecContext *avctx) "0,0," /* Spacing, Angle */ "3,0.1,0," /* BorderStyle, Outline, Shadow */ "5,1,1,1," /* Alignment, Margin[LRV] */ -"0\r\n"/* Encoding */ +"0\n" /* Encoding */ "Style: " "Subtitle,"/* Name */ "Monospace,16,"/* Font{name,size} */ @@ -116,7 +116,7 @@ static int my_ass_subtitle_header(AVCodecContext *avctx) "0,0," /* Spacing, Angle */ "1,1,1," /* BorderStyle, Outline, Shadow */ "8,48,48,20," /* Alignment, Margin[LRV] */ -"0\r\n"/* Encoding */ +"0\n" /* Encoding */ , event_pos); if (!new_header) -- 2.43.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 2/3] avcodec/libaribcaption: change new lines to \n in ASS header
Fixes remaining \r\n is ASS header after 57c545090d. --- libavcodec/libaribcaption.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c index 0b67d41772..46a2a591c5 100644 --- a/libavcodec/libaribcaption.c +++ b/libavcodec/libaribcaption.c @@ -522,14 +522,14 @@ static int set_ass_header(ARIBCaptionContext *ctx) av_freep(&avctx->subtitle_header); avctx->subtitle_header = av_asprintf( -"[Script Info]\r\n" -"ScriptType: v4.00+\r\n" -"PlayResX: %d\r\n" -"PlayResY: %d\r\n" -"WrapStyle: 2\r\n" /* 2: no word wrapping */ -"\r\n" - -"[V4+ Styles]\r\n" +"[Script Info]\n" +"ScriptType: v4.00+\n" +"PlayResX: %d\n" +"PlayResY: %d\n" +"WrapStyle: 2\n"/* 2: no word wrapping */ +"\n" + +"[V4+ Styles]\n" "Format: Name, " "Fontname, Fontsize, " "PrimaryColour, SecondaryColour, OutlineColour, BackColour, " @@ -538,7 +538,7 @@ static int set_ass_header(ARIBCaptionContext *ctx) "Spacing, Angle, " "BorderStyle, Outline, Shadow, " "Alignment, MarginL, MarginR, MarginV, " - "Encoding\r\n" + "Encoding\n" "Style: " "Default," /* Name */ @@ -549,11 +549,11 @@ static int set_ass_header(ARIBCaptionContext *ctx) "0,0," /* Spacing, Angle */ "%d,%d,%d,"/* BorderStyle, Outline, Shadow */ "%d,10,10,10," /* Alignment, Margin[LRV] */ - "0\r\n"/* Encoding */ - "\r\n" + "0\n" /* Encoding */ + "\n" - "[Events]\r\n" - "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n", + "[Events]\n" + "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\n", ctx->plane_width, ctx->plane_height, font_name, ctx->font_size, ASS_DEFAULT_COLOR, ASS_DEFAULT_COLOR, -- 2.43.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 1/3] avcodec/libaribb24: change new lines to \n in ASS header
Fixes remaining \r\n is ASS header after 57c545090d. --- libavcodec/libaribb24.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c index 009c995ded..0e4fa9935c 100644 --- a/libavcodec/libaribb24.c +++ b/libavcodec/libaribb24.c @@ -96,13 +96,13 @@ static int libaribb24_generate_ass_header(AVCodecContext *avctx) font_size = get_profile_font_size(avctx); avctx->subtitle_header = av_asprintf( - "[Script Info]\r\n" - "; Script generated by FFmpeg/Lavc%s\r\n" - "ScriptType: v4.00+\r\n" - "PlayResX: %d\r\n" - "PlayResY: %d\r\n" - "\r\n" - "[V4+ Styles]\r\n" + "[Script Info]\n" + "; Script generated by FFmpeg/Lavc%s\n" + "ScriptType: v4.00+\n" + "PlayResX: %d\n" + "PlayResY: %d\n" + "\n" + "[V4+ Styles]\n" /* ASSv4 header */ "Format: Name, " @@ -113,7 +113,7 @@ static int libaribb24_generate_ass_header(AVCodecContext *avctx) "Spacing, Angle, " "BorderStyle, Outline, Shadow, " "Alignment, MarginL, MarginR, MarginV, " - "Encoding\r\n" + "Encoding\n" "Style: " "Default," /* Name */ @@ -124,11 +124,11 @@ static int libaribb24_generate_ass_header(AVCodecContext *avctx) "0,0," /* Spacing, Angle */ "%d,1,0," /* BorderStyle, Outline, Shadow */ "%d,10,10,10," /* Alignment, Margin[LRV] */ - "0\r\n"/* Encoding */ + "0\n" /* Encoding */ - "\r\n" - "[Events]\r\n" - "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n", + "\n" + "[Events]\n" + "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\n", !(avctx->flags & AV_CODEC_FLAG_BITEXACT) ? AV_STRINGIFY(LIBAVCODEC_VERSION) : "", plane_width, plane_height, ASS_DEFAULT_FONT, font_size, ASS_DEFAULT_COLOR, -- 2.43.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] [PATCH 3/3] avutil/tests/opt: test av_opt_find2()
Signed-off-by: James Almer --- libavutil/tests/opt.c | 29 + tests/ref/fate/opt| 4 2 files changed, 33 insertions(+) diff --git a/libavutil/tests/opt.c b/libavutil/tests/opt.c index bac0e80bd5..dc968567eb 100644 --- a/libavutil/tests/opt.c +++ b/libavutil/tests/opt.c @@ -452,5 +452,34 @@ int main(void) av_opt_free(&test_ctx); } +printf("\nTesting av_opt_find2()\n"); +{ +TestContext test_ctx = { 0 }; +ChildContext child_ctx = { 0 }; +void *target; +const AVOption *opt; + +test_ctx.class = &test_class; +test_ctx.child = &child_ctx; +child_ctx.class = &child_class; +av_opt_set_defaults(&test_ctx); +av_opt_set_defaults(&child_ctx); + +av_log_set_level(AV_LOG_QUIET); + +opt = av_opt_find2(&test_ctx, "num", NULL, 0, 0, &target); +if (opt && target == &test_ctx) +printf("OK'%s'\n", opt->name); +else +printf("Error '%s'\n", "num"); + +opt = av_opt_find2(&test_ctx, "child_num", NULL, 0, AV_OPT_SEARCH_CHILDREN, &target); +if (opt && target == &child_ctx) +printf("OK'%s'\n", opt->name); +else +printf("Error '%s'\n", "child_num"); +av_opt_free(&test_ctx); +} + return 0; } diff --git a/tests/ref/fate/opt b/tests/ref/fate/opt index 05d57066a1..39659b2248 100644 --- a/tests/ref/fate/opt +++ b/tests/ref/fate/opt @@ -449,3 +449,7 @@ Setting options string 'a_very_long_option_name_that_will_need_to_be_ellipsized_ Setting 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here' to value '42' Option 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here' not found Error 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here=42' + +Testing av_opt_find2() +OK'num' +OK'child_num' -- 2.44.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-devel] 回复: 回复: [PATCH 2/2] avformat/mov: improve HEIF parsing
> 发件人: James Almer > 发送时间: 2024年4月13日 6:12 > 收件人: Wu Jianhua; ffmpeg-devel@ffmpeg.org > 主题: Re: 回复: [FFmpeg-devel] [PATCH 2/2] avformat/mov: improve HEIF parsing > > On 4/13/2024 8:04 AM, Wu Jianhua wrote: >>> 发件人: ffmpeg-devel 代表 James Almer >>> >>> 发送时间: 2024年1月9日 11:55 >>> 收件人: ffmpeg-devel@ffmpeg.org >>> 主题: [FFmpeg-devel] [PATCH 2/2] avformat/mov: improve HEIF parsing >>> >>> Parse iinf boxes and its child infe boxes to get the actual codec used >>> (AV1 for avif, HEVC for heic), and properly export extradata in a generic >>> way. >>> >>> The avif tests reference files are updated as the extradata is now exported. >>> >>> Signed-off-by: James Almer >>> --- >>> libavformat/isom.h| 3 +- >>> libavformat/mov.c | 157 ++ >>> .../fate/mov-avif-demux-still-image-1-item| 2 +- >>> .../mov-avif-demux-still-image-multiple-items | 2 +- >>> 4 files changed, 95 insertions(+), 69 deletions(-) >>> >> >>> +if (version != 2) { >>> +av_log(c->fc, AV_LOG_ERROR, "infe: version != 2 not supported.\n"); >>> +return AVERROR_PATCHWELCOME; >>> +} >>> + >> >> Hi James, >> >> With the change, some errors occurred and the current FFmpeg failed to >> decode a lot of videos that can be decoded by older FFmpeg. >> [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] st: 0 edit list: 1 Missing key >> frame while searching for timestamp: 1000 >> [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] st: 0 edit list 1 Cannot find >> an index entry before timestamp: 1000. >> [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] infe: version < 2 not supported >> [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] error reading header >> >> I'm not familiar with the mov. Is it possible to treat this error as a >> warning and skip it when the version < 2? >> >> Thanks, >> Jianhua > > Can you test > https://ffmpeg.org//pipermail/ffmpeg-devel/2024-April/325644.html ? It works. Thanks for you quick fix! ___ 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] lavc/vvc: Increase size of ctb_size_y
On 4/13/2024 7:55 AM, Frank Plowman wrote: sps_log2_ctu_size_minus5 is between 0 and 2, with 3 reserved for future use. The VVC decoder allows sps_log2_ctu_size_minus5 to be 3, and so ctb_size_y should be at least 16 bits to prevent overflows. An alternative patch would leave sps_log2_ctu_size_minus5 as 8 bits and disallow sps_log2_ctu_size_minus5 = 3. The spec says a value of 3 should be ignored, which i assume means decoding is not meant to stop. So this patch is probably better than outright rejecting the value in CBS. Signed-off-by: Frank Plowman --- libavcodec/vvc/ps.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vvc/ps.h b/libavcodec/vvc/ps.h index 78f1687fef..6656a06320 100644 --- a/libavcodec/vvc/ps.h +++ b/libavcodec/vvc/ps.h @@ -69,7 +69,7 @@ typedef struct VVCSPS { uint8_t bit_depth; ///< BitDepth uint8_t qp_bd_offset; ///< QpBdOffset uint8_t ctb_log2_size_y;///< CtbLog2SizeY -uint8_t ctb_size_y; ///< CtbSizeY +uint16_tctb_size_y; ///< CtbSizeY uint8_t min_cb_log2_size_y; ///< MinCbLog2SizeY uint8_t min_cb_size_y; ///< MinCbSizeY uint8_t max_tb_size_y; ///< MaxTbSizeY ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] 回复: [PATCH 2/2] avformat/mov: improve HEIF parsing
On 4/13/2024 8:04 AM, Wu Jianhua wrote: 发件人: ffmpeg-devel 代表 James Almer 发送时间: 2024年1月9日 11:55 收件人: ffmpeg-devel@ffmpeg.org 主题: [FFmpeg-devel] [PATCH 2/2] avformat/mov: improve HEIF parsing Parse iinf boxes and its child infe boxes to get the actual codec used (AV1 for avif, HEVC for heic), and properly export extradata in a generic way. The avif tests reference files are updated as the extradata is now exported. Signed-off-by: James Almer --- libavformat/isom.h| 3 +- libavformat/mov.c | 157 ++ .../fate/mov-avif-demux-still-image-1-item| 2 +- .../mov-avif-demux-still-image-multiple-items | 2 +- 4 files changed, 95 insertions(+), 69 deletions(-) +if (version != 2) { +av_log(c->fc, AV_LOG_ERROR, "infe: version != 2 not supported.\n"); +return AVERROR_PATCHWELCOME; +} + Hi James, With the change, some errors occurred and the current FFmpeg failed to decode a lot of videos that can be decoded by older FFmpeg. [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1000 [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] st: 0 edit list 1 Cannot find an index entry before timestamp: 1000. [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] infe: version < 2 not supported [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] error reading header I'm not familiar with the mov. Is it possible to treat this error as a warning and skip it when the version < 2? Thanks, Jianhua Can you test https://ffmpeg.org//pipermail/ffmpeg-devel/2024-April/325644.html ? ___ 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/mov: ignore old infe box versions
Some files with no image items have them, and were working prior to the recent HEIF parsing overhaul. Ignore such boxes instead, to recover the old behavior. Fixes a regression since d9fed9df2a9e70c9375d3b2591db35c09303d369. Signed-off-by: James Almer --- libavformat/mov.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 0c892b56c8..160e0b14fb 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -8137,8 +8137,8 @@ static int mov_read_infe(MOVContext *c, AVIOContext *pb, MOVAtom atom, int idx) size -= 4; if (version < 2) { -av_log(c->fc, AV_LOG_ERROR, "infe: version < 2 not supported\n"); -return AVERROR_PATCHWELCOME; +avpriv_report_missing_feature(c->fc, "infe version < 2"); +return 1; } item_id = version > 2 ? avio_rb32(pb) : avio_rb16(pb); @@ -8209,6 +8209,8 @@ static int mov_read_iinf(MOVContext *c, AVIOContext *pb, MOVAtom atom) ret = mov_read_infe(c, pb, infe, i); if (ret < 0) return ret; +if (ret) +return 0; } c->found_iinf = 1; @@ -9508,14 +9510,15 @@ static int mov_read_header(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "error reading header\n"); return err; } -} while ((pb->seekable & AVIO_SEEKABLE_NORMAL) && !mov->found_moov && !mov->found_iloc && !mov->moov_retry++); -if (!mov->found_moov && !mov->found_iloc) { +} while ((pb->seekable & AVIO_SEEKABLE_NORMAL) && + !mov->found_moov && !mov->found_iloc && !mov->found_iinf && !mov->moov_retry++); +if (!mov->found_moov && !mov->found_iloc && !mov->found_iinf) { av_log(s, AV_LOG_ERROR, "moov atom not found\n"); return AVERROR_INVALIDDATA; } av_log(mov->fc, AV_LOG_TRACE, "on_parse_exit_offset=%"PRId64"\n", avio_tell(pb)); -if (mov->found_iloc) { +if (mov->found_iloc && mov->found_iinf) { for (i = 0; i < mov->nb_heif_item; i++) { HEIFItem *item = &mov->heif_item[i]; MOVStreamContext *sc; -- 2.44.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] libavutil/hwcontext_qsv: Make qsv hardware transfers thread safe
The QSV hardware context currently uses pthreads to lock initilization, which is not available on windows builds. Instead, use the AVMutex object. Also lock uses of the realigned_upload_frame and realigned_download_frame objects, so multiple threads do not attempt to write to them at the same time. --- libavutil/hwcontext_qsv.c | 75 --- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index c7c7878644..92bab134e4 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -23,10 +23,7 @@ #include #include "config.h" - -#if HAVE_PTHREADS -#include -#endif +#include "thread.h" #define COBJMACROS #if CONFIG_VAAPI @@ -98,9 +95,7 @@ typedef struct QSVFramesContext { atomic_int session_download_init; mfxSession session_upload; atomic_int session_upload_init; -#if HAVE_PTHREADS -pthread_mutex_t session_lock; -#endif +AVMutex session_lock; AVBufferRef *child_frames_ref; mfxFrameSurface1 *surfaces_internal; @@ -354,9 +349,7 @@ static void qsv_frames_uninit(AVHWFramesContext *ctx) s->session_upload = NULL; s->session_upload_init = 0; -#if HAVE_PTHREADS -pthread_mutex_destroy(&s->session_lock); -#endif +ff_mutex_destroy(&s->session_lock); av_freep(&s->mem_ids); #if QSV_HAVE_OPAQUE @@ -1302,9 +1295,7 @@ static int qsv_frames_init(AVHWFramesContext *ctx) s->session_download_init = 0; s->session_upload_init = 0; -#if HAVE_PTHREADS -pthread_mutex_init(&s->session_lock, NULL); -#endif +ff_mutex_init(&s->session_lock, NULL); return 0; } @@ -1629,24 +1620,20 @@ static int qsv_internal_session_check_init(AVHWFramesContext *ctx, int upload) if (atomic_load(inited)) return 0; -#if HAVE_PTHREADS -pthread_mutex_lock(&s->session_lock); -#endif +ff_mutex_lock(&s->session_lock); if (!atomic_load(inited)) { ret = qsv_init_internal_session(ctx, session, upload); atomic_store(inited, 1); } -#if HAVE_PTHREADS -pthread_mutex_unlock(&s->session_lock); -#endif +ff_mutex_unlock(&s->session_lock); return ret; } -static int qsv_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst, - const AVFrame *src) +static int qsv_transfer_data_from_internal(AVHWFramesContext *ctx, AVFrame *dst, + const AVFrame *src, int realigned) { QSVFramesContext *s = ctx->hwctx; mfxFrameSurface1 out = {{ 0 }}; @@ -1658,7 +1645,6 @@ static int qsv_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst, /* download to temp frame if the output is not padded as libmfx requires */ AVFrame *tmp_frame = &s->realigned_download_frame; AVFrame *dst_frame; -int realigned = 0; ret = qsv_internal_session_check_init(ctx, 0); if (ret < 0) @@ -1667,8 +1653,7 @@ static int qsv_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst, /* According to MSDK spec for mfxframeinfo, "Width must be a multiple of 16. * Height must be a multiple of 16 for progressive frame sequence and a * multiple of 32 otherwise.", so allign all frames to 16 before downloading. */ -if (dst->height & 15 || dst->linesize[0] & 15) { -realigned = 1; +if (realigned) { if (tmp_frame->format != dst->format || tmp_frame->width != FFALIGN(dst->linesize[0], 16) || tmp_frame->height != FFALIGN(dst->height, 16)) { @@ -1728,8 +1713,25 @@ static int qsv_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst, return 0; } -static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, -const AVFrame *src) +static int qsv_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst, + const AVFrame *src) +{ + QSVFramesContext *s = ctx->hwctx; +int realigned = 0; +if (dst->height & 15 || dst->linesize[0] & 15) +{ +realigned = 1; +ff_mutex_lock(&s->session_lock); +} +int ret = qsv_transfer_data_from_internal(ctx, dst, src, realigned); +if (realigned) +ff_mutex_unlock(&s->session_lock); + +return ret; +} + +static int qsv_transfer_data_to_internal(AVHWFramesContext *ctx, AVFrame *dst, +const AVFrame *src, int realigned) { QSVFramesContext *s = ctx->hwctx; mfxFrameSurface1 in = {{ 0 }}; @@ -1742,7 +1744,6 @@ static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, /* make a copy if the input is not padded as libmfx requires */ AVFrame *tmp_frame = &s->realigned_upload_frame; const AVFrame *src_frame; -int realigned = 0; ret = qsv_internal_session_check_init(ctx, 1); if (ret < 0) @@ -1751,8 +1752,7 @@ static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, /* According to MSDK spec for mfxframeinfo,
[FFmpeg-devel] 回复: [PATCH 2/2] avformat/mov: improve HEIF parsing
> 发件人: ffmpeg-devel 代表 James Almer > > 发送时间: 2024年1月9日 11:55 > 收件人: ffmpeg-devel@ffmpeg.org > 主题: [FFmpeg-devel] [PATCH 2/2] avformat/mov: improve HEIF parsing > > Parse iinf boxes and its child infe boxes to get the actual codec used > (AV1 for avif, HEVC for heic), and properly export extradata in a generic > way. > > The avif tests reference files are updated as the extradata is now exported. > > Signed-off-by: James Almer > --- > libavformat/isom.h| 3 +- > libavformat/mov.c | 157 ++ > .../fate/mov-avif-demux-still-image-1-item| 2 +- > .../mov-avif-demux-still-image-multiple-items | 2 +- > 4 files changed, 95 insertions(+), 69 deletions(-) > > +if (version != 2) { > +av_log(c->fc, AV_LOG_ERROR, "infe: version != 2 not supported.\n"); > +return AVERROR_PATCHWELCOME; > +} > + Hi James, With the change, some errors occurred and the current FFmpeg failed to decode a lot of videos that can be decoded by older FFmpeg. [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1000 [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] st: 0 edit list 1 Cannot find an index entry before timestamp: 1000. [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] infe: version < 2 not supported [mov,mp4,m4a,3gp,3g2,mj2 @ 01e6e79aac80] error reading header I'm not familiar with the mov. Is it possible to treat this error as a warning and skip it when the version < 2? Thanks, Jianhua ___ 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/vvc: Increase size of ctb_size_y
sps_log2_ctu_size_minus5 is between 0 and 2, with 3 reserved for future use. The VVC decoder allows sps_log2_ctu_size_minus5 to be 3, and so ctb_size_y should be at least 16 bits to prevent overflows. An alternative patch would leave sps_log2_ctu_size_minus5 as 8 bits and disallow sps_log2_ctu_size_minus5 = 3. Signed-off-by: Frank Plowman --- libavcodec/vvc/ps.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vvc/ps.h b/libavcodec/vvc/ps.h index 78f1687fef..6656a06320 100644 --- a/libavcodec/vvc/ps.h +++ b/libavcodec/vvc/ps.h @@ -69,7 +69,7 @@ typedef struct VVCSPS { uint8_t bit_depth; ///< BitDepth uint8_t qp_bd_offset; ///< QpBdOffset uint8_t ctb_log2_size_y;///< CtbLog2SizeY -uint8_t ctb_size_y; ///< CtbSizeY +uint16_tctb_size_y; ///< CtbSizeY uint8_t min_cb_log2_size_y; ///< MinCbLog2SizeY uint8_t min_cb_size_y; ///< MinCbSizeY uint8_t max_tb_size_y; ///< MaxTbSizeY -- 2.44.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] resignation from CC
Anton Khirnov 于2024年4月13日周六 17:58写道: > > Hi all, > I am hereby resigning from my position as a CC member, since I do not > want to be associated with the CC's utter lack of initiative and > meaningful action. What's happened? Perhaps have some misunderstand with some body or some things? 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] avcodec/vvc/ps: reset sps_id_used on PS uninit
On 09/04/2024 14:36, Nuo Mi wrote: > On Mon, Apr 8, 2024 at 11:15 PM Frank Plowman wrote: > >> On 08/04/2024 15:12, Nuo Mi wrote: >>> On Mon, Apr 8, 2024 at 4:37 PM Frank Plowman >> wrote: >>> On 07/04/2024 15:48, James Almer wrote: > On 4/7/2024 10:38 AM, Nuo Mi wrote: >> On Sun, Apr 7, 2024 at 11:05 AM James Almer >> wrote: >> >>> Signed-off-by: James Almer >>> --- >>> libavcodec/vvc/ps.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/libavcodec/vvc/ps.c b/libavcodec/vvc/ps.c >>> index 3c71c34bae..83ee75fb62 100644 >>> --- a/libavcodec/vvc/ps.c >>> +++ b/libavcodec/vvc/ps.c >>> @@ -912,6 +912,7 @@ void ff_vvc_ps_uninit(VVCParamSets *ps) >>> ff_refstruct_unref(&ps->sps_list[i]); >>> for (int i = 0; i < FF_ARRAY_ELEMS(ps->pps_list); i++) >>> ff_refstruct_unref(&ps->pps_list[i]); >>> +ps->sps_id_used = 0; >>> >> Hi James, >> thank you for the patch. >> >> Is this really necessary? >> vvc_ps_uninit will be called by vvc_decode_free, >> We are not supposed to use any member of VVCParamSets after >> vvc_decode_free. > > My bad, i thought it was also called on every flush() call. > > Something like the following: > >> diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c >> index eb447604fe..463536512e 100644 >> --- a/libavcodec/vvc/dec.c >> +++ b/libavcodec/vvc/dec.c >> @@ -963,6 +963,8 @@ static av_cold void >> vvc_decode_flush(AVCodecContext *avctx) >> ff_vvc_flush_dpb(last); >> } >> >> +s->ps->sps_id_used = 0; >> + >> s->eos = 1; >> } > > Should be done on FFCodec.flush() (like when seeking) as the previous > state is no longer valid, right? Yes I agree, I think this is needed. Cases where the random access point has no leading pictures should be covered by the existing logic as these always fall at the start of a CVS, but I think this is needed to cover the case in which there are leading pictures. >>> This patch isn't necessary. >>> Leading pictures won't carry SPS. >>> IDR, CRA, and GDR will carry SPS, but they will also start a new CVS, >> which >>> will covered by the current logic. >>> >> >> I may be misunderstanding the spec, NoOutputBeforeRecoveryFlag is set >> for pictures which have no leading pictures, no? In any case take, for >> instance, a CRA picture. In most cases, CRA pictures have >> NoOutputBeforeRecoveryFlag=0, therefore are not CLVSS pictures and >> sps_id_used is not reset by the existing logic. Do we not need to reset >> sps_id_used when seeking to a CRA then? >> > After seeking, we'll set s->last_eos to 1. > For a CRA, decode_recovery_flag will set s->no_output_before_recovery_flag > to s->last_eos. > So no_output_before_recovery_flag will be 1, not 0. I see, my mistake. Yes in this case I do not think sps_id_used must be explicitly reset. -- Frank ___ 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] resignation from CC
Hi all, I am hereby resigning from my position as a CC member, since I do not want to be associated with the CC's utter lack of initiative and meaningful action. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH] avformat/httpauth.c [support both RFC 2617 and RFC 7617]
On date Thursday 2024-04-11 07:48:14 +, �� | Eugene wrote: > - Updated the make_digest_auth() function to support both RFC 2617 and RFC > 7617 digest authentication. > - Supports sha256 , sha512-256 along with the existing md5. MD5 and sha256 > were tested, but sha512-256 was not tested due to lack of testable server. > - AVHashContext instead of AVMD5 structure. > - update_md5_strings() -> update_hash_strings(). > - There are some lynt issues in the old code of make_digest_auth, but this is > a feature update patch, so I didn't fix it. > - modified the implementation of RFC7616 based on community feedback. > > Signed-off-by: Eugene-bitsensing > --- > libavformat/httpauth.c | 105 ++--- > 1 file changed, 57 insertions(+), 48 deletions(-) > > diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c > index 9780928357..ba2ebea3a4 100644 > --- a/libavformat/httpauth.c > +++ b/libavformat/httpauth.c > @@ -24,7 +24,7 @@ > #include "libavutil/avstring.h" > #include "internal.h" > #include "libavutil/random_seed.h" > -#include "libavutil/md5.h" > +#include "libavutil/hash.h" > #include "urldecode.h" > > static void handle_basic_params(HTTPAuthState *state, const char *key, > @@ -117,35 +117,35 @@ void ff_http_auth_handle_header(HTTPAuthState *state, > const char *key, > } > } > > - > -static void update_md5_strings(struct AVMD5 *md5ctx, ...) > +/* Generate hash string, updated to use AVHashContext to support other > algorithms */ > +static void update_hash_strings(struct AVHashContext* hash_ctx, ...) > { > va_list vl; > > -va_start(vl, md5ctx); > +va_start(vl, hash_ctx); > while (1) { > const char* str = va_arg(vl, const char*); > if (!str) > break; > -av_md5_update(md5ctx, str, strlen(str)); > +av_hash_update(hash_ctx, (const uint8_t*)str, strlen(str)); nit++: (const uint8_t *)str note the space before the "*" > } > va_end(vl); > } > > -/* Generate a digest reply, according to RFC 2617. */ > +/* Generate a digest reply, according to RFC 2617. Update to support RFC > 7617*/ nit: according to RFC 2617/7617 > static char *make_digest_auth(HTTPAuthState *state, const char *username, >const char *password, const char *uri, >const char *method) > { > DigestParams *digest = &state->digest_params; > -int len; > +size_t len;// change int -> size_t drop this comment > uint32_t cnonce_buf[2]; > char cnonce[17]; > char nc[9]; > int i; > -char A1hash[33], A2hash[33], response[33]; > -struct AVMD5 *md5ctx; > -uint8_t hash[16]; > +char a1_hash[65], a2_hash[65], response[65]; // increase hash size for > SHA-2 same here, drop the comment or this will be confusing without reference to the diff > +struct AVHashContext* hash_ctx = NULL; // use AVHashContext for other > algorithm support nit: here and below, use: TYPE *VAR rather than: TYPE* VAR style for consistency > +size_t len_hash = 33; // Modifiable hash length, MD5:32, SHA-2:64 > char *authstr; > > digest->nc++; > @@ -156,52 +156,61 @@ static char *make_digest_auth(HTTPAuthState *state, > const char *username, > cnonce_buf[i] = av_get_random_seed(); > ff_data_to_hex(cnonce, (const uint8_t*) cnonce_buf, sizeof(cnonce_buf), > 1); > > -md5ctx = av_md5_alloc(); > -if (!md5ctx) > -return NULL; > - > -av_md5_init(md5ctx); > -update_md5_strings(md5ctx, username, ":", state->realm, ":", password, > NULL); > -av_md5_final(md5ctx, hash); > -ff_data_to_hex(A1hash, hash, 16, 1); > - > -if (!strcmp(digest->algorithm, "") || !strcmp(digest->algorithm, "MD5")) > { > -} else if (!strcmp(digest->algorithm, "MD5-sess")) { > -av_md5_init(md5ctx); > -update_md5_strings(md5ctx, A1hash, ":", digest->nonce, ":", cnonce, > NULL); > -av_md5_final(md5ctx, hash); > -ff_data_to_hex(A1hash, hash, 16, 1); > -} else { > -/* Unsupported algorithm */ > -av_free(md5ctx); > +/* Generate hash context by algorithm. */ > +const char* algorithm = digest->algorithm; > +const char* hashing_algorithm; > +if (!*algorithm) { > +algorithm = "MD5"; // if empty, use MD5 as Default > +hashing_algorithm = "MD5"; > +} > +else if (av_stristr(algorithm, "md5") || av_stristr(algorithm, "MD5")) { this should be case-insensitive so you can skip one check also I wonder if this should be a strcmp, for example can it happen to have "foo-md5-bar" and should the algorithm be tolerant in such cases? style nit: here and below, put { and else on the same line } else ... { > +hashing_algorithm = "MD5"; > +} > +else if (av_stristr(algorithm, "sha256") || av_stristr(algorithm, > "sha-256")) { > +hashing_algorithm = "SHA256"; > +len_hash = 65; /
Re: [FFmpeg-devel] [PATCH] doc/muxers.texi: Don't use confusing variable name
On date Saturday 2024-04-13 00:38:49 +0200, Andreas Rheinhardt wrote: > reserve_index_space is a size, not an index. > Also refer to the variable in the description. > > Signed-off-by: Andreas Rheinhardt > --- > doc/muxers.texi | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/doc/muxers.texi b/doc/muxers.texi > index 4b30970b78..489f22288b 100644 > --- a/doc/muxers.texi > +++ b/doc/muxers.texi > @@ -2816,14 +2816,14 @@ ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx > -metadata stereo_mode=left_ > > @subsection Options > @table @option > -@item reserve_index_space @var{index} > +@item reserve_index_space @var{size} > By default, this muxer writes the index for seeking (called cues in Matroska > terms) at the end of the file, because it cannot know in advance how much > space > to leave for the index at the beginning of the file. However for some use > cases > -- e.g. streaming where seeking is possible but slow -- it is useful to put > the > index at the beginning of the file. > > -If this option is set to a non-zero value, the muxer will reserve a given > amount > +If this option is set to a non-zero value, the muxer will reserve @var{size} > bytes > of space in the file header and then try to write the cues there when the > muxing > finishes. If the reserved space does not suffice, no Cues will be written, > the > file will be finalized and writing the trailer will return an error. This is more correct, 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] avformat/lc3: Add file format for LC3/LC3plus transport
On date Friday 2024-04-12 16:46:29 -0700, ffmpeg-devel Mailing List wrote: > Thanks. > > On Fri, Apr 12, 2024 at 6:05 AM Stefano Sabatini wrote: [...] > From 93c5628502a1f242043b39a18e83895d9067541e Mon Sep 17 00:00:00 2001 > From: Antoine SOULIER > Date: Thu, 4 Apr 2024 22:38:03 + > Subject: [PATCH] avformat/lc3: Add file format for LC3/LC3plus transport > > A file format is described in Bluetooth SIG LC3 and ETSI TS 103 634, for > test purpose. This is the format implemented here. > --- > Changelog| 1 + > doc/muxers.texi | 6 + > libavformat/Makefile | 2 + > libavformat/allformats.c | 2 + > libavformat/lc3.c| 252 +++ > 5 files changed, 263 insertions(+) > create mode 100644 libavformat/lc3.c Looks good to me. Andreas, Paul, please comment. If I see no comments I'll push this in two/three days. 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".