Re: [FFmpeg-devel] [PATCH] Moves yuv2yuvX_sse3 to yasm, unrolls main loop and other small optimizations for ~20% speedup.
Ping On Thu, Nov 19, 2020 at 9:42 AM Alan Kelly wrote: > --- > All of Henrik's suggestions have been implemented. Additionally, > m3 and m6 are permuted in avx2 before storing to ensure bit by bit > identical results in avx2. > libswscale/x86/Makefile | 1 + > libswscale/x86/swscale.c| 75 +++ > libswscale/x86/yuv2yuvX.asm | 118 > 3 files changed, 129 insertions(+), 65 deletions(-) > create mode 100644 libswscale/x86/yuv2yuvX.asm > > diff --git a/libswscale/x86/Makefile b/libswscale/x86/Makefile > index 831d5359aa..bfe383364e 100644 > --- a/libswscale/x86/Makefile > +++ b/libswscale/x86/Makefile > @@ -13,3 +13,4 @@ X86ASM-OBJS += x86/input.o > \ > x86/scale.o \ > x86/rgb_2_rgb.o \ > x86/yuv_2_rgb.o \ > + x86/yuv2yuvX.o \ > diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c > index 3160fedf04..758c8e540f 100644 > --- a/libswscale/x86/swscale.c > +++ b/libswscale/x86/swscale.c > @@ -197,80 +197,25 @@ void ff_updateMMXDitherTables(SwsContext *c, int > dstY) > } > > #if HAVE_MMXEXT > +void ff_yuv2yuvX_sse3(const int16_t *filter, long filterSize, > + uint8_t *dest, int dstW, > + const uint8_t *dither, int offset); > + > static void yuv2yuvX_sse3(const int16_t *filter, int filterSize, > const int16_t **src, uint8_t *dest, int dstW, > const uint8_t *dither, int offset) > { > +int remainder = (dstW % 32); > +int pixelsProcessed = dstW - remainder; > if(((uintptr_t)dest) & 15){ > yuv2yuvX_mmxext(filter, filterSize, src, dest, dstW, dither, > offset); > return; > } > -filterSize--; > -#define MAIN_FUNCTION \ > -"pxor %%xmm0, %%xmm0 \n\t" \ > -"punpcklbw %%xmm0, %%xmm3 \n\t" \ > -"movd %4, %%xmm1 \n\t" \ > -"punpcklwd %%xmm1, %%xmm1 \n\t" \ > -"punpckldq %%xmm1, %%xmm1 \n\t" \ > -"punpcklqdq %%xmm1, %%xmm1 \n\t" \ > -"psllw $3, %%xmm1 \n\t" \ > -"paddw %%xmm1, %%xmm3 \n\t" \ > -"psraw $4, %%xmm3 \n\t" \ > -"movdqa %%xmm3, %%xmm4 \n\t" \ > -"movdqa %%xmm3, %%xmm7 \n\t" \ > -"movl %3, %%ecx \n\t" \ > -"mov %0, %%"FF_REG_d" > \n\t"\ > -"mov(%%"FF_REG_d"), %%"FF_REG_S" > \n\t"\ > -".p2align 4 \n\t" /* > FIXME Unroll? */\ > -"1: \n\t"\ > -"movddup 8(%%"FF_REG_d"), %%xmm0 \n\t" /* > filterCoeff */\ > -"movdqa (%%"FF_REG_S", %%"FF_REG_c", 2), %%xmm2 > \n\t" /* srcData */\ > -"movdqa16(%%"FF_REG_S", %%"FF_REG_c", 2), %%xmm5 > \n\t" /* srcData */\ > -"add$16, %%"FF_REG_d" > \n\t"\ > -"mov(%%"FF_REG_d"), %%"FF_REG_S" > \n\t"\ > -"test %%"FF_REG_S", %%"FF_REG_S" > \n\t"\ > -"pmulhw %%xmm0, %%xmm2 \n\t"\ > -"pmulhw %%xmm0, %%xmm5 \n\t"\ > -"paddw%%xmm2, %%xmm3 \n\t"\ > -"paddw%%xmm5, %%xmm4 \n\t"\ > -" jnz1b \n\t"\ > -"psraw $3, %%xmm3 \n\t"\ > -"psraw $3, %%xmm4 \n\t"\ > -"packuswb %%xmm4, %%xmm3 \n\t"\ > -"movntdq %%xmm3, (%1, %%"FF_REG_c") > \n\t"\ > -"add $16, %%"FF_REG_c"\n\t"\ > -"cmp %2, %%"FF_REG_c"\n\t"\ > -"movdqa %%xmm7, %%xmm3\n\t" \ > -"movdqa %%xmm7, %%xmm4\n\t" \ > -"mov %0, %%"FF_REG_d" > \n\t"\ > -"mov(%%"FF_REG_d"), %%"FF_REG_S" > \n\t"\ > -"jb 1b \n\t" > - > -if (offset) { > -__asm__ volatile( > -"movq %5, %%xmm3 \n\t" > -"movdqa%%xmm3, %%xmm4 \n\t" > -"psrlq$24, %%xmm3 \n\t" > -"psllq$40, %%xmm4 \n\t" > -"por %%xmm4, %%xmm3 \n\t" > -MAIN_FUNCTION > - :: "g" (filter), > - "r" (dest-offset), "g" ((x86_reg)(dstW+offset)), "m" >
[FFmpeg-devel] [PATCH] avformat/hls: Fixes overwriting existing #EXT-X-PROGRAM-DATE-TIME value in HLS playlist
Bug ID: 8989 This is is due to the following behavior in the current code: 1. The initial_prog_date_time gets set to the current local time 2. The existing playlist (.m3u8) file gets parsed and the segments present are added to the variant stream 3. The new segment is created and added 4. The existing segments and the new segment are written to the playlist file. The initial_prog_date_time from point 1 is used for calculating "#EXT-X-PROGRAM-DATE-TIME" for the segments, which results in incorrect "#EXT-X-PROGRAM-DATE-TIME" values for existing segments The following approach fixes this bug: 1. Add a new variable "discont_program_date_time" of type double to HLSSegment struct 2. Store the "EXT-X-PROGRAM-DATE-TIME" value from the existing segments in this variable 3. When writing to playlist file if "discont_program_date_time" is set, then use that value for "EXT-X-PROGRAM-DATE-TIME" else use the value present in vs->initial_prog_date_time Signed-off-by: Vignesh Ravichandran --- libavformat/hlsenc.c | 33 ++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index cbfd8f7c0d..9bce374605 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -88,6 +88,7 @@ typedef struct HLSSegment { char iv_string[KEYSIZE*2 + 1]; struct HLSSegment *next; +double discont_program_date_time; } HLSSegment; typedef enum HLSFlags { @@ -1124,6 +1125,7 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, en->keyframe_size = vs->video_keyframe_size; en->next = NULL; en->discont = 0; +en->discont_program_date_time = 0; if (vs->discontinuity) { en->discont = 1; @@ -1148,7 +1150,8 @@ static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, if (hls->max_nb_segments && vs->nb_entries >= hls->max_nb_segments) { en = vs->segments; -vs->initial_prog_date_time += en->duration; +if (!en->next->discont_program_date_time && !en->discont_program_date_time) +vs->initial_prog_date_time += en->duration; vs->segments = en->next; if (en && hls->flags & HLS_DELETE_SEGMENTS && #if FF_API_HLS_WRAP @@ -1182,6 +1185,7 @@ static int parse_playlist(AVFormatContext *s, const char *url, VariantStream *vs char line[MAX_URL_SIZE]; const char *ptr; const char *end; +double discont_program_date_time = 0; if ((ret = ffio_open_whitelist(&in, url, AVIO_FLAG_READ, &s->interrupt_callback, NULL, @@ -1236,7 +1240,25 @@ static int parse_playlist(AVFormatContext *s, const char *url, VariantStream *vs av_strlcpy(vs->iv_string, ptr, sizeof(vs->iv_string)); } } +} else if (av_strstart(line, "#EXT-X-PROGRAM-DATE-TIME:", &ptr)) { +struct tm program_date_time; +int y,M,d,h,m,s; +double ms; +if (sscanf(ptr, "%d-%d-%dT%d:%d:%d.%lf", &y, &M, &d, &h, &m, &s, &ms) != 7) { +ret = AVERROR_INVALIDDATA; +goto fail; +} + +program_date_time.tm_year = y - 1900; +program_date_time.tm_mon = M - 1; +program_date_time.tm_mday = d; +program_date_time.tm_hour = h; +program_date_time.tm_min = m; +program_date_time.tm_sec = s; +program_date_time.tm_isdst = -1; +discont_program_date_time = mktime(&program_date_time); +discont_program_date_time += (double)(ms / 1000); } else if (av_strstart(line, "#", NULL)) { continue; } else if (line[0]) { @@ -1250,8 +1272,9 @@ static int parse_playlist(AVFormatContext *s, const char *url, VariantStream *vs is_segment = 0; new_start_pos = avio_tell(vs->avf->pb); vs->size = new_start_pos - vs->start_pos; -vs->initial_prog_date_time -= vs->duration; // this is a previously existing segment ret = hls_append_segment(s, hls, vs, vs->duration, vs->start_pos, vs->size); +vs->last_segment->discont_program_date_time = discont_program_date_time; +discont_program_date_time += vs->duration; if (ret < 0) goto fail; vs->start_pos = new_start_pos; @@ -1572,7 +1595,11 @@ static int hls_window(AVFormatContext *s, int last, VariantStream *vs) ret = ff_hls_write_file_entry(byterange_mode ? hls->m3u8_out : vs->out, en->discont, byterange_mode, en->duration, hls->flags & HLS_ROUND_DURATIONS, en->size, en->pos, hls->baseurl, - en->filename, prog_date_time_p, en->keyframe_size, en->keyframe_pos, hls->flags & HLS_I_FRAMES_ONLY); +
Re: [FFmpeg-devel] [PATCH] avformat/hls: Fixes overwriting existing #EXT-X-PROGRAM-DATE-TIME value in HLS playlist Bug ID: 8989
Ping Steven, Andreas, Andriy and others, I have pushed a patch with the sscanf check ( http://ffmpeg.org/pipermail/ffmpeg-devel/2020-December/273185.html) and also verified that the build passes ( https://patchwork.ffmpeg.org/project/ffmpeg/patch/20201201101040.28338-1-vignesh.ravichandra...@gmail.com/). Could you please advise if this is acceptable? Thanks, Vignesh On Fri, Nov 27, 2020 at 12:11 PM Steven Liu wrote: > > > > 2020年11月27日 下午2:36,Vignesh Ravichandran < > vignesh.ravichandra...@gmail.com> 写道: > > > > av_isdigit seems to only check if the integer is from 0 to 9. So values > > above 9 would fail the check, for example: 2020 would fail the check. > Also, > > we will not be able to use av_isdigit for checking the double value. > > > > On Fri, Nov 27, 2020 at 7:41 AM Steven Liu wrote: > > > >> > >> > >>> 2020年11月26日 下午10:21,Vignesh Ravichandran < > >> vignesh.ravichandra...@gmail.com> 写道: > >>> > >>> This is is due to the following behavior in the current code: > >>> 1. The initial_prog_date_time gets set to the current local time > >>> 2. The existing playlist (.m3u8) file gets parsed and the segments > >> present are added to the variant stream > >>> 3. The new segment is created and added > >>> 4. The existing segments and the new segment are written to the > playlist > >> file. The initial_prog_date_time from point 1 is used for calculating > >> "#EXT-X-PROGRAM-DATE-TIME" for the segments, which results in incorrect > >> "#EXT-X-PROGRAM-DATE-TIME" values for existing segments > >>> > >>> The following approach fixes this bug: > >>> 1. Add a new variable "discont_program_date_time" of type double to > >> HLSSegment struct > >>> 2. Store the "EXT-X-PROGRAM-DATE-TIME" value from the existing segments > >> in this variable > >>> 3. When writing to playlist file if "discont_program_date_time" is set, > >> then use that value for "EXT-X-PROGRAM-DATE-TIME" else use the value > >> present in vs->initial_prog_date_time > >>> > >>> Signed-off-by: Vignesh Ravichandran > >>> --- > >>> libavformat/hlsenc.c | 83 ++-- > >>> 1 file changed, 80 insertions(+), 3 deletions(-) > >>> > >>> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c > >>> index cbfd8f7c0d..9346b2cfea 100644 > >>> --- a/libavformat/hlsenc.c > >>> +++ b/libavformat/hlsenc.c > >>> @@ -25,6 +25,10 @@ > >>> #include > >>> #if HAVE_UNISTD_H > >>> #include > >>> +#include > >>> +#include > >>> +#include > >>> +#include > >>> #endif > >>> > >>> #if CONFIG_GCRYPT > >>> @@ -88,6 +92,7 @@ typedef struct HLSSegment { > >>>char iv_string[KEYSIZE*2 + 1]; > >>> > >>>struct HLSSegment *next; > >>> +double discont_program_date_time; > >>> } HLSSegment; > >>> > >>> typedef enum HLSFlags { > >>> @@ -1124,6 +1129,7 @@ static int hls_append_segment(struct > >> AVFormatContext *s, HLSContext *hls, > >>>en->keyframe_size = vs->video_keyframe_size; > >>>en->next = NULL; > >>>en->discont = 0; > >>> +en->discont_program_date_time = 0; > >>> > >>>if (vs->discontinuity) { > >>>en->discont = 1; > >>> @@ -1148,7 +1154,8 @@ static int hls_append_segment(struct > >> AVFormatContext *s, HLSContext *hls, > >>> > >>>if (hls->max_nb_segments && vs->nb_entries >= hls->max_nb_segments) > { > >>>en = vs->segments; > >>> -vs->initial_prog_date_time += en->duration; > >>> +if (!en->next->discont_program_date_time && > >> !en->discont_program_date_time) > >>> +vs->initial_prog_date_time += en->duration; > >>>vs->segments = en->next; > >>>if (en && hls->flags & HLS_DELETE_SEGMENTS && > >>> #if FF_API_HLS_WRAP > >>> @@ -1173,6 +1180,44 @@ static int hls_append_segment(struct > >> AVFormatContext *s, HLSContext *hls, > >>>return 0; > >>> } > >>> > >>> +static int check_program_date_time(const char *prog_date_time) { > >>> +char s[strlen(prog_date_time)], *sptr0, *sptr1, *sptr2, *sptr3; > >>> +char *err = NULL; > >>> +char *arr[6] = {NULL}; > >>> +int i = 0; > >>> +av_strlcpy(s, prog_date_time, strlen(prog_date_time)); > >>> +char *p = strtok_r(strtok_r(s, "+", &sptr0), "T", &sptr1); > >>> +while (p) { > >>> +char *q = strtok_r(p, "-", &sptr2); > >>> +while (q) { > >>> +char *r = strtok_r(q, ":", &sptr3); > >>> +while (r) { > >>> +arr[i] = r; > >>> +i++; > >>> +r = strtok_r(NULL, ":", &sptr3); > >>> +} > >>> +q = strtok_r(NULL, "-", &sptr2); > >>> +} > >>> +p = strtok_r(NULL, "T", &sptr1); > >>> +} > >>> + > >>> +for (i=0; i < 5; i++) { > >>> +errno=0; > >>> +long number = strtol(arr[i], &err, 10); > >>> +if((arr[i] == err) || (errno == ERANGE && number == LONG_MIN) > >> || (errno == ERANGE && number == LONG_MAX) > >>> +|| (errno == EINVAL) || (errno != 0 && number == 0) || > >> (errno == 0 && arr[i] && *err != 0)) > >> What a
Re: [FFmpeg-devel] [PATCH 1/2] avcodec/cbs_av1: ensure Sequence Header unit content is always reference counted
On 9/29/2020 11:22 AM, James Almer wrote: Prevents a NULL pointer dereference. Signed-off-by: James Almer --- libavcodec/cbs_av1.c | 4 1 file changed, 4 insertions(+) diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index c66757125f..aef8cf8e64 100644 --- a/libavcodec/cbs_av1.c +++ b/libavcodec/cbs_av1.c @@ -1043,6 +1043,10 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx, av_buffer_unref(&priv->sequence_header_ref); priv->sequence_header = NULL; +err = ff_cbs_make_unit_refcounted(ctx, unit); +if (err < 0) +return err; + priv->sequence_header_ref = av_buffer_ref(unit->content_ref); if (!priv->sequence_header_ref) return AVERROR(ENOMEM); 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 1/4 v2] avcodec/cbs: add an AVClass to CodedBitstreamType for option handling
On 11/15/2020 6:55 PM, James Almer wrote: So unit parsing may be configured with caller set options. Signed-off-by: James Almer --- libavcodec/cbs.c | 9 + libavcodec/cbs_internal.h | 6 ++ 2 files changed, 15 insertions(+) diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c index c8c526ab12..c7afccd6f5 100644 --- a/libavcodec/cbs.c +++ b/libavcodec/cbs.c @@ -23,6 +23,7 @@ #include "libavutil/avassert.h" #include "libavutil/buffer.h" #include "libavutil/common.h" +#include "libavutil/opt.h" #include "cbs.h" #include "cbs_internal.h" @@ -101,6 +102,10 @@ int ff_cbs_init(CodedBitstreamContext **ctx_ptr, av_freep(&ctx); return AVERROR(ENOMEM); } +if (type->priv_class) { +*(const AVClass **)ctx->priv_data = type->priv_class; +av_opt_set_defaults(ctx->priv_data); +} } ctx->decompose_unit_types = NULL; @@ -129,6 +134,10 @@ void ff_cbs_close(CodedBitstreamContext **ctx_ptr) ctx->codec->close(ctx); av_freep(&ctx->write_buffer); + +if (ctx->codec->priv_class && ctx->priv_data) +av_opt_free(ctx->priv_data); + av_freep(&ctx->priv_data); av_freep(ctx_ptr); } diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h index faa847aad3..a392880036 100644 --- a/libavcodec/cbs_internal.h +++ b/libavcodec/cbs_internal.h @@ -86,6 +86,12 @@ typedef const struct CodedBitstreamUnitTypeDescriptor { typedef struct CodedBitstreamType { enum AVCodecID codec_id; +// A class for the private data, used to declare private AVOptions. +// This field is NULL for types that do not declare any options. +// If this field is non-NULL, the first member of the filter private data +// must be a pointer to AVClass. +const AVClass *priv_class; + size_t priv_data_size; // List of unit type descriptors for this codec. Ping for the set. ___ 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] Support HDR10+ metadata for HEVC.
Ian, can you please take a look into it? And if it's fine to push it. Thanks, Mohammad On Mon, Nov 23, 2020 at 1:29 PM Mohammad Izadi wrote: > From: Mohammad Izadi > > HDR10+ is dynamic metadata (A/341 Amendment - SMPTE2094-40) that needs to > be decoded from ITU-T T.35 in HEVC bitstream. The HDR10+ is transferred to > side data packet to be used or passed through. > --- > The fate test file can be found here: > https://drive.google.com/file/d/1vcT0ohzpoyVFcxQN32jKIhUrBaBwZweT/view?usp=sharing > The video file needs to be copied to fate-suite/mov/ > configure | 1 + > fftools/ffprobe.c | 106 + > libavcodec/Makefile| 3 + > libavcodec/avpacket.c | 1 + > libavcodec/decode.c| 1 + > libavcodec/dynamic_hdr10_plus.c| 196 + > libavcodec/dynamic_hdr10_plus.h| 34 + > libavcodec/hevc_sei.c | 62 ++-- > libavcodec/hevc_sei.h | 5 + > libavcodec/hevcdec.c | 18 +++ > libavcodec/packet.h| 8 + > libavcodec/version.h | 2 +- > libavfilter/vf_showinfo.c | 106 - > tests/fate/mov.mak | 3 + > tests/ref/fate/mov-hdr10-plus-metadata | 90 > 15 files changed, 621 insertions(+), 15 deletions(-) > create mode 100644 libavcodec/dynamic_hdr10_plus.c > create mode 100644 libavcodec/dynamic_hdr10_plus.h > create mode 100644 tests/ref/fate/mov-hdr10-plus-metadata > > diff --git a/configure b/configure > index 51e43fbf66..a9f12a421e 100755 > --- a/configure > +++ b/configure > @@ -2360,6 +2360,7 @@ CONFIG_EXTRA=" > dirac_parse > dnn > dvprofile > +dynamic_hdr10_plus > exif > faandct > faanidct > diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c > index 86bd23d36d..4cee4e8ec3 100644 > --- a/fftools/ffprobe.c > +++ b/fftools/ffprobe.c > @@ -35,6 +35,7 @@ > #include "libavutil/bprint.h" > #include "libavutil/display.h" > #include "libavutil/hash.h" > +#include "libavutil/hdr_dynamic_metadata.h" > #include "libavutil/mastering_display_metadata.h" > #include "libavutil/dovi_meta.h" > #include "libavutil/opt.h" > @@ -1860,6 +1861,105 @@ static inline int show_tags(WriterContext *w, > AVDictionary *tags, int section_id > return ret; > } > > +static void print_dynamic_hdr10_plus(WriterContext *w, AVDynamicHDRPlus > *metadata) > +{ > +if (!metadata) > +return; > +print_int("application version", metadata->application_version); > +print_int("num_windows", metadata->num_windows); > +for (int n = 1; n < metadata->num_windows; n++) { > +AVHDRPlusColorTransformParams *params = &metadata->params[n]; > +print_q("window_upper_left_corner_x", > +params->window_upper_left_corner_x,'/'); > +print_q("window_upper_left_corner_y", > +params->window_upper_left_corner_y,'/'); > +print_q("window_lower_right_corner_x", > +params->window_lower_right_corner_x,'/'); > +print_q("window_lower_right_corner_y", > +params->window_lower_right_corner_y,'/'); > +print_q("window_upper_left_corner_x", > +params->window_upper_left_corner_x,'/'); > +print_q("window_upper_left_corner_y", > +params->window_upper_left_corner_y,'/'); > +print_int("center_of_ellipse_x", > + params->center_of_ellipse_x ) ; > +print_int("center_of_ellipse_y", > + params->center_of_ellipse_y ); > +print_int("rotation_angle", > + params->rotation_angle); > +print_int("semimajor_axis_internal_ellipse", > + params->semimajor_axis_internal_ellipse); > +print_int("semimajor_axis_external_ellipse", > + params->semimajor_axis_external_ellipse); > +print_int("semiminor_axis_external_ellipse", > + params->semiminor_axis_external_ellipse); > +print_int("overlap_process_option", > + params->overlap_process_option); > +} > +print_q("targeted_system_display_maximum_luminance", > +metadata->targeted_system_display_maximum_luminance,'/'); > +if (metadata->targeted_system_display_actual_peak_luminance_flag) { > + > print_int("num_rows_targeted_system_display_actual_peak_luminance", > + > metadata->num_rows_targeted_system_display_actual_peak_luminance); > + > print_int("num_cols_targeted_system_display_actual_peak_luminance", > + > metadata->num_cols_targeted_system_display_actual_peak_luminance); > +for (int i = 0; i < > metadata->num_rows_targeted_system_display_actual_peak_luminance; i++) { > +for (int j = 0; j < > metadata->num_cols_targeted_system_display_actual_peak_luminance; j++) { > +print_q("targeted_system_displ
Re: [FFmpeg-devel] [PATCH 2/2] avcodec/cbs_h2645: remove dead code in cbs_h2645_replace_ps()
On 9/29/2020 11:22 AM, James Almer wrote: Missed in 0720e15c0330f0f101c02d5c2c6548e964079f6d. PS units are now guaranteed to always be reference counter. Signed-off-by: James Almer --- libavcodec/cbs_h2645.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index b6d77dd17f..434322492c 100644 --- a/libavcodec/cbs_h2645.c +++ b/libavcodec/cbs_h2645.c @@ -671,8 +671,6 @@ static int cbs_h26 ## h26n ## _replace_ ## ps_var(CodedBitstreamContext *ctx, \ if (!priv->ps_var ## _ref[id]) \ return AVERROR(ENOMEM); \ priv->ps_var[id] = (H26 ## h26n ## Raw ## ps_name *)priv->ps_var ## _ref[id]->data; \ -if (!unit->content_ref) \ -memcpy(priv->ps_var[id], ps_var, sizeof(*ps_var)); \ return 0; \ } Applied. ___ 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/9] lavd/caca: do not access deprecated codec context
Use the stream timebase instead. --- libavdevice/caca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/caca.c b/libavdevice/caca.c index be3ff79736..726cfda95f 100644 --- a/libavdevice/caca.c +++ b/libavdevice/caca.c @@ -180,7 +180,7 @@ static int caca_write_header(AVFormatContext *s) if (!c->window_title) c->window_title = av_strdup(s->url); caca_set_display_title(c->display, c->window_title); -caca_set_display_time(c->display, av_rescale_q(1, st->codec->time_base, AV_TIME_BASE_Q)); +caca_set_display_time(c->display, av_rescale_q(1, st->time_base, AV_TIME_BASE_Q)); return 0; -- 2.28.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 4/9] lavf/mux: rewrite guessing the packet duration
Factor out the code into a separate muxing-specific function. Stop accessing the deprecated AVStream-embedded codec context, use the average framerate (if specified) instead. --- libavformat/mux.c| 49 ++-- tests/ref/fate/asf-repldata | 28 +-- tests/ref/fate/ffmpeg-attached_pics | 2 +- tests/ref/fate/ffmpeg-streamloop | 2 +- tests/ref/fate/g2m2 | 320 +-- tests/ref/fate/iff-byterun1 | 2 +- tests/ref/fate/iff-ilbm | 2 +- tests/ref/fate/iv8-demux | 50 ++--- tests/ref/fate/mimic | 152 ++--- tests/ref/fate/mss2-pal | 4 +- tests/ref/fate/mss2-pals | 4 +- tests/ref/fate/mss2-rgb555 | 4 +- tests/ref/fate/mss2-rgb555s | 4 +- tests/ref/fate/nuv-rtjpeg| 16 +- tests/ref/fate/segment-mp4-to-ts | 58 ++--- tests/ref/fate/smjpeg-demux | 82 +++ tests/ref/fate/vp9-tiling-pedestrian | 4 +- tests/ref/lavf-fate/vp8.ogg | 4 +- 18 files changed, 403 insertions(+), 384 deletions(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index d2a56d216b..84c56ac6ba 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -546,7 +546,7 @@ FF_DISABLE_DEPRECATION_WARNINGS static int compute_muxer_pkt_fields(AVFormatContext *s, AVStream *st, AVPacket *pkt) { int delay = FFMAX(st->codecpar->video_delay, st->internal->avctx->max_b_frames > 0); -int num, den, i; +int i; int frame_size; if (!s->internal->missing_ts_warning && @@ -564,20 +564,6 @@ static int compute_muxer_pkt_fields(AVFormatContext *s, AVStream *st, AVPacket * av_log(s, AV_LOG_DEBUG, "compute_muxer_pkt_fields: pts:%s dts:%s cur_dts:%s b:%d size:%d st:%d\n", av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), delay, pkt->size, pkt->stream_index); -if (pkt->duration < 0 && st->codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE) { -av_log(s, AV_LOG_WARNING, "Packet with invalid duration %"PRId64" in stream %d\n", - pkt->duration, pkt->stream_index); -pkt->duration = 0; -} - -/* duration field */ -if (pkt->duration == 0) { -ff_compute_frame_duration(s, &num, &den, st, NULL, pkt); -if (den && num) { -pkt->duration = av_rescale(1, num * (int64_t)st->time_base.den * st->codec->ticks_per_frame, den * (int64_t)st->time_base.num); -} -} - if (pkt->pts == AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE && delay == 0) pkt->pts = pkt->dts; @@ -652,6 +638,37 @@ static int compute_muxer_pkt_fields(AVFormatContext *s, AVStream *st, AVPacket * FF_ENABLE_DEPRECATION_WARNINGS #endif +static void guess_pkt_duration(AVFormatContext *s, AVStream *st, AVPacket *pkt) +{ +if (pkt->duration < 0 && st->codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE) { +av_log(s, AV_LOG_WARNING, "Packet with invalid duration %"PRId64" in stream %d\n", + pkt->duration, pkt->stream_index); +pkt->duration = 0; +} + +if (pkt->duration) +return; + +switch (st->codecpar->codec_type) { +case AVMEDIA_TYPE_VIDEO: +if (st->avg_frame_rate.num > 0 && st->avg_frame_rate.den > 0) { +pkt->duration = av_rescale_q(1, av_inv_q(st->avg_frame_rate), + st->time_base); +} else if (st->time_base.num * 1000LL > st->time_base.den) +pkt->duration = 1; +break; +case AVMEDIA_TYPE_AUDIO: { +int frame_size = av_get_audio_frame_duration2(st->codecpar, pkt->size); +if (frame_size && st->codecpar->sample_rate) { +pkt->duration = av_rescale_q(frame_size, + (AVRational){1, st->codecpar->sample_rate}, + st->time_base); +} +break; +} +} +} + /** * Shift timestamps and call muxer; the original pts/dts are not kept. * @@ -1118,6 +1135,8 @@ static int write_packet_common(AVFormatContext *s, AVStream *st, AVPacket *pkt, av_log(s, AV_LOG_DEBUG, "%s size:%d dts:%s pts:%s\n", __FUNCTION__, pkt->size, av_ts2str(pkt->dts), av_ts2str(pkt->pts)); +guess_pkt_duration(s, st, pkt); + #if FF_API_COMPUTE_PKT_FIELDS2 && FF_API_LAVF_AVCTX if ((ret = compute_muxer_pkt_fields(s, st, pkt)) < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS)) return ret; diff --git a/tests/ref/fate/asf-repldata b/tests/ref/fate/asf-repldata index 94744569f2..59eaf0c2a8 100644 --- a/tests/ref/fate/asf-repldata +++ b/tests/ref/fate/asf-repldata @@ -3,17 +3,17 @@ #codec_id 0: msmpeg4v3 #dimensions 0: 640x480 #sar 0: 0/1 -0, 0, 0,0,23374, 0x8725b3b8 -0,122,122,0,13732, 0x3ac8531a, F=0x0 -0,245,245,0, 615, 0xd31641b4, F=0x0 -0,367,367,
[FFmpeg-devel] [PATCH 5/9] ffmpeg: stop accessing deprecated stream-embedded codec context
--- fftools/ffmpeg.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 80f436eab3..b446d9b206 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -3568,12 +3568,6 @@ static int init_output_stream(OutputStream *ost, AVFrame *frame, "Error initializing the output stream codec context.\n"); exit_program(1); } -/* - * FIXME: ost->st->codec should't be needed here anymore. - */ -ret = avcodec_copy_context(ost->st->codec, ost->enc_ctx); -if (ret < 0) -return ret; if (ost->enc_ctx->nb_coded_side_data) { int i; @@ -3618,8 +3612,6 @@ static int init_output_stream(OutputStream *ost, AVFrame *frame, // copy estimated duration as a hint to the muxer if (ost->st->duration <= 0 && ist && ist->st->duration > 0) ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base); - -ost->st->codec->codec= ost->enc_ctx->codec; } else if (ost->stream_copy) { ret = init_output_stream_streamcopy(ost); if (ret < 0) @@ -4011,7 +4003,7 @@ static int check_keyboard_interaction(int64_t cur_time) if (key == 'd' || key == 'D'){ int debug=0; if(key == 'D') { -debug = input_streams[0]->st->codec->debug<<1; +debug = input_streams[0]->dec_ctx->debug << 1; if(!debug) debug = 1; while(debug & (FF_DEBUG_DCT_COEFF #if FF_API_DEBUG_MV @@ -4034,7 +4026,7 @@ static int check_keyboard_interaction(int64_t cur_time) fprintf(stderr,"error parsing debug value\n"); } for(i=0;ist->codec->debug = debug; +input_streams[i]->dec_ctx->debug = debug; } for(i=0;ihttps://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/9] img2dec: export avg_frame_rate
--- libavformat/img2dec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index a08d4f7977..ccb933ae33 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -220,8 +220,10 @@ int ff_img_read_header(AVFormatContext *s1) avpriv_set_pts_info(st, 64, 1, 10); } else if (s->ts_from_file) avpriv_set_pts_info(st, 64, 1, 1); -else +else { avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num); +st->avg_frame_rate = s->framerate; +} if (s->width && s->height) { st->codecpar->width = s->width; -- 2.28.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 8/9] codec_desc: add SMVJPEG flags
Same flags as MJPEG, as it's essentially the same thing. --- libavcodec/codec_desc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 3b148883b8..fc5a5be46e 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1512,6 +1512,7 @@ static const AVCodecDescriptor codec_descriptors[] = { .id= AV_CODEC_ID_SMVJPEG, .type = AVMEDIA_TYPE_VIDEO, .name = "smvjpeg", +.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, .long_name = NULL_IF_CONFIG_SMALL("Sigmatel Motion Video"), }, { -- 2.28.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/9] tests: drop api-codec-param test
It fundamentally depends on deprecated lavf internals. --- tests/api/Makefile | 1 - tests/api/api-codec-param-test.c | 256 --- tests/fate/api.mak | 8 - 3 files changed, 265 deletions(-) delete mode 100644 tests/api/api-codec-param-test.c diff --git a/tests/api/Makefile b/tests/api/Makefile index b5c4ccae23..c96e636756 100644 --- a/tests/api/Makefile +++ b/tests/api/Makefile @@ -2,7 +2,6 @@ APITESTPROGS-$(call ENCDEC, FLAC, FLAC) += api-flac APITESTPROGS-$(call DEMDEC, H264, H264) += api-h264 APITESTPROGS-$(call DEMDEC, H264, H264) += api-h264-slice APITESTPROGS-yes += api-seek -APITESTPROGS-yes += api-codec-param APITESTPROGS-$(call DEMDEC, H263, H263) += api-band APITESTPROGS-$(HAVE_THREADS) += api-threadmessage APITESTPROGS += $(APITESTPROGS-yes) diff --git a/tests/api/api-codec-param-test.c b/tests/api/api-codec-param-test.c deleted file mode 100644 index 0868322cb4..00 --- a/tests/api/api-codec-param-test.c +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright (c) 2015 Matthieu Bouron - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include "libavformat/avformat.h" -#include "libavutil/pixdesc.h" -#include "libavcodec/internal.h" -#include "libavutil/avassert.h" -#include "libavutil/opt.h" - -static int try_decode_video_frame(AVCodecContext *codec_ctx, AVPacket *pkt, int decode) -{ -int ret = 0; -int got_frame = 0; -AVFrame *frame = NULL; -int skip_frame = codec_ctx->skip_frame; - -if (!avcodec_is_open(codec_ctx)) { -const AVCodec *codec = avcodec_find_decoder(codec_ctx->codec_id); - -ret = avcodec_open2(codec_ctx, codec, NULL); -if (ret < 0) { -av_log(codec_ctx, AV_LOG_ERROR, "Failed to open codec\n"); -goto end; -} -} - -frame = av_frame_alloc(); -if (!frame) { -av_log(NULL, AV_LOG_ERROR, "Failed to allocate frame\n"); -goto end; -} - -if (!decode && avpriv_codec_get_cap_skip_frame_fill_param(codec_ctx->codec)) { -codec_ctx->skip_frame = AVDISCARD_ALL; -} - -do { -ret = avcodec_decode_video2(codec_ctx, frame, &got_frame, pkt); -av_assert0(decode || (!decode && !got_frame)); -if (ret < 0) -break; -pkt->data += ret; -pkt->size -= ret; - -if (got_frame) { -break; -} -} while (pkt->size > 0); - -end: -codec_ctx->skip_frame = skip_frame; - -av_frame_free(&frame); -return ret; -} - -static int find_video_stream_info(AVFormatContext *fmt_ctx, int decode) -{ -int ret = 0; -int i, done = 0; -AVPacket pkt; - -av_init_packet(&pkt); - -while (!done) { -AVCodecContext *codec_ctx = NULL; -AVStream *st; - -if ((ret = av_read_frame(fmt_ctx, &pkt)) < 0) { -av_log(fmt_ctx, AV_LOG_ERROR, "Failed to read frame\n"); -goto end; -} - -st = fmt_ctx->streams[pkt.stream_index]; -codec_ctx = st->codec; - -/* Writing to AVStream.codec_info_nb_frames must not be done by - * user applications. It is done here for testing purposing as - * find_video_stream_info tries to mimic avformat_find_stream_info - * which writes to this field. - * */ -if (codec_ctx->codec_type != AVMEDIA_TYPE_VIDEO || -st->codec_info_nb_frames++ > 0) { -av_packet_unref(&pkt); -continue; -} - -ret = try_decode_video_frame(codec_ctx, &pkt, decode); -if (ret < 0) { -av_log(fmt_ctx, AV_LOG_ERROR, "Failed to decode video frame\n"); -goto end; -} - -av_packet_unref(&pkt); - -/* check if all video streams have demuxed a packet */ -done = 1; -for (i = 0; i < fmt_ctx->nb_streams; i++) { -st = fmt_ctx->streams[i]; -codec_ctx = st->codec; - -
[FFmpeg-devel] [PATCH 7/9] mjpegdec: convert to receive_frame()
This will be useful in the following commit. --- libavcodec/jpeglsdec.c| 2 +- libavcodec/mjpegdec.c | 71 +-- libavcodec/mjpegdec.h | 8 ++-- libavcodec/sp5xdec.c | 28 ++ tests/ref/fate/exif-image-jpg | 4 +- 5 files changed, 72 insertions(+), 41 deletions(-) diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index 0b1e139048..e72f9f2315 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -551,7 +551,7 @@ AVCodec ff_jpegls_decoder = { .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, -.decode = ff_mjpeg_decode_frame, +.receive_frame = ff_mjpeg_receive_frame, .capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 147dd819e5..96dfc3dc19 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -36,6 +36,7 @@ #include "avcodec.h" #include "blockdsp.h" #include "copy_block.h" +#include "decode.h" #include "hwconfig.h" #include "idctdsp.h" #include "internal.h" @@ -163,6 +164,10 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx) s->picture_ptr = s->picture; } +s->pkt = av_packet_alloc(); +if (!s->pkt) +return AVERROR(ENOMEM); + s->avctx = avctx; ff_blockdsp_init(&s->bdsp, avctx); ff_hpeldsp_init(&s->hdsp, avctx->flags); @@ -2336,12 +2341,32 @@ static void reset_icc_profile(MJpegDecodeContext *s) s->iccnum = 0; } -int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int mjpeg_get_packet(AVCodecContext *avctx) +{ +MJpegDecodeContext *s = avctx->priv_data; +int ret; + +av_packet_unref(s->pkt); +ret = ff_decode_get_packet(avctx, s->pkt); +if (ret < 0) +return ret; + +#if CONFIG_SP5X_DECODER || CONFIG_AMV_DECODER +if (avctx->codec_id == AV_CODEC_ID_SP5X || +avctx->codec_id == AV_CODEC_ID_AMV) { +ret = ff_sp5x_process_packet(avctx, s->pkt); +if (ret < 0) +return ret; +} +#endif + +s->buf_size = s->pkt->size; + +return 0; +} + +int ff_mjpeg_receive_frame(AVCodecContext *avctx, AVFrame *frame) { -AVFrame *frame = data; -const uint8_t *buf = avpkt->data; -int buf_size = avpkt->size; MJpegDecodeContext *s = avctx->priv_data; const uint8_t *buf_end, *buf_ptr; const uint8_t *unescaped_buf_ptr; @@ -2352,8 +2377,6 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, int ret = 0; int is16bit; -s->buf_size = buf_size; - av_dict_free(&s->exif_metadata); av_freep(&s->stereo3d); s->adobe_transform = -1; @@ -2361,8 +2384,12 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (s->iccnum != 0) reset_icc_profile(s); -buf_ptr = buf; -buf_end = buf + buf_size; +ret = mjpeg_get_packet(avctx); +if (ret < 0) +return ret; + +buf_ptr = s->pkt->data; +buf_end = s->pkt->data + s->pkt->size; while (buf_ptr < buf_end) { /* find start next marker */ start_code = ff_mjpeg_find_marker(s, &buf_ptr, buf_end, @@ -2374,7 +2401,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } else if (unescaped_buf_size > INT_MAX / 8) { av_log(avctx, AV_LOG_ERROR, "MJPEG packet 0x%x too big (%d/%d), corrupt data?\n", - start_code, unescaped_buf_size, buf_size); + start_code, unescaped_buf_size, s->pkt->size); return AVERROR_INVALIDDATA; } av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%"PTRDIFF_SPECIFIER"\n", @@ -2511,6 +2538,7 @@ eoi_parser: } if (avctx->skip_frame == AVDISCARD_ALL) { s->got_picture = 0; +ret = AVERROR(EAGAIN); goto the_end_no_picture; } if (s->avctx->hwaccel) { @@ -2522,9 +2550,10 @@ eoi_parser: } if ((ret = av_frame_ref(frame, s->picture_ptr)) < 0) return ret; -*got_frame = 1; s->got_picture = 0; +frame->pkt_dts = s->pkt->dts; + if (!s->lossless) { int qp = FFMAX3(s->qscale[0], s->qscale[1], @@ -2533,7 +2562,7 @@ eoi_parser: AVBufferRef *qp_table_buf = av_buffer_alloc(qpw); if (qp_table_buf) { memset(qp_table_buf->data, qp, qpw); -av_frame_set_qp_table(data, qp_table_buf, 0, FF_QSCALE_TYPE_MPEG1); +av_frame_set_qp_table(frame, qp_table_buf, 0, FF_QSCALE_TYPE_MPEG1); } if(avctx->d
[FFmpeg-devel] [PATCH 9/9] smvjpegdec: merge into mjpegdec
SMVJPEG stores frames as slices of a big JPEG image. The decoder is implemented as a wrapper that instantiates a full internal MJPEG decoder, then forwards the decoded frames with offset data pointers. This is unnecessarily complex and fragile, not supporting useful decoder capabilities like direct rendering. Re-implement the decoder inside the MJPEG decoder, which is accomplished by returning each decoded frame multiple times, setting cropping information appropriately on each instance. One peculiar aspect of the previous design is that since - the smvjpeg decoder returns one frame per input packet - there are multiple frames in each packets (the aformentioned slices) the demuxer needs to return each packet multiple times. This is now also eliminated - the demuxer now returns each packet exactly once, with the duration set to the number of frames it decodes to. This also removes one of the last remaining internal uses of the old video decoding API. --- MAINTAINERS | 1 - configure | 1 + libavcodec/Makefile | 1 - libavcodec/mjpegdec.c | 88 +++- libavcodec/mjpegdec.h | 4 + libavcodec/smvjpegdec.c | 223 libavformat/wavdec.c| 12 +-- tests/ref/fate/smvjpeg | 2 +- 8 files changed, 96 insertions(+), 236 deletions(-) delete mode 100644 libavcodec/smvjpegdec.c diff --git a/MAINTAINERS b/MAINTAINERS index 2464f82be3..00c9007671 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -235,7 +235,6 @@ Codecs: rv10.cMichael Niedermayer s3tc* Ivo van Poorten smc.c Mike Melanson - smvjpegdec.c Ash Hughes snow* Michael Niedermayer, Loren Merritt sonic.c Alex Beregszaszi speedhq.c Steinar H. Gunderson diff --git a/configure b/configure index 51e43fbf66..277c2d699a 100755 --- a/configure +++ b/configure @@ -2838,6 +2838,7 @@ rv40_decoder_select="golomb h264pred h264qpel mpegvideo rv34dsp" screenpresso_decoder_deps="zlib" shorten_decoder_select="bswapdsp" sipr_decoder_select="lsp" +smvjpeg_decoder_select="mjpeg_decoder" snow_decoder_select="dwt h264qpel hpeldsp me_cmp rangecoder videodsp" snow_encoder_select="dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder" sonic_decoder_select="golomb rangecoder" diff --git a/libavcodec/Makefile b/libavcodec/Makefile index a6435c9e85..1f6e929a42 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -616,7 +616,6 @@ OBJS-$(CONFIG_SIREN_DECODER) += siren.o OBJS-$(CONFIG_SMACKAUD_DECODER)+= smacker.o OBJS-$(CONFIG_SMACKER_DECODER) += smacker.o OBJS-$(CONFIG_SMC_DECODER) += smc.o -OBJS-$(CONFIG_SMVJPEG_DECODER) += smvjpegdec.o OBJS-$(CONFIG_SNOW_DECODER)+= snowdec.o snow.o snow_dwt.o OBJS-$(CONFIG_SNOW_ENCODER)+= snowenc.o snow.o snow_dwt.o \ h263.o h263data.o ituh263enc.o diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 96dfc3dc19..7cc5f2a32e 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -203,7 +203,19 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx) s->interlace_polarity = 1; } -if ( avctx->extradata_size > 8 +if (avctx->codec_id == AV_CODEC_ID_SMVJPEG) { +if (avctx->extradata_size >= 4) +s->smv_frames_per_jpeg = AV_RL32(avctx->extradata); + +if (s->smv_frames_per_jpeg <= 0) { +av_log(avctx, AV_LOG_ERROR, "Invalid number of frames per jpeg.\n"); +return AVERROR_INVALIDDATA; +} + +s->smv_frame = av_frame_alloc(); +if (!s->smv_frame) +return AVERROR(ENOMEM); +} else if (avctx->extradata_size > 8 && AV_RL32(avctx->extradata) == 0x2C && AV_RL32(avctx->extradata+4) == 0x18) { parse_avid(s, avctx->extradata, avctx->extradata_size); @@ -477,6 +489,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) size_change = 0; } +if (s->avctx->codec_id == AV_CODEC_ID_SMVJPEG) { +s->avctx->height = s->avctx->coded_height / s->smv_frames_per_jpeg; +if (s->avctx->height <= 0) +return AVERROR_INVALIDDATA; +} + if (s->got_picture && s->interlaced && (s->bottom_field == !s->interlace_polarity)) { if (s->progressive) { avpriv_request_sample(s->avctx, "progressively coded interlaced picture"); @@ -2341,6 +2359,42 @@ static void reset_icc_profile(MJpegDecodeContext *s) s->iccnum = 0; } +// SMV JPEG just stacks several output frames into one JPEG picture +// we handle that by setting up the cropping parameters appropriately +static int smv_process_frame(AVCodecContext *avctx, AVFrame *frame) +{ +MJpegDecodeContext *s = avctx->priv_data; +int ret; + +
[FFmpeg-devel] [PATCH] hwcontext: Return a sensible error when deriving an unsupported device type
This previously returned ENOMEM because the failure was detected during av_hwdevice_ctx_alloc(), which is not helpful. Check earlier in order to return the correct ENOSYS instead. --- Before: $ ./ffmpeg_g -init_hw_device vaapi=d0:/dev/dri/renderD128 -init_hw_device dxva2=d1@d0 ... Device creation failed: -12. Failed to set value 'dxva2=d1@d0' for option 'init_hw_device': Cannot allocate memory Error parsing global options: Cannot allocate memory After: $ ./ffmpeg_g -init_hw_device vaapi=d0:/dev/dri/renderD128 -init_hw_device dxva2=d1@d0 Device creation failed: -38. Failed to set value 'dxva2=d1@d0' for option 'init_hw_device': Function not implemented Error parsing global options: Function not implemented libavutil/hwcontext.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c index d13d0f7c9b..4a307369c4 100644 --- a/libavutil/hwcontext.c +++ b/libavutil/hwcontext.c @@ -139,19 +139,22 @@ static void hwdevice_ctx_free(void *opaque, uint8_t *data) av_freep(&ctx); } +static const HWContextType *hwcontext_find_type(enum AVHWDeviceType type) +{ +for (int i = 0; hw_table[i]; i++) { +if (hw_table[i]->type == type) +return hw_table[i]; +} +return NULL; +} + AVBufferRef *av_hwdevice_ctx_alloc(enum AVHWDeviceType type) { AVHWDeviceContext *ctx; AVBufferRef *buf; -const HWContextType *hw_type = NULL; -int i; +const HWContextType *hw_type; -for (i = 0; hw_table[i]; i++) { -if (hw_table[i]->type == type) { -hw_type = hw_table[i]; -break; -} -} +hw_type = hwcontext_find_type(type); if (!hw_type) return NULL; @@ -652,6 +655,11 @@ int av_hwdevice_ctx_create_derived_opts(AVBufferRef **dst_ref_ptr, AVHWDeviceContext *dst_ctx, *tmp_ctx; int ret = 0; +if (!hwcontext_find_type(type)) { +// The type we want to derive is not supported in this build. +return AVERROR(ENOSYS); +} + tmp_ref = src_ref; while (tmp_ref) { tmp_ctx = (AVHWDeviceContext*)tmp_ref->data; -- 2.29.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 3/9] tests: drop api-codec-param test
On 12/1/2020 5:19 PM, Anton Khirnov wrote: It fundamentally depends on deprecated lavf internals. --- tests/api/Makefile | 1 - tests/api/api-codec-param-test.c | 256 --- tests/fate/api.mak | 8 - Should also delete the two ref files in test/ref/fate. 3 files changed, 265 deletions(-) delete mode 100644 tests/api/api-codec-param-test.c Fine by me. ___ 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 7/9] mjpegdec: convert to receive_frame()
On 12/1/2020 5:19 PM, Anton Khirnov wrote: This will be useful in the following commit. --- libavcodec/jpeglsdec.c| 2 +- libavcodec/mjpegdec.c | 71 +-- libavcodec/mjpegdec.h | 8 ++-- libavcodec/sp5xdec.c | 28 ++ tests/ref/fate/exif-image-jpg | 4 +- 5 files changed, 72 insertions(+), 41 deletions(-) diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index 0b1e139048..e72f9f2315 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -551,7 +551,7 @@ AVCodec ff_jpegls_decoder = { .priv_data_size = sizeof(MJpegDecodeContext), .init = ff_mjpeg_decode_init, .close = ff_mjpeg_decode_end, -.decode = ff_mjpeg_decode_frame, +.receive_frame = ff_mjpeg_receive_frame, .capabilities = AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 147dd819e5..96dfc3dc19 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -36,6 +36,7 @@ #include "avcodec.h" #include "blockdsp.h" #include "copy_block.h" +#include "decode.h" #include "hwconfig.h" #include "idctdsp.h" #include "internal.h" @@ -163,6 +164,10 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx) s->picture_ptr = s->picture; } +s->pkt = av_packet_alloc(); +if (!s->pkt) +return AVERROR(ENOMEM); + s->avctx = avctx; ff_blockdsp_init(&s->bdsp, avctx); ff_hpeldsp_init(&s->hdsp, avctx->flags); @@ -2336,12 +2341,32 @@ static void reset_icc_profile(MJpegDecodeContext *s) s->iccnum = 0; } -int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, - AVPacket *avpkt) +static int mjpeg_get_packet(AVCodecContext *avctx) +{ +MJpegDecodeContext *s = avctx->priv_data; +int ret; + +av_packet_unref(s->pkt); +ret = ff_decode_get_packet(avctx, s->pkt); +if (ret < 0) +return ret; + +#if CONFIG_SP5X_DECODER || CONFIG_AMV_DECODER +if (avctx->codec_id == AV_CODEC_ID_SP5X || +avctx->codec_id == AV_CODEC_ID_AMV) { +ret = ff_sp5x_process_packet(avctx, s->pkt); +if (ret < 0) +return ret; +} +#endif + +s->buf_size = s->pkt->size; + +return 0; +} + +int ff_mjpeg_receive_frame(AVCodecContext *avctx, AVFrame *frame) { -AVFrame *frame = data; -const uint8_t *buf = avpkt->data; -int buf_size = avpkt->size; MJpegDecodeContext *s = avctx->priv_data; const uint8_t *buf_end, *buf_ptr; const uint8_t *unescaped_buf_ptr; @@ -2352,8 +2377,6 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, int ret = 0; int is16bit; -s->buf_size = buf_size; - av_dict_free(&s->exif_metadata); av_freep(&s->stereo3d); s->adobe_transform = -1; @@ -2361,8 +2384,12 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if (s->iccnum != 0) reset_icc_profile(s); -buf_ptr = buf; -buf_end = buf + buf_size; +ret = mjpeg_get_packet(avctx); +if (ret < 0) +return ret; + +buf_ptr = s->pkt->data; +buf_end = s->pkt->data + s->pkt->size; while (buf_ptr < buf_end) { /* find start next marker */ start_code = ff_mjpeg_find_marker(s, &buf_ptr, buf_end, @@ -2374,7 +2401,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, } else if (unescaped_buf_size > INT_MAX / 8) { av_log(avctx, AV_LOG_ERROR, "MJPEG packet 0x%x too big (%d/%d), corrupt data?\n", - start_code, unescaped_buf_size, buf_size); + start_code, unescaped_buf_size, s->pkt->size); return AVERROR_INVALIDDATA; } av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%"PTRDIFF_SPECIFIER"\n", @@ -2511,6 +2538,7 @@ eoi_parser: } if (avctx->skip_frame == AVDISCARD_ALL) { s->got_picture = 0; +ret = AVERROR(EAGAIN); goto the_end_no_picture; } if (s->avctx->hwaccel) { @@ -2522,9 +2550,10 @@ eoi_parser: } if ((ret = av_frame_ref(frame, s->picture_ptr)) < 0) return ret; -*got_frame = 1; s->got_picture = 0; +frame->pkt_dts = s->pkt->dts; You should set FF_CODEC_CAP_SETS_PKT_DTS for this (Not too important considering it's only checked for AVCodec->decode() decoders, but it could change in the future, so might as well keep the decoder ready for it). + if (!s->lossless) { int qp = FFMAX3(s->qscale[0], s->qscale[1], @@ -2533,7 +2562,7 @@ eoi_parser: AVBufferRef *qp_table_buf = av_buffer_al
[FFmpeg-devel] [PATCH] lavf/qsv_scale: add interpolation methods support
Since 1.33 API version https://github.com/Intel-Media-SDK/MediaSDK/blob/master/api/include/mfxstructures.h#L2088 Signed-off-by: Artem Galin --- libavfilter/vf_scale_qsv.c | 17 + 1 file changed, 17 insertions(+) diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c index 5064dcbb60..1a6121c295 100644 --- a/libavfilter/vf_scale_qsv.c +++ b/libavfilter/vf_scale_qsv.c @@ -70,6 +70,7 @@ enum var_name { }; #define QSV_HAVE_SCALING_CONFIG QSV_VERSION_ATLEAST(1, 19) +#define QSV_HAVE_INTERPOLATION_METHOD QSV_VERSION_ATLEAST(1, 33) typedef struct QSVScaleContext { const AVClass *class; @@ -95,6 +96,7 @@ typedef struct QSVScaleContext { mfxExtVPPScaling scale_conf; #endif int mode; +int interpmethod; mfxExtBuffer *ext_buffers[1 + QSV_HAVE_SCALING_CONFIG]; int num_ext_buf; @@ -409,6 +411,10 @@ static int init_out_session(AVFilterContext *ctx) s->scale_conf.Header.BufferId = MFX_EXTBUFF_VPP_SCALING; s->scale_conf.Header.BufferSz = sizeof(mfxExtVPPScaling); s->scale_conf.ScalingMode = s->mode; +#if QSV_HAVE_INTERPOLATION_METHOD +s->scale_conf.InterpolationMethod = s->interpmethod; +av_log(ctx, AV_LOG_VERBOSE, "Interpolation method: %d\n", s->interpmethod); +#endif s->ext_buffers[s->num_ext_buf++] = (mfxExtBuffer*)&s->scale_conf; av_log(ctx, AV_LOG_VERBOSE, "Scaling mode: %d\n", s->mode); #endif @@ -624,6 +630,17 @@ static const AVOption options[] = { { "low_power", "", 0, AV_OPT_TYPE_CONST, { .i64 = 1}, 0, 0, FLAGS, "mode"}, { "hq","", 0, AV_OPT_TYPE_CONST, { .i64 = 2}, 0, 0, FLAGS, "mode"}, #endif +#if QSV_HAVE_INTERPOLATION_METHOD +{ "interpmethod", "set interpolation method", OFFSET(interpmethod), AV_OPT_TYPE_INT, { .i64 = MFX_INTERPOLATION_DEFAULT}, MFX_INTERPOLATION_DEFAULT, MFX_INTERPOLATION_ADVANCED, FLAGS, "interpmethod"}, +{ "nearest", "nearest neighbor method", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_INTERPOLATION_NEAREST_NEIGHBOR}, INT_MIN, INT_MAX, FLAGS, "interpmethod"}, +{ "bilinear", "bilinear method", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_INTERPOLATION_BILINEAR}, INT_MIN, INT_MAX, FLAGS, "interpmethod"}, +{ "advanced", "advanced method", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_INTERPOLATION_ADVANCED}, INT_MIN, INT_MAX, FLAGS, "interpmethod"}, +#else +{ "interpmethod", "(not supported)", OFFSET(interpmethod), AV_OPT_TYPE_INT, { .i64 = 0}, 0, INT_MAX, FLAGS, "interpmethod"}, +{ "nearest", "", 0, AV_OPT_TYPE_CONST, { .i64 = 1}, 0, 0, FLAGS, "interpmethod"}, +{ "bilinear", "", 0, AV_OPT_TYPE_CONST, { .i64 = 2}, 0, 0, FLAGS, "interpmethod"}, +{ "advanced", "", 0, AV_OPT_TYPE_CONST, { .i64 = 3}, 0, 0, FLAGS, "interpmethod"}, +#endif { NULL }, }; -- 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] lavf/qsv_scale: fix green stripe at the bottom
Explicitly set region of interest for input surfaces. Signed-off-by: Artem Galin --- libavfilter/vf_scale_qsv.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c index 5064dcbb60..321adbbb18 100644 --- a/libavfilter/vf_scale_qsv.c +++ b/libavfilter/vf_scale_qsv.c @@ -274,7 +274,7 @@ static const mfxHandleType handle_types[] = { MFX_HANDLE_D3D11_DEVICE, }; -static int init_out_session(AVFilterContext *ctx) +static int init_out_session(AVFilterContext *ctx, int in_width, int in_height) { QSVScaleContext *s = ctx->priv; @@ -385,8 +385,11 @@ static int init_out_session(AVFilterContext *ctx) sizeof(*s->mem_ids_in)); if (!s->mem_ids_in) return AVERROR(ENOMEM); -for (i = 0; i < in_frames_hwctx->nb_surfaces; i++) +for (i = 0; i < in_frames_hwctx->nb_surfaces; i++) { s->mem_ids_in[i] = in_frames_hwctx->surfaces[i].Data.MemId; +in_frames_hwctx->surfaces[i].Info.CropW = in_width; +in_frames_hwctx->surfaces[i].Info.CropH = in_height; +} s->nb_mem_ids_in = in_frames_hwctx->nb_surfaces; s->mem_ids_out = av_mallocz_array(out_frames_hwctx->nb_surfaces, @@ -450,7 +453,7 @@ static int init_scale_session(AVFilterContext *ctx, int in_width, int in_height, if (ret < 0) return ret; -ret = init_out_session(ctx); +ret = init_out_session(ctx, in_width, in_height); if (ret < 0) return ret; -- 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] libavcodec/qsvenc.c: add max_frame_size support for hevc_qsv
On Mon, 2020-11-30 at 13:49 +0800, wenbin.c...@intel.com wrote: > From: Wenbinc-Bin > > The max_frame_size parameter is set only when codec is h264. Now I add > hevc in that conditional statement. > > Signed-off-by: Wenbin CHEN Please remove the spaces at the beginning of each line in the commit log. > --- > libavcodec/qsvenc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c > index 2bd2a56227..aba98dd689 100644 > --- a/libavcodec/qsvenc.c > +++ b/libavcodec/qsvenc.c > @@ -691,7 +691,7 @@ FF_ENABLE_DEPRECATION_WARNINGS > q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q- > >extco; > > #if QSV_HAVE_CO2 > -if (avctx->codec_id == AV_CODEC_ID_H264) { > +if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == > AV_CODEC_ID_HEVC) { > if (q->int_ref_type >= 0) > q->extco2.IntRefType = q->int_ref_type; > if (q->int_ref_cycle_size >= 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] lavf/qsv_scale: fix green stripe at the bottom
On Tue, 2020-12-01 at 22:40 +, Artem Galin wrote: > Explicitly set region of interest for input surfaces. > > Signed-off-by: Artem Galin > --- > libavfilter/vf_scale_qsv.c | 9 ++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c > index 5064dcbb60..321adbbb18 100644 > --- a/libavfilter/vf_scale_qsv.c > +++ b/libavfilter/vf_scale_qsv.c > @@ -274,7 +274,7 @@ static const mfxHandleType handle_types[] = { > MFX_HANDLE_D3D11_DEVICE, > }; > > -static int init_out_session(AVFilterContext *ctx) > +static int init_out_session(AVFilterContext *ctx, int in_width, int > in_height) > { > > QSVScaleContext *s = ctx->priv; > @@ -385,8 +385,11 @@ static int init_out_session(AVFilterContext *ctx) > sizeof(*s->mem_ids_in)); > if (!s->mem_ids_in) > return AVERROR(ENOMEM); > -for (i = 0; i < in_frames_hwctx->nb_surfaces; i++) > +for (i = 0; i < in_frames_hwctx->nb_surfaces; i++) { > s->mem_ids_in[i] = in_frames_hwctx->surfaces[i].Data.MemId; > +in_frames_hwctx->surfaces[i].Info.CropW = in_width; > +in_frames_hwctx->surfaces[i].Info.CropH = in_height; > +} > s->nb_mem_ids_in = in_frames_hwctx->nb_surfaces; > > s->mem_ids_out = av_mallocz_array(out_frames_hwctx->nb_surfaces, > @@ -450,7 +453,7 @@ static int init_scale_session(AVFilterContext *ctx, int > in_width, int in_height, > if (ret < 0) > return ret; > > -ret = init_out_session(ctx); > +ret = init_out_session(ctx, in_width, in_height); > if (ret < 0) > return ret; LGTM, 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] lavf/qsv_scale: add interpolation methods support
On Tue, 2020-12-01 at 22:42 +, Artem Galin wrote: > Since 1.33 API version > https://github.com/Intel-Media-SDK/MediaSDK/blob/master/api/include/mfxstructures.h#L2088 > > Signed-off-by: Artem Galin > --- > libavfilter/vf_scale_qsv.c | 17 + > 1 file changed, 17 insertions(+) > > diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c > index 5064dcbb60..1a6121c295 100644 > --- a/libavfilter/vf_scale_qsv.c > +++ b/libavfilter/vf_scale_qsv.c > @@ -70,6 +70,7 @@ enum var_name { > }; > > #define QSV_HAVE_SCALING_CONFIG QSV_VERSION_ATLEAST(1, 19) > +#define QSV_HAVE_INTERPOLATION_METHOD QSV_VERSION_ATLEAST(1, 33) > > typedef struct QSVScaleContext { > const AVClass *class; > @@ -95,6 +96,7 @@ typedef struct QSVScaleContext { > mfxExtVPPScaling scale_conf; > #endif > int mode; > +int interpmethod; > > mfxExtBuffer *ext_buffers[1 + QSV_HAVE_SCALING_CONFIG]; > int num_ext_buf; > @@ -409,6 +411,10 @@ static int init_out_session(AVFilterContext *ctx) > s->scale_conf.Header.BufferId = MFX_EXTBUFF_VPP_SCALING; > s->scale_conf.Header.BufferSz = sizeof(mfxExtVPPScaling); > s->scale_conf.ScalingMode = s->mode; > +#if QSV_HAVE_INTERPOLATION_METHOD > +s->scale_conf.InterpolationMethod = s->interpmethod; > +av_log(ctx, AV_LOG_VERBOSE, "Interpolation method: %d\n", s- > >interpmethod); > +#endif > s->ext_buffers[s->num_ext_buf++] = (mfxExtBuffer*)&s->scale_conf; > av_log(ctx, AV_LOG_VERBOSE, "Scaling mode: %d\n", s->mode); > #endif > @@ -624,6 +630,17 @@ static const AVOption options[] = { > { "low_power", > "", 0, AV_OPT_TYPE_CONST, { .i64 = 1}, > 0, 0, FLAGS, "mode"}, > { > "hq","", 0, AV_OPT_TYPE_CONST, { > .i64 = 2}, 0, 0, FLAGS, "mode"}, > #endif > +#if QSV_HAVE_INTERPOLATION_METHOD > +{ "interpmethod", "set interpolation method", OFFSET(interpmethod), > AV_OPT_TYPE_INT, { .i64 = MFX_INTERPOLATION_DEFAULT}, > MFX_INTERPOLATION_DEFAULT, MFX_INTERPOLATION_ADVANCED, FLAGS, "interpmethod"}, > +{ "nearest", "nearest neighbor > method", 0,AV_OPT_TYPE_CONST, { .i64 = > MFX_INTERPOLATION_NEAREST_NEIGHBOR}, INT_MIN, INT_MAX, FLAGS, "interpmethod"}, > +{ "bilinear", "bilinear > method", 0,AV_OPT_TYPE_CONST, { .i64 = > MFX_INTERPOLATION_BILINEAR}, INT_MIN, INT_MAX, FLAGS, "interpmethod"}, > +{ "advanced", "advanced > method", 0,AV_OPT_TYPE_CONST, { .i64 = > MFX_INTERPOLATION_ADVANCED}, INT_MIN, INT_MAX, FLAGS, "interpmethod"}, > +#else > +{ "interpmethod", "(not supported)", OFFSET(interpmethod), > AV_OPT_TYPE_INT, { .i64 = 0}, 0, INT_MAX, FLAGS, "interpmethod"}, > +{ > "nearest", "", 0,AV_OPT_TYPE > _CONST, { .i64 = 1}, 0, 0, FLAGS, "interpmethod"}, > +{ > "bilinear", "", 0,AV_OPT_TYPE > _CONST, { .i64 = 2}, 0, 0, FLAGS, "interpmethod"}, > +{ > "advanced", "", 0,AV_OPT_TYPE > _CONST, { .i64 = 3}, 0, 0, FLAGS, "interpmethod"}, > +#endif > Why is this option added for !QSV_HAVE_INTERPOLATION_METHOD? > { NULL }, > }; ___ 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] libavcodec/qsvenc: add max_frame_size support for hevc_qsv
From: Wenbinc-Bin The max_frame_size parameter is set only when codec is h264. Now I add hevc in that conditional statement. Signed-off-by: Wenbin CHEN --- libavcodec/qsvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 2bd2a56227..aba98dd689 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -691,7 +691,7 @@ FF_ENABLE_DEPRECATION_WARNINGS q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extco; #if QSV_HAVE_CO2 -if (avctx->codec_id == AV_CODEC_ID_H264) { +if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_HEVC) { if (q->int_ref_type >= 0) q->extco2.IntRefType = q->int_ref_type; if (q->int_ref_cycle_size >= 0) -- 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 1/5] avcodec/qsvdec_other: refact, use DEFINE_QSV_DECODER to remove duplicate code
Hi Mark & Zong, Any suggestion on this? thanks On Thu, Nov 26, 2020 at 6:21 PM Xu Guangxin wrote: > --- > libavcodec/qsvdec_other.c | 188 -- > 1 file changed, 36 insertions(+), 152 deletions(-) > > diff --git a/libavcodec/qsvdec_other.c b/libavcodec/qsvdec_other.c > index 2775e07955..266ac9f2e5 100644 > --- a/libavcodec/qsvdec_other.c > +++ b/libavcodec/qsvdec_other.c > @@ -189,170 +189,54 @@ static const AVOption options[] = { > { NULL }, > }; > > -#if CONFIG_MPEG2_QSV_DECODER > -static const AVClass mpeg2_qsv_class = { > -.class_name = "mpeg2_qsv", > -.item_name = av_default_item_name, > -.option = options, > -.version= LIBAVUTIL_VERSION_INT, > -}; > +#define DEFINE_QSV_DECODER(x, X, bsf_name) \ > +static const AVClass x##_qsv_class = { \ > +.class_name = #x "_qsv", \ > +.item_name = av_default_item_name, \ > +.option = options, \ > +.version= LIBAVUTIL_VERSION_INT, \ > +}; \ > +AVCodec ff_##x##_qsv_decoder = { \ > +.name = #x "_qsv", \ > +.long_name = NULL_IF_CONFIG_SMALL(#X " video (Intel Quick Sync > Video acceleration)"), \ > +.priv_data_size = sizeof(QSVOtherContext), \ > +.type = AVMEDIA_TYPE_VIDEO, \ > +.id = AV_CODEC_ID_##X, \ > +.init = qsv_decode_init, \ > +.decode = qsv_decode_frame, \ > +.flush = qsv_decode_flush, \ > +.close = qsv_decode_close, \ > +.bsfs = bsf_name, \ > +.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1 | > AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_HYBRID, \ > +.priv_class = &x##_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", \ > +}; \ > > -AVCodec ff_mpeg2_qsv_decoder = { > -.name = "mpeg2_qsv", > -.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video (Intel Quick > Sync Video acceleration)"), > -.priv_data_size = sizeof(QSVOtherContext), > -.type = AVMEDIA_TYPE_VIDEO, > -.id = AV_CODEC_ID_MPEG2VIDEO, > -.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 = &mpeg2_qsv_class, > -.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, > -AV_PIX_FMT_QSV, > -AV_PIX_FMT_NONE }, > -.hw_configs = ff_qsv_hw_configs, > -.wrapper_name = "qsv", > -}; > +#if CONFIG_MPEG2_QSV_DECODER > +DEFINE_QSV_DECODER(mpeg2, MPEG2VIDEO, NULL) > #endif > > #if CONFIG_VC1_QSV_DECODER > -static const AVClass vc1_qsv_class = { > -.class_name = "vc1_qsv", > -.item_name = av_default_item_name, > -.option = options, > -.version= LIBAVUTIL_VERSION_INT, > -}; > - > -AVCodec ff_vc1_qsv_decoder = { > -.name = "vc1_qsv", > -.long_name = NULL_IF_CONFIG_SMALL("VC-1 video (Intel Quick Sync > Video acceleration)"), > -.priv_data_size = sizeof(QSVOtherContext), > -.type = AVMEDIA_TYPE_VIDEO, > -.id = AV_CODEC_ID_VC1, > -.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 = &vc1_qsv_class, > -.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, > -AV_PIX_FMT_QSV, > -AV_PIX_FMT_NONE }, > -.hw_configs = ff_qsv_hw_configs, > -.wrapper_name = "qsv", > -}; > -#endif > - > -#if CONFIG_VP8_QSV_DECODER > -static const AVClass vp8_qsv_class = { > -.class_name = "vp8_qsv", > -.item_name = av_default_item_name, > -.option = options, > -.version= LIBAVUTIL_VERSION_INT, > -}; > - > -AVCodec ff_vp8_qsv_decoder = { > -.name = "vp8_qsv", > -.long_name = NULL_IF_CONFIG_SMALL("VP8 video (Intel Quick Sync > Video acceleration)"), > -.priv_data_size = sizeof(QSVOtherContext), > -.type = AVMEDIA_TYPE_VIDEO, > -.id = AV_CODEC_ID_VP8, > -.init = qsv_decode_init, > -.decode = qsv_decode_frame, > -.flush = qsv_decode_flush, > -.close = qsv_decode_
[FFmpeg-devel] [PATCH 137/217] avcodec/cpia: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/cpia.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c index bf09e1a5db..5f12a99a83 100644 --- a/libavcodec/cpia.c +++ b/libavcodec/cpia.c @@ -230,4 +230,5 @@ AVCodec ff_cpia_decoder = { .close = cpia_decode_end, .decode = cpia_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 138/217] avcodec/cook: Don't use 0 for NULL
Signed-off-by: Andreas Rheinhardt --- libavcodec/cook.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 9582495442..93c51f5829 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -227,7 +227,7 @@ static av_cold int init_cook_mlt(COOKContext *q) int j, ret; int mlt_size = q->samples_per_channel; -if ((q->mlt_window = av_malloc_array(mlt_size, sizeof(*q->mlt_window))) == 0) +if (!(q->mlt_window = av_malloc_array(mlt_size, sizeof(*q->mlt_window return AVERROR(ENOMEM); /* Initialize the MLT window: simple sine window. */ -- 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 139/217] avcodec/cook: Remove redundant free
This decoder has the FF_CODEC_CAP_INIT_CLEANUP flag set. Signed-off-by: Andreas Rheinhardt --- libavcodec/cook.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 93c51f5829..f552a57415 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -236,10 +236,9 @@ static av_cold int init_cook_mlt(COOKContext *q) q->mlt_window[j] *= sqrt(2.0 / q->samples_per_channel); /* Initialize the MDCT. */ -if ((ret = ff_mdct_init(&q->mdct_ctx, av_log2(mlt_size) + 1, 1, 1.0 / 32768.0))) { -av_freep(&q->mlt_window); +ret = ff_mdct_init(&q->mdct_ctx, av_log2(mlt_size) + 1, 1, 1.0 / 32768.0); +if (ret < 0) return ret; -} av_log(q->avctx, AV_LOG_DEBUG, "MDCT initialized, order = %d.\n", av_log2(mlt_size) + 1); -- 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 140/217] avcodec/cook: Make decoder init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/cook.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/cook.c b/libavcodec/cook.c index f552a57415..60b6bd6c19 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -44,6 +44,7 @@ #include "libavutil/channel_layout.h" #include "libavutil/lfg.h" +#include "libavutil/thread.h" #include "audiodsp.h" #include "avcodec.h" @@ -1051,6 +1052,7 @@ static void dump_cook_context(COOKContext *q) */ static av_cold int cook_decode_init(AVCodecContext *avctx) { +static AVOnce init_static_once = AV_ONCE_INIT; COOKContext *q = avctx->priv_data; GetByteContext gb; int s = 0; @@ -1229,7 +1231,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) } /* Generate tables */ -init_pow2table(); +ff_thread_once(&init_static_once, init_pow2table); init_gain_table(q); init_cplscales_table(q); @@ -1281,7 +1283,7 @@ AVCodec ff_cook_decoder = { .close = cook_decode_close, .decode = cook_decode_frame, .capabilities = AV_CODEC_CAP_DR1, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 141/217] avcodec/cngenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/cngenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/cngenc.c b/libavcodec/cngenc.c index b622d7bbda..ddc44eb515 100644 --- a/libavcodec/cngenc.c +++ b/libavcodec/cngenc.c @@ -111,5 +111,5 @@ AVCodec ff_comfortnoise_encoder = { .close = cng_encode_close, .sample_fmts= (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 146/217] avcodec/v408enc: Mark encoders as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/v408enc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/v408enc.c b/libavcodec/v408enc.c index d2d84d9c40..7ef26c7d3d 100644 --- a/libavcodec/v408enc.c +++ b/libavcodec/v408enc.c @@ -82,6 +82,7 @@ AVCodec ff_ayuv_encoder = { .init = v408_encode_init, .encode2 = v408_encode_frame, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_V408_ENCODER @@ -93,5 +94,6 @@ AVCodec ff_v408_encoder = { .init = v408_encode_init, .encode2 = v408_encode_frame, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #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".
[FFmpeg-devel] [PATCH 147/217] avcodec/avuienc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/avuienc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/avuienc.c b/libavcodec/avuienc.c index 2091309e7e..45580183c2 100644 --- a/libavcodec/avuienc.c +++ b/libavcodec/avuienc.c @@ -100,4 +100,5 @@ AVCodec ff_avui_encoder = { .encode2 = avui_encode_frame, .capabilities = AV_CODEC_CAP_EXPERIMENTAL, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 142/217] avcodec/cinepakenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/cinepakenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/cinepakenc.c b/libavcodec/cinepakenc.c index cc125ed39e..9eaa972a9c 100644 --- a/libavcodec/cinepakenc.c +++ b/libavcodec/cinepakenc.c @@ -1189,5 +1189,5 @@ AVCodec ff_cinepak_encoder = { .close = cinepak_encode_end, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, .priv_class = &cinepak_class, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 148/217] avcodec/rawenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/rawenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c index d181b74570..425aae75c4 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -92,4 +92,5 @@ AVCodec ff_rawvideo_encoder = { .id = AV_CODEC_ID_RAWVIDEO, .init = raw_encode_init, .encode2= raw_encode, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 143/217] avcodec/cinepak: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/cinepak.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index 9c5b254231..17148a3577 100644 --- a/libavcodec/cinepak.c +++ b/libavcodec/cinepak.c @@ -522,4 +522,5 @@ AVCodec ff_cinepak_decoder = { .close = cinepak_decode_end, .decode = cinepak_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 149/217] avcodec/utvideoenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/utvideoenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c index 5c87eb50ac..eea685f600 100644 --- a/libavcodec/utvideoenc.c +++ b/libavcodec/utvideoenc.c @@ -701,4 +701,5 @@ AVCodec ff_utvideo_encoder = { AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 144/217] avcodec/cdgraphics: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/cdgraphics.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index 965f43684a..24e1771b9e 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -394,4 +394,5 @@ AVCodec ff_cdgraphics_decoder = { .decode = cdg_decode_frame, .flush = cdg_decode_flush, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 150/217] avcodec/utvideoenc: Cleanup generically on init failure
Signed-off-by: Andreas Rheinhardt --- libavcodec/utvideoenc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c index eea685f600..5dbfed59a3 100644 --- a/libavcodec/utvideoenc.c +++ b/libavcodec/utvideoenc.c @@ -195,7 +195,6 @@ FF_ENABLE_DEPRECATION_WARNINGS if (!avctx->extradata) { av_log(avctx, AV_LOG_ERROR, "Could not allocate extradata.\n"); -utvideo_encode_close(avctx); return AVERROR(ENOMEM); } @@ -204,7 +203,6 @@ FF_ENABLE_DEPRECATION_WARNINGS AV_INPUT_BUFFER_PADDING_SIZE); if (!c->slice_buffer[i]) { av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer 1.\n"); -utvideo_encode_close(avctx); return AVERROR(ENOMEM); } } @@ -701,5 +699,5 @@ AVCodec ff_utvideo_encoder = { AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, -.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 145/217] avcodec/bmpenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/bmpenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/bmpenc.c b/libavcodec/bmpenc.c index e829d68475..13154c706c 100644 --- a/libavcodec/bmpenc.c +++ b/libavcodec/bmpenc.c @@ -177,4 +177,5 @@ AVCodec ff_bmp_encoder = { AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 151/217] avcodec/v210enc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/v210enc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c index 16e8810271..678affbe2a 100644 --- a/libavcodec/v210enc.c +++ b/libavcodec/v210enc.c @@ -166,4 +166,5 @@ AVCodec ff_v210_encoder = { .init = encode_init, .encode2= encode_frame, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 152/217] avcodec/tiffenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/tiffenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 6661e59d31..8e56f1b6ee 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -594,4 +594,5 @@ AVCodec ff_tiff_encoder = { AV_PIX_FMT_NONE }, .priv_class = &tiffenc_class, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 153/217] avcodec/targaenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/targaenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c index 79030a012b..012409b48d 100644 --- a/libavcodec/targaenc.c +++ b/libavcodec/targaenc.c @@ -229,4 +229,5 @@ AVCodec ff_targa_encoder = { AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_RGB555LE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 154/217] avcodec/v410enc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/v410enc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c index 5e2450279f..a4f91d77e3 100644 --- a/libavcodec/v410enc.c +++ b/libavcodec/v410enc.c @@ -88,4 +88,5 @@ AVCodec ff_v410_encoder = { .init = v410_encode_init, .encode2 = v410_encode_frame, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 155/217] avcodec/v308enc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/v308enc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/v308enc.c b/libavcodec/v308enc.c index 0891251dea..67b8dccbca 100644 --- a/libavcodec/v308enc.c +++ b/libavcodec/v308enc.c @@ -76,4 +76,5 @@ AVCodec ff_v308_encoder = { .init = v308_encode_init, .encode2 = v308_encode_frame, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 156/217] avcodec/s302menc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/s302menc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/s302menc.c b/libavcodec/s302menc.c index b04a54e482..1e1d639420 100644 --- a/libavcodec/s302menc.c +++ b/libavcodec/s302menc.c @@ -185,4 +185,5 @@ AVCodec ff_s302m_encoder = { AV_CH_LAYOUT_5POINT1_BACK, AV_CH_LAYOUT_5POINT1_BACK | AV_CH_LAYOUT_STEREO_DOWNMIX, 0 }, */ +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 157/217] avcodec/alacenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/alacenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c index 9d135d1350..5decf8588c 100644 --- a/libavcodec/alacenc.c +++ b/libavcodec/alacenc.c @@ -672,4 +672,5 @@ AVCodec ff_alac_encoder = { .sample_fmts= (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 158/217] avcodec/adxenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/adxenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c index 93b902b0e1..ce7a76d51b 100644 --- a/libavcodec/adxenc.c +++ b/libavcodec/adxenc.c @@ -198,4 +198,5 @@ AVCodec ff_adpcm_adx_encoder = { .capabilities = AV_CODEC_CAP_DELAY, .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 159/217] avcodec/arbc: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/arbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/arbc.c b/libavcodec/arbc.c index 06970f140b..20de41ab11 100644 --- a/libavcodec/arbc.c +++ b/libavcodec/arbc.c @@ -223,5 +223,5 @@ AVCodec ff_arbc_decoder = { .flush = decode_flush, .close = decode_close, .capabilities = AV_CODEC_CAP_DR1, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 160/217] avcodec/argo: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/argo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/argo.c b/libavcodec/argo.c index 6b4d449935..57becbd416 100644 --- a/libavcodec/argo.c +++ b/libavcodec/argo.c @@ -736,5 +736,5 @@ AVCodec ff_argo_decoder = { .flush = decode_flush, .close = decode_close, .capabilities = AV_CODEC_CAP_DR1, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 161/217] avcodec/bitpacked: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/bitpacked.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/bitpacked.c b/libavcodec/bitpacked.c index 952ba73a32..be3cdef2ea 100644 --- a/libavcodec/bitpacked.c +++ b/libavcodec/bitpacked.c @@ -150,4 +150,5 @@ AVCodec ff_bitpacked_decoder = { MKTAG('U', 'Y', 'V', 'Y'), FF_CODEC_TAGS_END, }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 162/217] avcodec/8svx: Mark decoders as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/8svx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c index 092dbaae04..97a05037a1 100644 --- a/libavcodec/8svx.c +++ b/libavcodec/8svx.c @@ -196,6 +196,7 @@ AVCodec ff_eightsvx_fib_decoder = { .capabilities = AV_CODEC_CAP_DR1, .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_EIGHTSVX_EXP_DECODER @@ -211,5 +212,6 @@ AVCodec ff_eightsvx_exp_decoder = { .capabilities = AV_CODEC_CAP_DR1, .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_NONE }, + .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #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".
[FFmpeg-devel] [PATCH 163/217] avcodec/4xm: Make decoder init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/4xm.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 336c651d31..00a8e0b1f3 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -30,6 +30,7 @@ #include "libavutil/frame.h" #include "libavutil/imgutils.h" #include "libavutil/intreadwrite.h" +#include "libavutil/thread.h" #include "avcodec.h" #include "blockdsp.h" #include "bswapdsp.h" @@ -245,7 +246,7 @@ static void idct(int16_t block[64]) } } -static av_cold void init_vlcs(FourXContext *f) +static av_cold void init_vlcs(void) { static VLC_TYPE table[2][4][32][2]; int i, j; @@ -987,6 +988,7 @@ static av_cold int decode_end(AVCodecContext *avctx) static av_cold int decode_init(AVCodecContext *avctx) { +static AVOnce init_static_once = AV_ONCE_INIT; FourXContext * const f = avctx->priv_data; int ret; @@ -1014,13 +1016,14 @@ static av_cold int decode_init(AVCodecContext *avctx) ff_blockdsp_init(&f->bdsp, avctx); ff_bswapdsp_init(&f->bbdsp); f->avctx = avctx; -init_vlcs(f); if (f->version > 2) avctx->pix_fmt = AV_PIX_FMT_RGB565; else avctx->pix_fmt = AV_PIX_FMT_BGR555; +ff_thread_once(&init_static_once, init_vlcs); + return 0; } @@ -1034,4 +1037,5 @@ AVCodec ff_fourxm_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 164/217] avcodec/idcinvideo: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/idcinvideo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c index 6b2d8087ae..941a89d36d 100644 --- a/libavcodec/idcinvideo.c +++ b/libavcodec/idcinvideo.c @@ -258,4 +258,5 @@ AVCodec ff_idcin_decoder = { .decode = idcin_decode_frame, .capabilities = AV_CODEC_CAP_DR1, .defaults = idcin_defaults, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 165/217] avcodec/kvg1dec: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/kgv1dec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c index a6bd9400ac..1514f5d680 100644 --- a/libavcodec/kgv1dec.c +++ b/libavcodec/kgv1dec.c @@ -187,4 +187,5 @@ AVCodec ff_kgv1_decoder = { .decode = decode_frame, .flush = decode_flush, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 166/217] avcodec/targa_y216dec: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/targa_y216dec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/targa_y216dec.c b/libavcodec/targa_y216dec.c index 443d48a92f..426b365e26 100644 --- a/libavcodec/targa_y216dec.c +++ b/libavcodec/targa_y216dec.c @@ -81,4 +81,5 @@ AVCodec ff_targa_y216_decoder = { .init = y216_decode_init, .decode = y216_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 167/217] avcodec/truemotion1: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/truemotion1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index 94782fef4b..03ba916403 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -920,5 +920,5 @@ AVCodec ff_truemotion1_decoder = { .close = truemotion1_decode_end, .decode = truemotion1_decode_frame, .capabilities = AV_CODEC_CAP_DR1, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 168/217] avcodec/bintext: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/bintext.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/bintext.c b/libavcodec/bintext.c index 1aeed21f51..e30715368e 100644 --- a/libavcodec/bintext.c +++ b/libavcodec/bintext.c @@ -224,6 +224,7 @@ AVCodec ff_bintext_decoder = { .init = decode_init, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_XBIN_DECODER @@ -236,6 +237,7 @@ AVCodec ff_xbin_decoder = { .init = decode_init, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif #if CONFIG_IDF_DECODER @@ -248,5 +250,6 @@ AVCodec ff_idf_decoder = { .init = decode_init, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #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".
[FFmpeg-devel] [PATCH 169/217] avcodec/ra288: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/ra288.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index 8df17891b1..a5a3478513 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -245,4 +245,5 @@ AVCodec ff_ra_288_decoder = { .init = ra288_decode_init, .decode = ra288_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 170/217] avcodec/truespeech: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/truespeech.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c index 3cdae8c556..06f83d1657 100644 --- a/libavcodec/truespeech.c +++ b/libavcodec/truespeech.c @@ -362,4 +362,5 @@ AVCodec ff_truespeech_decoder = { .init = truespeech_decode_init, .decode = truespeech_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 171/217] avcodec/adxdec: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/adxdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c index 35b20c5cf4..70cb077545 100644 --- a/libavcodec/adxdec.c +++ b/libavcodec/adxdec.c @@ -203,4 +203,5 @@ AVCodec ff_adpcm_adx_decoder = { AV_CODEC_CAP_DR1, .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 172/217] avcodec/vima: Make decoder init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/vima.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/libavcodec/vima.c b/libavcodec/vima.c index b4620acf6b..b0a2448ede 100644 --- a/libavcodec/vima.c +++ b/libavcodec/vima.c @@ -26,13 +26,13 @@ */ #include "libavutil/channel_layout.h" +#include "libavutil/thread.h" #include "adpcm_data.h" #include "avcodec.h" #include "get_bits.h" #include "internal.h" -static int predict_table_init = 0; static uint16_t predict_table[5786 * 2]; static const uint8_t size_table[] = { @@ -84,16 +84,9 @@ static const int8_t *const step_index_tables[] = { index_table4, index_table5, index_table6 }; -static av_cold int decode_init(AVCodecContext *avctx) +static av_cold void predict_table_init(void) { -int start_pos; - -avctx->sample_fmt = AV_SAMPLE_FMT_S16; - -if (predict_table_init) -return 0; - -for (start_pos = 0; start_pos < 64; start_pos++) { +for (int start_pos = 0; start_pos < 64; start_pos++) { unsigned int dest_pos, table_pos; for (table_pos = 0, dest_pos = start_pos; @@ -110,7 +103,15 @@ static av_cold int decode_init(AVCodecContext *avctx) predict_table[dest_pos] = put; } } -predict_table_init = 1; +} + +static av_cold int decode_init(AVCodecContext *avctx) +{ +static AVOnce init_static_once = AV_ONCE_INIT; + +avctx->sample_fmt = AV_SAMPLE_FMT_S16; + +ff_thread_once(&init_static_once, predict_table_init); return 0; } @@ -215,4 +216,5 @@ AVCodec ff_adpcm_vima_decoder = { .init = decode_init, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 173/217] avcodec/vmdaudio: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/vmdaudio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/vmdaudio.c b/libavcodec/vmdaudio.c index dfbd49fd84..4f9a827c36 100644 --- a/libavcodec/vmdaudio.c +++ b/libavcodec/vmdaudio.c @@ -237,4 +237,5 @@ AVCodec ff_vmdaudio_decoder = { .init = vmdaudio_decode_init, .decode = vmdaudio_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 174/217] avcodec/tta: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/tta.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/tta.c b/libavcodec/tta.c index e68e4fbb36..5c736779cf 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -425,4 +425,5 @@ AVCodec ff_tta_decoder = { .decode = tta_decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, .priv_class = &tta_decoder_class, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 176/217] avcodec/bmvaudio: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/bmvaudio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/bmvaudio.c b/libavcodec/bmvaudio.c index b1587ab366..0292b0be1e 100644 --- a/libavcodec/bmvaudio.c +++ b/libavcodec/bmvaudio.c @@ -86,4 +86,5 @@ AVCodec ff_bmv_audio_decoder = { .init = bmv_aud_decode_init, .decode = bmv_aud_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 175/217] avcodec/ttaenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/ttaenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/ttaenc.c b/libavcodec/ttaenc.c index ac8a432873..239136cae6 100644 --- a/libavcodec/ttaenc.c +++ b/libavcodec/ttaenc.c @@ -214,4 +214,5 @@ AVCodec ff_tta_encoder = { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 177/217] avcodec/vb: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/vb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vb.c b/libavcodec/vb.c index fe419c7663..278d772082 100644 --- a/libavcodec/vb.c +++ b/libavcodec/vb.c @@ -288,5 +288,5 @@ AVCodec ff_vb_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 178/217] avcodec/vqavideo: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/vqavideo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index f45390cfe5..05f77fd1c8 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -653,4 +653,5 @@ AVCodec ff_vqa_decoder = { .decode = vqa_decode_frame, .capabilities = AV_CODEC_CAP_DR1, .defaults = vqa_defaults, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 179/217] avcodec/vqavideo: Cleanup generically on init failure
Signed-off-by: Andreas Rheinhardt --- libavcodec/vqavideo.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index 05f77fd1c8..004e11ed7f 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -171,17 +171,17 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx) s->codebook_size = MAX_CODEBOOK_SIZE; s->codebook = av_malloc(s->codebook_size); if (!s->codebook) -goto fail; +return AVERROR(ENOMEM); s->next_codebook_buffer = av_malloc(s->codebook_size); if (!s->next_codebook_buffer) -goto fail; +return AVERROR(ENOMEM); /* allocate decode buffer */ s->decode_buffer_size = (s->width / s->vector_width) * (s->height / s->vector_height) * 2; s->decode_buffer = av_mallocz(s->decode_buffer_size); if (!s->decode_buffer) -goto fail; +return AVERROR(ENOMEM); /* initialize the solid-color vectors */ if (s->vector_height == 4) { @@ -198,11 +198,6 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx) s->next_codebook_buffer_index = 0; return 0; -fail: -av_freep(&s->codebook); -av_freep(&s->next_codebook_buffer); -av_freep(&s->decode_buffer); -return AVERROR(ENOMEM); } #define CHECK_COUNT() \ @@ -653,5 +648,5 @@ AVCodec ff_vqa_decoder = { .decode = vqa_decode_frame, .capabilities = AV_CODEC_CAP_DR1, .defaults = vqa_defaults, -.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 180/217] avcodec/vcr1: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/vcr1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index 28a5eec7d1..e19bac1ec7 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -130,4 +130,5 @@ AVCodec ff_vcr1_decoder = { .init = vcr1_decode_init, .decode = vcr1_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 181/217] avcodec/v210dec: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/v210dec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c index 044d35338b..0dec8a9769 100644 --- a/libavcodec/v210dec.c +++ b/libavcodec/v210dec.c @@ -226,4 +226,5 @@ AVCodec ff_v210_decoder = { AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, .priv_class = &v210dec_class, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 182/217] avcodec/v210x: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/v210x.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c index f6a453aabf..70b2da55f6 100644 --- a/libavcodec/v210x.c +++ b/libavcodec/v210x.c @@ -128,4 +128,5 @@ AVCodec ff_v210x_decoder = { .init = decode_init, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 183/217] avcodec/v308dec: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/v308dec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/v308dec.c b/libavcodec/v308dec.c index dd53fbded4..377665dbff 100644 --- a/libavcodec/v308dec.c +++ b/libavcodec/v308dec.c @@ -80,4 +80,5 @@ AVCodec ff_v308_decoder = { .init = v308_decode_init, .decode = v308_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 184/217] avcodec/vmnc: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/vmnc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c index 7f441bc4bd..43f8c2aedb 100644 --- a/libavcodec/vmnc.c +++ b/libavcodec/vmnc.c @@ -582,4 +582,5 @@ AVCodec ff_vmnc_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 185/217] avcodec/tiertexseqv: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/tiertexseqv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c index 91c8314379..9610989a6f 100644 --- a/libavcodec/tiertexseqv.c +++ b/libavcodec/tiertexseqv.c @@ -271,4 +271,5 @@ AVCodec ff_tiertexseqvideo_decoder = { .close = seqvideo_decode_end, .decode = seqvideo_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 186/217] avcodec/v410dec: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/v410dec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c index 7ad5eb8fb5..87c98f75ba 100644 --- a/libavcodec/v410dec.c +++ b/libavcodec/v410dec.c @@ -124,5 +124,6 @@ AVCodec ff_v410_decoder = { .init = v410_decode_init, .decode = v410_decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | -AV_CODEC_CAP_FRAME_THREADS +AV_CODEC_CAP_FRAME_THREADS, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 187/217] avcodec/takdec: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/takdec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index 9fa1cb1f7f..af491d96e7 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -952,4 +952,5 @@ AVCodec ff_tak_decoder = { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE }, +.caps_internal= FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 188/217] avcodec/sanm: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/sanm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index debd0c..9c11600b76 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -1525,4 +1525,5 @@ AVCodec ff_sanm_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 193/217] avcodec/alac: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/alac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 9040673528..abcf032acc 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -626,6 +626,6 @@ AVCodec ff_alac_decoder = { .close = alac_decode_close, .decode = alac_decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .priv_class = &alac_class }; -- 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 189/217] avcodec/sanm: Cleanup generically on init failure
Signed-off-by: Andreas Rheinhardt --- libavcodec/sanm.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 9c11600b76..599ecc3737 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -470,10 +470,8 @@ static av_cold int init_buffers(SANMVideoContext *ctx) &ctx->stored_frame_size, ctx->buf_size); if (!ctx->frm0 || !ctx->frm1 || !ctx->frm2 || -(!ctx->stored_frame && !ctx->version)) { -destroy_buffers(ctx); +(!ctx->stored_frame && !ctx->version)) return AVERROR(ENOMEM); -} return 0; } @@ -1525,5 +1523,5 @@ AVCodec ff_sanm_decoder = { .close = decode_end, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, -.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 194/217] avcodec/012v: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/012v.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/012v.c b/libavcodec/012v.c index b5a4066656..7231819875 100644 --- a/libavcodec/012v.c +++ b/libavcodec/012v.c @@ -152,4 +152,5 @@ AVCodec ff_zero12v_decoder = { .init = zero12v_decode_init, .decode = zero12v_decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 190/217] avcodec/binkaudio: Fix memleak upon init failure
Signed-off-by: Andreas Rheinhardt --- libavcodec/binkaudio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index 7b5965ede1..f25aea0d64 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -344,6 +344,7 @@ AVCodec ff_binkaudio_rdft_decoder = { .close = decode_end, .receive_frame = binkaudio_receive_frame, .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; AVCodec ff_binkaudio_dct_decoder = { @@ -356,4 +357,5 @@ AVCodec ff_binkaudio_dct_decoder = { .close = decode_end, .receive_frame = binkaudio_receive_frame, .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 195/217] avcodec/mpegaudioenc: Mark encoders as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegaudioenc_fixed.c | 1 + libavcodec/mpegaudioenc_float.c | 1 + 2 files changed, 2 insertions(+) diff --git a/libavcodec/mpegaudioenc_fixed.c b/libavcodec/mpegaudioenc_fixed.c index 022b6fedd3..eec2ecb579 100644 --- a/libavcodec/mpegaudioenc_fixed.c +++ b/libavcodec/mpegaudioenc_fixed.c @@ -38,4 +38,5 @@ AVCodec ff_mp2fixed_encoder = { AV_CH_LAYOUT_STEREO, 0 }, .defaults = mp2_defaults, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mpegaudioenc_float.c b/libavcodec/mpegaudioenc_float.c index 4d4ab2d7fa..310f7ef98a 100644 --- a/libavcodec/mpegaudioenc_float.c +++ b/libavcodec/mpegaudioenc_float.c @@ -39,4 +39,5 @@ AVCodec ff_mp2_encoder = { AV_CH_LAYOUT_STEREO, 0 }, .defaults = mp2_defaults, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 196/217] avcodec/qtrle: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/qtrle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c index 6bdde75df4..2fce144c52 100644 --- a/libavcodec/qtrle.c +++ b/libavcodec/qtrle.c @@ -600,4 +600,5 @@ AVCodec ff_qtrle_decoder = { .decode = qtrle_decode_frame, .flush = qtrle_decode_flush, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 191/217] avcodec/binkaudio: Check return value of functions that can fail
Signed-off-by: Andreas Rheinhardt --- libavcodec/binkaudio.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index f25aea0d64..2ee6f95f78 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -69,7 +69,7 @@ static av_cold int decode_init(AVCodecContext *avctx) BinkAudioContext *s = avctx->priv_data; int sample_rate = avctx->sample_rate; int sample_rate_half; -int i; +int i, ret; int frame_len_bits; /* determine frame length */ @@ -131,11 +131,13 @@ static av_cold int decode_init(AVCodecContext *avctx) s->first = 1; if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT) -ff_rdft_init(&s->trans.rdft, frame_len_bits, DFT_C2R); +ret = ff_rdft_init(&s->trans.rdft, frame_len_bits, DFT_C2R); else if (CONFIG_BINKAUDIO_DCT_DECODER) -ff_dct_init(&s->trans.dct, frame_len_bits, DCT_III); +ret = ff_dct_init(&s->trans.dct, frame_len_bits, DCT_III); else av_assert0(0); +if (ret < 0) +return ret; s->pkt = av_packet_alloc(); if (!s->pkt) -- 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 192/217] avcodec/binkaudio: Mark decoders as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/binkaudio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index 2ee6f95f78..7d8cad1ec5 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -346,7 +346,7 @@ AVCodec ff_binkaudio_rdft_decoder = { .close = decode_end, .receive_frame = binkaudio_receive_frame, .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; AVCodec ff_binkaudio_dct_decoder = { @@ -359,5 +359,5 @@ AVCodec ff_binkaudio_dct_decoder = { .close = decode_end, .receive_frame = binkaudio_receive_frame, .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 197/217] avcodec/wavpackenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/wavpackenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index 0c85fbe374..ee9cd92c32 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -2973,4 +2973,5 @@ AVCodec ff_wavpack_encoder = { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 198/217] avcodec/qtrleenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/qtrleenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c index 8b0edf7b3d..63d7bb33a9 100644 --- a/libavcodec/qtrleenc.c +++ b/libavcodec/qtrleenc.c @@ -413,5 +413,5 @@ AVCodec ff_qtrle_encoder = { .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_ARGB, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 199/217] avcodec/dca*: Make decoder init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/dca_lbr.c | 10 +- libavcodec/dca_lbr.h | 1 + libavcodec/dcadec.c | 14 +++--- libavcodec/dcahuff.c | 6 -- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/libavcodec/dca_lbr.c b/libavcodec/dca_lbr.c index 747fdafd3e..1016a0823d 100644 --- a/libavcodec/dca_lbr.c +++ b/libavcodec/dca_lbr.c @@ -123,21 +123,15 @@ static const uint16_t channel_layouts[7] = { static floatcos_tab[256]; static floatlpc_tab[16]; -static av_cold void init_tables(void) +av_cold void ff_dca_lbr_init_tables(void) { -static int initialized; int i; -if (initialized) -return; - for (i = 0; i < 256; i++) cos_tab[i] = cos(M_PI * i / 128); for (i = 0; i < 16; i++) lpc_tab[i] = sin((i - 8) * (M_PI / ((i < 8) ? 17 : 15))); - -initialized = 1; } static int parse_lfe_24(DCALbrDecoder *s) @@ -1817,8 +1811,6 @@ av_cold void ff_dca_lbr_flush(DCALbrDecoder *s) av_cold int ff_dca_lbr_init(DCALbrDecoder *s) { -init_tables(); - if (!(s->fdsp = avpriv_float_dsp_alloc(0))) return AVERROR(ENOMEM); diff --git a/libavcodec/dca_lbr.h b/libavcodec/dca_lbr.h index 6d4c0a8a63..17472d6dee 100644 --- a/libavcodec/dca_lbr.h +++ b/libavcodec/dca_lbr.h @@ -129,6 +129,7 @@ typedef struct DCALbrDecoder { int ff_dca_lbr_parse(DCALbrDecoder *s, uint8_t *data, DCAExssAsset *asset); int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame *frame); av_cold void ff_dca_lbr_flush(DCALbrDecoder *s); +av_cold void ff_dca_lbr_init_tables(void); av_cold int ff_dca_lbr_init(DCALbrDecoder *s); av_cold void ff_dca_lbr_close(DCALbrDecoder *s); diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c index 4146a85ec5..be860d4cc7 100644 --- a/libavcodec/dcadec.c +++ b/libavcodec/dcadec.c @@ -20,6 +20,7 @@ #include "libavutil/opt.h" #include "libavutil/channel_layout.h" +#include "libavutil/thread.h" #include "dcadec.h" #include "dcahuff.h" @@ -318,8 +319,15 @@ static av_cold int dcadec_close(AVCodecContext *avctx) return 0; } +static av_cold void dcadec_init_static(void) +{ +ff_dca_lbr_init_tables(); +ff_dca_init_vlcs(); +} + static av_cold int dcadec_init(AVCodecContext *avctx) { +static AVOnce init_static_once = AV_ONCE_INIT; DCAContext *s = avctx->priv_data; s->avctx = avctx; @@ -328,8 +336,6 @@ static av_cold int dcadec_init(AVCodecContext *avctx) s->xll.avctx = avctx; s->lbr.avctx = avctx; -ff_dca_init_vlcs(); - if (ff_dca_core_init(&s->core) < 0) return AVERROR(ENOMEM); @@ -362,6 +368,8 @@ static av_cold int dcadec_init(AVCodecContext *avctx) break; } +ff_thread_once(&init_static_once, dcadec_init_static); + return 0; } @@ -396,5 +404,5 @@ AVCodec ff_dca_decoder = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, .priv_class = &dcadec_class, .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles), -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/dcahuff.c b/libavcodec/dcahuff.c index 0a3eeb4d22..6197ccfe9b 100644 --- a/libavcodec/dcahuff.c +++ b/libavcodec/dcahuff.c @@ -1263,12 +1263,8 @@ VLC ff_dca_vlc_rsd; av_cold void ff_dca_init_vlcs(void) { static VLC_TYPE dca_table[30214][2]; -static int vlcs_initialized = 0; int i, j, k = 0; -if (vlcs_initialized) -return; - #define DCA_INIT_VLC(vlc, a, b, c, d) \ do {\ vlc.table = &dca_table[vlc_offs[k]]; \ @@ -1331,8 +1327,6 @@ av_cold void ff_dca_init_vlcs(void) LBR_INIT_VLC(ff_dca_vlc_grid_2, grid_2, 9); LBR_INIT_VLC(ff_dca_vlc_grid_3, grid_3, 9); LBR_INIT_VLC(ff_dca_vlc_rsd, rsd, 6); - -vlcs_initialized = 1; } uint32_t ff_dca_vlc_calc_quant_bits(int *values, uint8_t n, uint8_t sel, uint8_t table) -- 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 200/217] avcodec/sonic: Mark encoders as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/sonic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index a285228bbc..d8254f3a2a 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -1097,7 +1097,7 @@ AVCodec ff_sonic_encoder = { .encode2= sonic_encode_frame, .sample_fmts= (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .capabilities = AV_CODEC_CAP_EXPERIMENTAL, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .close = sonic_encode_close, }; #endif @@ -1113,7 +1113,7 @@ AVCodec ff_sonic_ls_encoder = { .encode2= sonic_encode_frame, .sample_fmts= (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .capabilities = AV_CODEC_CAP_EXPERIMENTAL, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, .close = sonic_encode_close, }; #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".
[FFmpeg-devel] [PATCH 201/217] avcodec/sonic: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/sonic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index d8254f3a2a..4f75b2d985 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -1082,7 +1082,7 @@ AVCodec ff_sonic_decoder = { .close = sonic_decode_close, .decode = sonic_decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; #endif /* CONFIG_SONIC_DECODER */ -- 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 202/217] avcodec/assenc: Mark encoders as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/assenc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/assenc.c b/libavcodec/assenc.c index a6e1d5d8b9..f3ced556de 100644 --- a/libavcodec/assenc.c +++ b/libavcodec/assenc.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "ass.h" +#include "internal.h" #include "libavutil/avstring.h" #include "libavutil/internal.h" #include "libavutil/mem.h" @@ -111,6 +112,7 @@ AVCodec ff_ssa_encoder = { .init = ass_encode_init, .encode_sub = ass_encode_frame, .priv_data_size = sizeof(ASSEncodeContext), +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -123,5 +125,6 @@ AVCodec ff_ass_encoder = { .init = ass_encode_init, .encode_sub = ass_encode_frame, .priv_data_size = sizeof(ASSEncodeContext), +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #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".
[FFmpeg-devel] [PATCH 203/217] avcodec/movtextenc, srtenc, webvttenc: Mark encoders as init-threadsafe
They all rely on ff_ass_split(), which does not have any static state. Signed-off-by: Andreas Rheinhardt --- libavcodec/movtextenc.c | 2 +- libavcodec/srtenc.c | 4 libavcodec/webvttenc.c | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 1bef21e0b9..8da98d61e1 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -731,5 +731,5 @@ AVCodec ff_movtext_encoder = { .init = mov_text_encode_init, .encode_sub = mov_text_encode_frame, .close = mov_text_encode_close, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; diff --git a/libavcodec/srtenc.c b/libavcodec/srtenc.c index 655b65679e..1ec5e693ef 100644 --- a/libavcodec/srtenc.c +++ b/libavcodec/srtenc.c @@ -25,6 +25,7 @@ #include "libavutil/bprint.h" #include "ass_split.h" #include "ass.h" +#include "internal.h" #define SRT_STACK_SIZE 64 @@ -314,6 +315,7 @@ AVCodec ff_srt_encoder = { .init = srt_encode_init, .encode_sub = srt_encode_frame, .close = srt_encode_close, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -327,6 +329,7 @@ AVCodec ff_subrip_encoder = { .init = srt_encode_init, .encode_sub = srt_encode_frame, .close = srt_encode_close, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -340,5 +343,6 @@ AVCodec ff_text_encoder = { .init = srt_encode_init, .encode_sub = text_encode_frame, .close = srt_encode_close, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif diff --git a/libavcodec/webvttenc.c b/libavcodec/webvttenc.c index febf6ee370..ed762f77e8 100644 --- a/libavcodec/webvttenc.c +++ b/libavcodec/webvttenc.c @@ -26,6 +26,7 @@ #include "libavutil/bprint.h" #include "ass_split.h" #include "ass.h" +#include "internal.h" #define WEBVTT_STACK_SIZE 64 typedef struct { @@ -233,4 +234,5 @@ AVCodec ff_webvtt_encoder = { .init = webvtt_encode_init, .encode_sub = webvtt_encode_frame, .close = webvtt_encode_close, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 204/217] avcodec/ass_split: Don't presume strlen to be >= 2
Fixes potential heap-buffer-overflow. Signed-off-by: Andreas Rheinhardt --- libavcodec/ass_split.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c index c2c388d9f0..189272bbd9 100644 --- a/libavcodec/ass_split.c +++ b/libavcodec/ass_split.c @@ -376,7 +376,7 @@ ASSSplitContext *ff_ass_split(const char *buf) ASSSplitContext *ctx = av_mallocz(sizeof(*ctx)); if (!ctx) return NULL; -if (buf && !memcmp(buf, "\xef\xbb\xbf", 3)) // Skip UTF-8 BOM header +if (buf && !strncmp(buf, "\xef\xbb\xbf", 3)) // Skip UTF-8 BOM header buf += 3; ctx->current_section = -1; if (ass_split(ctx, buf) < 0) { -- 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 205/217] avcodec/dvbsubdec: Add const where appropriate
These pointers sometimes point to static storage (namely to default_clut), so adding const to the pointed-to type is important to ensure that one does not accidentally modify something that is not owned by a single AVCodecContext. Signed-off-by: Andreas Rheinhardt --- libavcodec/dvbsubdec.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index 9bee33e4a2..b1a0c3ff24 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -724,8 +724,8 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou DVBSubDisplayDefinition *display_def = ctx->display_definition; DVBSubRegion *region; AVSubtitleRect *rect; -DVBSubCLUT *clut; -uint32_t *clut_table; +const DVBSubCLUT *clut; +const uint32_t *clut_table; int i; int offset_x=0, offset_y=0; int ret = 0; @@ -1454,8 +1454,8 @@ static int save_display_set(DVBSubContext *ctx) { DVBSubRegion *region; DVBSubRegionDisplay *display; -DVBSubCLUT *clut; -uint32_t *clut_table; +const DVBSubCLUT *clut; +const uint32_t *clut_table; int x_pos, y_pos, width, height; int x, y, y_off, x_off; uint32_t *pbuf; -- 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 206/217] avcodec/dvbsubdec: Make decoder init-threadsafe
Note: This decoder uses a static variable in save_display_set() (which is only enabled if DEBUG is defined); yet said function can't be reached from the decoder's init function at all, so it is no problem for setting the FF_CODEC_CAP_INIT_THREADSAFE flag. Signed-off-by: Andreas Rheinhardt --- libavcodec/dvbsubdec.c | 55 -- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index b1a0c3ff24..81b8460593 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -26,6 +26,7 @@ #include "libavutil/colorspace.h" #include "libavutil/imgutils.h" #include "libavutil/opt.h" +#include "libavutil/thread.h" #define DVBSUB_PAGE_SEGMENT 0x10 #define DVBSUB_REGION_SEGMENT 0x11 @@ -254,31 +255,9 @@ static void delete_regions(DVBSubContext *ctx) } } -static av_cold int dvbsub_init_decoder(AVCodecContext *avctx) +static av_cold void init_default_clut(void) { int i, r, g, b, a = 0; -DVBSubContext *ctx = avctx->priv_data; - -if (ctx->substream < 0) { -ctx->composition_id = -1; -ctx->ancillary_id = -1; -} else if (!avctx->extradata || (avctx->extradata_size < 4) || ((avctx->extradata_size % 5 != 0) && (avctx->extradata_size != 4))) { -av_log(avctx, AV_LOG_WARNING, "Invalid DVB subtitles stream extradata!\n"); -ctx->composition_id = -1; -ctx->ancillary_id = -1; -} else { -if (avctx->extradata_size > 5*ctx->substream + 2) { -ctx->composition_id = AV_RB16(avctx->extradata + 5*ctx->substream); -ctx->ancillary_id = AV_RB16(avctx->extradata + 5*ctx->substream + 2); -} else { -av_log(avctx, AV_LOG_WARNING, "Selected DVB subtitles sub-stream %d is not available\n", ctx->substream); -ctx->composition_id = AV_RB16(avctx->extradata); -ctx->ancillary_id = AV_RB16(avctx->extradata + 2); -} -} - -ctx->version = -1; -ctx->prev_start = AV_NOPTS_VALUE; default_clut.id = -1; default_clut.next = NULL; @@ -339,6 +318,35 @@ static av_cold int dvbsub_init_decoder(AVCodecContext *avctx) } default_clut.clut256[i] = RGBA(r, g, b, a); } +} + +static av_cold int dvbsub_init_decoder(AVCodecContext *avctx) +{ +static AVOnce init_static_once = AV_ONCE_INIT; +DVBSubContext *ctx = avctx->priv_data; + +if (ctx->substream < 0) { +ctx->composition_id = -1; +ctx->ancillary_id = -1; +} else if (!avctx->extradata || (avctx->extradata_size < 4) || ((avctx->extradata_size % 5 != 0) && (avctx->extradata_size != 4))) { +av_log(avctx, AV_LOG_WARNING, "Invalid DVB subtitles stream extradata!\n"); +ctx->composition_id = -1; +ctx->ancillary_id = -1; +} else { +if (avctx->extradata_size > 5*ctx->substream + 2) { +ctx->composition_id = AV_RB16(avctx->extradata + 5*ctx->substream); +ctx->ancillary_id = AV_RB16(avctx->extradata + 5*ctx->substream + 2); +} else { +av_log(avctx, AV_LOG_WARNING, "Selected DVB subtitles sub-stream %d is not available\n", ctx->substream); +ctx->composition_id = AV_RB16(avctx->extradata); +ctx->ancillary_id = AV_RB16(avctx->extradata + 2); +} +} + +ctx->version = -1; +ctx->prev_start = AV_NOPTS_VALUE; + +ff_thread_once(&init_static_once, init_default_clut); return 0; } @@ -1758,4 +1766,5 @@ AVCodec ff_dvbsub_decoder = { .close = dvbsub_close_decoder, .decode = dvbsub_decode, .priv_class = &dvbsubdec_class, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 207/217] avcodec/assdec: Mark decoders as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/assdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/assdec.c b/libavcodec/assdec.c index f0b1069cd2..78df1c30ad 100644 --- a/libavcodec/assdec.c +++ b/libavcodec/assdec.c @@ -23,6 +23,7 @@ #include "avcodec.h" #include "ass.h" +#include "internal.h" #include "libavutil/internal.h" #include "libavutil/mem.h" @@ -69,6 +70,7 @@ AVCodec ff_ssa_decoder = { .id = AV_CODEC_ID_ASS, .init = ass_decode_init, .decode = ass_decode_frame, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #endif @@ -80,5 +82,6 @@ AVCodec ff_ass_decoder = { .id = AV_CODEC_ID_ASS, .init = ass_decode_init, .decode = ass_decode_frame, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; #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".
[FFmpeg-devel] [PATCH 208/217] avcodec: Mark ff_ass_subtitle_header based decoders as init-threadsafe
ff_ass_subtitle_header_full() just uses av_asprintf() and is therefore thread-safe itself. Signed-off-by: Andreas Rheinhardt --- libavcodec/ccaption_dec.c | 2 ++ libavcodec/jacosubdec.c | 2 ++ libavcodec/microdvddec.c | 2 ++ libavcodec/movtextdec.c | 2 ++ libavcodec/mpl2dec.c | 2 ++ libavcodec/realtextdec.c | 2 ++ libavcodec/samidec.c | 2 ++ libavcodec/srtdec.c | 3 +++ libavcodec/subviewerdec.c | 2 ++ libavcodec/textdec.c | 6 ++ libavcodec/webvttdec.c| 2 ++ 11 files changed, 27 insertions(+) diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index a208e19b95..a75a5e03db 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -21,6 +21,7 @@ #include "avcodec.h" #include "ass.h" +#include "internal.h" #include "libavutil/opt.h" #define SCREEN_ROWS 15 @@ -952,4 +953,5 @@ AVCodec ff_ccaption_decoder = { .decode = decode, .priv_class = &ccaption_dec_class, .capabilities = AV_CODEC_CAP_DELAY, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/jacosubdec.c b/libavcodec/jacosubdec.c index cdb372af58..b632e474c5 100644 --- a/libavcodec/jacosubdec.c +++ b/libavcodec/jacosubdec.c @@ -26,6 +26,7 @@ #include #include "ass.h" +#include "internal.h" #include "jacosub.h" #include "libavutil/avstring.h" #include "libavutil/bprint.h" @@ -202,4 +203,5 @@ AVCodec ff_jacosub_decoder = { .decode = jacosub_decode_frame, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/microdvddec.c b/libavcodec/microdvddec.c index dad0ec8a22..c39d54e084 100644 --- a/libavcodec/microdvddec.c +++ b/libavcodec/microdvddec.c @@ -31,6 +31,7 @@ #include "libavutil/bprint.h" #include "avcodec.h" #include "ass.h" +#include "internal.h" static int indexof(const char *s, int c) { @@ -377,4 +378,5 @@ AVCodec ff_microdvd_decoder = { .decode = microdvd_decode_frame, .flush= ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index ad790bf44c..8a219a457c 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -28,6 +28,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/mem.h" #include "bytestream.h" +#include "internal.h" #define STYLE_FLAG_BOLD (1<<0) #define STYLE_FLAG_ITALIC (1<<1) @@ -593,4 +594,5 @@ AVCodec ff_movtext_decoder = { .decode = mov_text_decode_frame, .close= mov_text_decode_close, .flush= mov_text_flush, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/mpl2dec.c b/libavcodec/mpl2dec.c index 409e4b3708..d60528af32 100644 --- a/libavcodec/mpl2dec.c +++ b/libavcodec/mpl2dec.c @@ -27,6 +27,7 @@ #include "avcodec.h" #include "ass.h" +#include "internal.h" #include "libavutil/bprint.h" static int mpl2_event_to_ass(AVBPrint *buf, const char *p) @@ -90,4 +91,5 @@ AVCodec ff_mpl2_decoder = { .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/realtextdec.c b/libavcodec/realtextdec.c index 5084781123..8581081c02 100644 --- a/libavcodec/realtextdec.c +++ b/libavcodec/realtextdec.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "ass.h" +#include "internal.h" #include "libavutil/avstring.h" #include "libavutil/bprint.h" @@ -83,4 +84,5 @@ AVCodec ff_realtext_decoder = { .init = ff_ass_subtitle_header_default, .flush = ff_ass_decoder_flush, .priv_data_size = sizeof(FFASSDecoderContext), +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c index e32f238c62..400a7642a2 100644 --- a/libavcodec/samidec.c +++ b/libavcodec/samidec.c @@ -28,6 +28,7 @@ #include "libavutil/avstring.h" #include "libavutil/bprint.h" #include "htmlsubtitles.h" +#include "internal.h" typedef struct { AVBPrint source; @@ -190,4 +191,5 @@ AVCodec ff_sami_decoder = { .close = sami_close, .decode = sami_decode_frame, .flush = sami_flush, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; diff --git a/libavcodec/srtdec.c b/libavcodec/srtdec.c index ecc0801595..8ee4e04934 100644 --- a/libavcodec/srtdec.c +++ b/libavcodec/srtdec.c @@ -26,6 +26,7 @@ #include "avcodec.h" #include "ass.h" #include "htmlsubtitles.h" +#include "internal.h" static int srt_to_ass(AVCodecContext *avctx, AVBPrint *dst, const char *in, int x1, int y1, int x2, int y2) @@ -96,6 +97,7 @@ AVCodec ff_srt_decoder = { .decode = srt_decode_frame, .flush=
[FFmpeg-devel] [PATCH 209/217] avcodec/kmvc: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/kmvc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index ffe6a142e9..1d6260ae87 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -425,4 +425,5 @@ AVCodec ff_kmvc_decoder = { .init = decode_init, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 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 210/217] avcodec/bink: Make decoder init-threadsafe
Signed-off-by: Andreas Rheinhardt --- libavcodec/bink.c | 38 -- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/libavcodec/bink.c b/libavcodec/bink.c index ec164d0165..f1fa9c0071 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -23,6 +23,7 @@ #include "libavutil/attributes.h" #include "libavutil/imgutils.h" #include "libavutil/internal.h" +#include "libavutil/thread.h" #define BITSTREAM_READER_LE #include "avcodec.h" @@ -1308,6 +1309,19 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac return pkt->size; } +static av_cold void bink_init_vlcs(void) +{ +for (int i = 0; i < 16; i++) { +static VLC_TYPE table[16 * 128][2]; +const int maxbits = bink_tree_lens[i][15]; +bink_trees[i].table = table + i*128; +bink_trees[i].table_allocated = 1 << maxbits; +init_vlc(&bink_trees[i], maxbits, 16, + bink_tree_lens[i], 1, 1, + bink_tree_bits[i], 1, 1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); +} +} + /** * Calculate quantization tables for version b */ @@ -1342,11 +1356,10 @@ static av_cold void binkb_calc_quant(void) static av_cold int decode_init(AVCodecContext *avctx) { +static AVOnce init_static_once = AV_ONCE_INIT; BinkContext * const c = avctx->priv_data; -static VLC_TYPE table[16 * 128][2]; -static int binkb_initialised = 0; HpelDSPContext hdsp; -int i, ret; +int ret; int flags; c->version = avctx->codec_tag >> 24; @@ -1357,16 +1370,6 @@ static av_cold int decode_init(AVCodecContext *avctx) flags = AV_RL32(avctx->extradata); c->has_alpha = flags & BINK_FLAG_ALPHA; c->swap_planes = c->version >= 'h'; -if (!bink_trees[15].table) { -for (i = 0; i < 16; i++) { -const int maxbits = bink_tree_lens[i][15]; -bink_trees[i].table = table + i*128; -bink_trees[i].table_allocated = 1 << maxbits; -init_vlc(&bink_trees[i], maxbits, 16, - bink_tree_lens[i], 1, 1, - bink_tree_bits[i], 1, 1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); -} -} c->avctx = avctx; if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0) @@ -1388,11 +1391,10 @@ static av_cold int decode_init(AVCodecContext *avctx) return ret; if (c->version == 'b') { -if (!binkb_initialised) { -binkb_calc_quant(); -binkb_initialised = 1; -} +static AVOnce binkb_init_once = AV_ONCE_INIT; +ff_thread_once(&binkb_init_once, binkb_calc_quant); } +ff_thread_once(&init_static_once, bink_init_vlcs); return 0; } @@ -1425,5 +1427,5 @@ AVCodec ff_bink_decoder = { .decode = decode_frame, .flush = flush, .capabilities = AV_CODEC_CAP_DR1, -.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP, }; -- 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 211/217] avcodec/bink: Don't waste space for VLC table
The Bink video decoder uses VLCs; the longest codes of these VLCs have different lengths, yet they are all so small that each VLC is read in one go, so that the number of elements in the VLC table actually used by each table is 1 << nb_bits, where nb_bits is the length of the longest code. Yet when determining the size of the VLC table nb_bits has been overestimated as the number of bits of the longest code in all VLCs, making said table unnecessary big (2048 vs 976 elements). Signed-off-by: Andreas Rheinhardt --- libavcodec/bink.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/bink.c b/libavcodec/bink.c index f1fa9c0071..04c104be48 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -1311,11 +1311,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac static av_cold void bink_init_vlcs(void) { -for (int i = 0; i < 16; i++) { -static VLC_TYPE table[16 * 128][2]; +for (int i = 0, offset = 0; i < 16; i++) { +static VLC_TYPE table[976][2]; const int maxbits = bink_tree_lens[i][15]; -bink_trees[i].table = table + i*128; +bink_trees[i].table = table + offset; bink_trees[i].table_allocated = 1 << maxbits; +offset += bink_trees[i].table_allocated; init_vlc(&bink_trees[i], maxbits, 16, bink_tree_lens[i], 1, 1, bink_tree_bits[i], 1, 1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE); -- 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".