[FFmpeg-devel] [PATCH] lavc/nvenc: enable nvenc encoder instance reuse after draining
--- libavcodec/nvenc.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index b4186c0bec..8928eacc70 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -2181,6 +2181,12 @@ int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt) av_fifo_generic_write(ctx->unused_surface_queue, _out_surf, sizeof(tmp_out_surf), NULL); } else if (ctx->encoder_flushing) { +/* reset to initial state so the encoder can be re-used */ +ctx->encoder_flushing = 0; +ctx->first_packet_output = 0; +ctx->initial_pts[0] = AV_NOPTS_VALUE; +ctx->initial_pts[1] = AV_NOPTS_VALUE; +av_fifo_reset(ctx->timestamp_list); return AVERROR_EOF; } else { return AVERROR(EAGAIN); -- 2.16.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 11/26] vaapi_encode: Add common options between all encoders
On Sat, 2018-05-26 at 17:26 +0100, Mark Thompson wrote: > On 25/05/18 07:01, Xiang, Haihao wrote: > > > > Hi Mark > > > > Do you plan to merge this commit any time soon? > > There are quite a few changes throughout the set, I'll resend it soon. > Thanks for your reply, I'd like to give a try with your new patchset. Thanks Haihao ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavu: add calling convention for OpenCL callback.
On Thu, Jun 7, 2018 at 12:21 AM, Mark Thompson wrote: > On 06/06/18 16:31, Ruiling Song wrote: >> This fix a build error on Windows: >> C2440: connot convert from 'void (__cdecl *) (...)' to 'void (__stdcall >> *)(...)'. >> >> Signed-off-by: Ruiling Song >> --- >> libavutil/hwcontext_opencl.c | 7 --- >> 1 file changed, 4 insertions(+), 3 deletions(-) >> >> diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c >> index 43b5c5a..e08d7bc 100644 >> --- a/libavutil/hwcontext_opencl.c >> +++ b/libavutil/hwcontext_opencl.c >> @@ -141,9 +141,10 @@ typedef struct OpenCLFramesContext { >> } OpenCLFramesContext; >> >> >> -static void opencl_error_callback(const char *errinfo, >> - const void *private_info, size_t cb, >> - void *user_data) >> +static void CL_CALLBACK opencl_error_callback(const char *errinfo, >> + const void *private_info, >> + size_t cb, >> + void *user_data) >> { >> AVHWDeviceContext *ctx = user_data; >> av_log(ctx, AV_LOG_ERROR, "OpenCL error: %s\n", errinfo); >> > > Yep, applied. > > Is this visible in any MSVC build, or does it have to be 32-bit? (All my > testing on Windows has been done with MinGW-w64, where __stdcall/__cdecl have > no effect and this goes unnoticed.) > Should be 32-bit only, there are no different calling conventions on 64-bit. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavu: add calling convention for OpenCL callback.
On 06/06/18 16:31, Ruiling Song wrote: > This fix a build error on Windows: > C2440: connot convert from 'void (__cdecl *) (...)' to 'void (__stdcall > *)(...)'. > > Signed-off-by: Ruiling Song > --- > libavutil/hwcontext_opencl.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c > index 43b5c5a..e08d7bc 100644 > --- a/libavutil/hwcontext_opencl.c > +++ b/libavutil/hwcontext_opencl.c > @@ -141,9 +141,10 @@ typedef struct OpenCLFramesContext { > } OpenCLFramesContext; > > > -static void opencl_error_callback(const char *errinfo, > - const void *private_info, size_t cb, > - void *user_data) > +static void CL_CALLBACK opencl_error_callback(const char *errinfo, > + const void *private_info, > + size_t cb, > + void *user_data) > { > AVHWDeviceContext *ctx = user_data; > av_log(ctx, AV_LOG_ERROR, "OpenCL error: %s\n", errinfo); > Yep, applied. Is this visible in any MSVC build, or does it have to be 32-bit? (All my testing on Windows has been done with MinGW-w64, where __stdcall/__cdecl have no effect and this goes unnoticed.) Thanks, - Mark ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/4] avcodec/vc1: rewrite vc1_decode_i_blocks to align with VC-1 spec
On Wed, Jun 06, 2018 at 08:47:27PM +0200, Jerome Borsboom wrote: > Change vc1_decode_i_blocks to use vc1_put_blocks_clamped and > ff_vc1_i_loop_filter. > > Signed-off-by: Jerome Borsboom > --- > libavcodec/vc1_block.c | 77 > ++ > 1 file changed, 28 insertions(+), 49 deletions(-) This breaks fate-mss2-wmv [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Concerning the gods, I have no means of knowing whether they exist or not or of what sort they may be, because of the obscurity of the subject, and the brevity of human life -- Protagoras signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Limited timecode support for lavd/decklink
On Wed, 6 Jun 2018, Dave Rice wrote: On Jun 6, 2018, at 4:50 PM, Marton Balint wrote: On Mon, 4 Jun 2018, Dave Rice wrote: In my testing the timecode value set here has corrected been associated with the first video frame (maintaining the timecode-to-first-frame relationship as found on the source video stream). Although only having first timecode value known is limiting, I think this is still quite useful. This function also mirrors how BlackMagic Media Express and Adobe Premiere handle capturing video+timecode where only the first value is documented and all subsequent values are presumed. Could you give me an example? (e.g. ffmpeg command line?) ./ffmpeg -timecode_format vitc2 -f decklink -draw_bars 0 -audio_input embedded -video_input sdi -format_code ntsc -channels 8 -raw_format yuv422p10 -i "UltraStudio 3D" -c:v v210 -c:a aac output.mov This worked for me to embed a QuickTime timecode track based upon the timecode value of the first frame. If the input contained non-sequential timecode values then the timecode track would not be accurate from that point onward, but creating a timecode track based only upon the initial value is what BlackMagic Media Express and Adobe Premiere are doing anyhow. Hmm, either the decklink drivers became better in hinding the first few NoSignal frames, or maybe that issue only affected to old models? (e.g. DeckLink SDI or DeckLink Duo 1). I did some test with a Mini Recorder, and even the first frame was useful, in this case the timecode was indeed correct. I'd rather see a new AVPacketSideData type which will contain the timecode as a string, so you can set it frame-by-frame. Using side data for timecode would be preferable, but the possibility that a patch for that may someday arrive shouldn’t completely block this more limited patch. I would like to make sure the code works reliably even for the limited use case and no race conditions are affectig the way it works. Feel welcome to suggest any testing. I’ll have access for testing again tomorrow. I reworked the patch a bit (see attached), and added per-frame timcode support into the PKT_STRINGS_METADATA packet side data, this way the drawtext filter can also be used to blend the timecode into the frames, which seems like a useful feature. That sounds helpful. libavdevice/decklink_dec.cpp:734:21: error: unknown type name 'DECKLINK_STR' DECKLINK_STR decklink_tc; The patch I sent only replaces the second patch, the first one: http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180526/185eb219/attachment.obj is still needed. Regards, Marton ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Limited timecode support for lavd/decklink
> On Jun 6, 2018, at 4:50 PM, Marton Balint wrote: > > On Mon, 4 Jun 2018, Dave Rice wrote: > >> In my testing the timecode value set here has corrected been associated with the first video frame (maintaining the timecode-to-first-frame relationship as found on the source video stream). Although only having first timecode value known is limiting, I think this is still quite useful. This function also mirrors how BlackMagic Media Express and Adobe Premiere handle capturing video+timecode where only the first value is documented and all subsequent values are presumed. >>> Could you give me an example? (e.g. ffmpeg command line?) >> >> ./ffmpeg -timecode_format vitc2 -f decklink -draw_bars 0 -audio_input >> embedded -video_input sdi -format_code ntsc -channels 8 -raw_format >> yuv422p10 -i "UltraStudio 3D" -c:v v210 -c:a aac output.mov >> >> This worked for me to embed a QuickTime timecode track based upon the >> timecode value of the first frame. If the input contained non-sequential >> timecode values then the timecode track would not be accurate from that >> point onward, but creating a timecode track based only upon the initial >> value is what BlackMagic Media Express and Adobe Premiere are doing anyhow. >> > > Hmm, either the decklink drivers became better in hinding the first few > NoSignal frames, or maybe that issue only affected to old models? (e.g. > DeckLink SDI or DeckLink Duo 1). I did some test with a Mini Recorder, and > even the first frame was useful, in this case the timecode was indeed correct. > > I'd rather see a new AVPacketSideData type which will contain the > timecode as a string, so you can set it frame-by-frame. Using side data for timecode would be preferable, but the possibility that a patch for that may someday arrive shouldn’t completely block this more limited patch. >>> I would like to make sure the code works reliably even for the limited use >>> case and no race conditions are affectig the way it works. >> >> Feel welcome to suggest any testing. I’ll have access for testing again >> tomorrow. > > I reworked the patch a bit (see attached), and added per-frame timcode > support into the PKT_STRINGS_METADATA packet side data, this way the drawtext > filter can also be used to blend the timecode into the frames, which seems > like a useful feature. That sounds helpful. libavdevice/decklink_dec.cpp:734:21: error: unknown type name 'DECKLINK_STR' DECKLINK_STR decklink_tc; Dave ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Limited timecode support for lavd/decklink
On Mon, 4 Jun 2018, Dave Rice wrote: In my testing the timecode value set here has corrected been associated with the first video frame (maintaining the timecode-to-first-frame relationship as found on the source video stream). Although only having first timecode value known is limiting, I think this is still quite useful. This function also mirrors how BlackMagic Media Express and Adobe Premiere handle capturing video+timecode where only the first value is documented and all subsequent values are presumed. Could you give me an example? (e.g. ffmpeg command line?) ./ffmpeg -timecode_format vitc2 -f decklink -draw_bars 0 -audio_input embedded -video_input sdi -format_code ntsc -channels 8 -raw_format yuv422p10 -i "UltraStudio 3D" -c:v v210 -c:a aac output.mov This worked for me to embed a QuickTime timecode track based upon the timecode value of the first frame. If the input contained non-sequential timecode values then the timecode track would not be accurate from that point onward, but creating a timecode track based only upon the initial value is what BlackMagic Media Express and Adobe Premiere are doing anyhow. Hmm, either the decklink drivers became better in hinding the first few NoSignal frames, or maybe that issue only affected to old models? (e.g. DeckLink SDI or DeckLink Duo 1). I did some test with a Mini Recorder, and even the first frame was useful, in this case the timecode was indeed correct. I'd rather see a new AVPacketSideData type which will contain the timecode as a string, so you can set it frame-by-frame. Using side data for timecode would be preferable, but the possibility that a patch for that may someday arrive shouldn’t completely block this more limited patch. I would like to make sure the code works reliably even for the limited use case and no race conditions are affectig the way it works. Feel welcome to suggest any testing. I’ll have access for testing again tomorrow. I reworked the patch a bit (see attached), and added per-frame timcode support into the PKT_STRINGS_METADATA packet side data, this way the drawtext filter can also be used to blend the timecode into the frames, which seems like a useful feature. Regards, MartonFrom bb69bdab51d46df6ad9ffe934e395dc959904051 Mon Sep 17 00:00:00 2001 From: Jon Morley Date: Thu, 31 May 2018 02:45:07 -0700 Subject: [PATCH] avdevice/decklink_dec: capture timecode to metadata when requested If the user provides a valid timecode_format look for timecode of that format in the capture and if found store it on the video avstream's metadata. Slightly modified by Marton Balint to capture per-frame timecode as well. Signed-off-by: Marton Balint --- doc/indevs.texi | 6 ++ libavdevice/decklink_common.h | 12 libavdevice/decklink_common_c.h | 1 + libavdevice/decklink_dec.cpp| 41 + libavdevice/decklink_dec_c.c| 9 + 5 files changed, 69 insertions(+) diff --git a/doc/indevs.texi b/doc/indevs.texi index 6951940a93..632d1e4743 100644 --- a/doc/indevs.texi +++ b/doc/indevs.texi @@ -326,6 +326,12 @@ Defaults to @samp{2}. Sets the decklink device duplex mode. Must be @samp{unset}, @samp{half} or @samp{full}. Defaults to @samp{unset}. +@item timecode_format +Timecode type to include in the frame and video stream metadata. Must be +@samp{none}, @samp{rp188vitc}, @samp{rp188vitc2}, @samp{rp188ltc}, +@samp{rp188any}, @samp{vitc}, @samp{vitc2}, or @samp{serial}. Defaults to +@samp{none} (not included). + @item video_input Sets the video input source. Must be @samp{unset}, @samp{sdi}, @samp{hdmi}, @samp{optical_sdi}, @samp{component}, @samp{composite} or @samp{s_video}. diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h index 8064abdcb9..96b001c2d8 100644 --- a/libavdevice/decklink_common.h +++ b/libavdevice/decklink_common.h @@ -93,6 +93,7 @@ struct decklink_ctx { BMDDisplayMode bmd_mode; BMDVideoConnection video_input; BMDAudioConnection audio_input; +BMDTimecodeFormat tc_format; int bmd_width; int bmd_height; int bmd_field_dominance; @@ -169,6 +170,17 @@ static const BMDVideoConnection decklink_video_connection_map[] = { bmdVideoConnectionSVideo, }; +static const BMDTimecodeFormat decklink_timecode_format_map[] = { +(BMDTimecodeFormat)0, +bmdTimecodeRP188VITC1, +bmdTimecodeRP188VITC2, +bmdTimecodeRP188LTC, +bmdTimecodeRP188Any, +bmdTimecodeVITC, +bmdTimecodeVITCField2, +bmdTimecodeSerial, +}; + HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName); int ff_decklink_set_configs(AVFormatContext *avctx, decklink_direction_t direction); int ff_decklink_set_format(AVFormatContext *avctx, int width, int height, int tb_num, int tb_den, enum AVFieldOrder field_order, decklink_direction_t direction = DIRECTION_OUT, int num = 0); diff --git a/libavdevice/decklink_common_c.h
Re: [FFmpeg-devel] [PATCH]lavc/profiles: Mention AAC-LC only once
2018-05-31 1:47 GMT+02:00, Carl Eugen Hoyos : > I noticed that AAC-LC is listed twice in ff_aac_profiles[] Patch applied. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH]ffmpeg: Fail if the user requested impossible subtitle encoding
Hi! Attached patch is meant to fix ticket #7239. Please comment, Carl Eugen From 309b7855f663053a5d11c5403a811bd723e472b9 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Wed, 6 Jun 2018 21:09:38 +0200 Subject: [PATCH] ffmpeg: Fail if the user requested impossible subtitle encoding. --- fftools/ffmpeg.c | 17 + 1 file changed, 17 insertions(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 10f3012..d4ac690 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -3485,6 +3485,23 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len) return ret; } } +if (ist && ist->dec->type == AVMEDIA_TYPE_SUBTITLE && ost->enc->type == AVMEDIA_TYPE_SUBTITLE) { +int input_props = 0, output_props = 0; +AVCodecDescriptor const *input_descriptor = +avcodec_descriptor_get(dec->codec_id); +AVCodecDescriptor const *output_descriptor = +avcodec_descriptor_get(ost->enc_ctx->codec_id); +if (input_descriptor) +input_props = input_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); +if (output_descriptor) +output_props = output_descriptor->props & (AV_CODEC_PROP_TEXT_SUB | AV_CODEC_PROP_BITMAP_SUB); +if (input_props && output_props && input_props != output_props) { +snprintf(error, error_len, + "Subtitle encoding currently only possible from text to text " + "or bitmap to bitmap"); +return AVERROR_INVALIDDATA; +} +} if ((ret = avcodec_open2(ost->enc_ctx, codec, >encoder_opts)) < 0) { if (ret == AVERROR_EXPERIMENTAL) -- 1.7.10.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] avcodec/vc1: fix overlap filtering for Simple and Main profile
2018-06-06 20:47 GMT+02:00, Jerome Borsboom : > Overlap filtering I and BI frames for Simple and Main profile is only > dependent on PQUANT. Restrict testing for CONDOVER and OVERFLAGS to > advanced profile. > > Signed-off-by: Jerome Borsboom > --- > This patch set should fix decoding of the SSL0015.rcv test file to make it > bit-equal to the reference decoder. I can confirm that this patchset fixes the file. The following three files all seem to have the same issues both with software and hardware decoder, frame re-ordering? SA10125.vc1, SA10126.vc1, SA10127.vc1 Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/3] avcodec/truemotion2: Fix overflow in tm2_apply_deltas()
On Tue, Jun 05, 2018 at 02:47:44AM +0200, Michael Niedermayer wrote: > Fixes: signed integer overflow: 1077952576 + 1077952576 cannot be represented > in type 'int' > Fixes: > 7712/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5056281753681920 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/truemotion2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) will apply patchset [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB "Nothing to hide" only works if the folks in power share the values of you and everyone you know entirely and always will -- Tom Scott signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 4/4] avcodec/vc1: remove unused ff_vc1_loop_filter_iblk
Signed-off-by: Jerome Borsboom --- libavcodec/vc1.h| 1 - libavcodec/vc1_loopfilter.c | 30 -- 2 files changed, 31 deletions(-) diff --git a/libavcodec/vc1.h b/libavcodec/vc1.h index 1d283f8589..69f6ca9e4d 100644 --- a/libavcodec/vc1.h +++ b/libavcodec/vc1.h @@ -422,7 +422,6 @@ void ff_vc1_init_transposed_scantables(VC1Context *v); int ff_vc1_decode_end(AVCodecContext *avctx); void ff_vc1_decode_blocks(VC1Context *v); -void ff_vc1_loop_filter_iblk(VC1Context *v, int pq); void ff_vc1_i_overlap_filter(VC1Context *v); void ff_vc1_p_overlap_filter(VC1Context *v); void ff_vc1_i_loop_filter(VC1Context *v); diff --git a/libavcodec/vc1_loopfilter.c b/libavcodec/vc1_loopfilter.c index 39b298cd28..fd83eaa7f5 100644 --- a/libavcodec/vc1_loopfilter.c +++ b/libavcodec/vc1_loopfilter.c @@ -31,36 +31,6 @@ #include "vc1.h" #include "vc1dsp.h" -void ff_vc1_loop_filter_iblk(VC1Context *v, int pq) -{ -MpegEncContext *s = >s; -int j; -if (!s->first_slice_line) { -v->vc1dsp.vc1_v_loop_filter16(s->dest[0], s->linesize, pq); -if (s->mb_x) -v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize, s->linesize, pq); -v->vc1dsp.vc1_h_loop_filter16(s->dest[0] - 16 * s->linesize + 8, s->linesize, pq); -if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) -for (j = 0; j < 2; j++) { -v->vc1dsp.vc1_v_loop_filter8(s->dest[j + 1], s->uvlinesize, pq); -if (s->mb_x) -v->vc1dsp.vc1_h_loop_filter8(s->dest[j + 1] - 8 * s->uvlinesize, s->uvlinesize, pq); -} -} -v->vc1dsp.vc1_v_loop_filter16(s->dest[0] + 8 * s->linesize, s->linesize, pq); - -if (s->mb_y == s->end_mb_y - 1) { -if (s->mb_x) { -v->vc1dsp.vc1_h_loop_filter16(s->dest[0], s->linesize, pq); -if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { -v->vc1dsp.vc1_h_loop_filter8(s->dest[1], s->uvlinesize, pq); -v->vc1dsp.vc1_h_loop_filter8(s->dest[2], s->uvlinesize, pq); -} -} -v->vc1dsp.vc1_h_loop_filter16(s->dest[0] + 8, s->linesize, pq); -} -} - static av_always_inline void vc1_h_overlap_filter(VC1Context *v, int16_t (*left_block)[64], int16_t (*right_block)[64], int block_num) { -- 2.13.6 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/4] avcodec/vc1: add Simple and Main profile to vc1_put_signed_blocks_clamped
Simple and Main profile also need unsigned put_pixels_clamped. Add an argument to choose between signed and unsigned put_pixels and change function name to vc1_put_blocks_clamped. Signed-off-by: Jerome Borsboom --- libavcodec/vc1_block.c | 54 ++ 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index caf1596812..ae179a15cc 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -66,7 +66,7 @@ static inline void init_block_index(VC1Context *v) /** @} */ //Bitplane group -static void vc1_put_signed_blocks_clamped(VC1Context *v) +static void vc1_put_blocks_clamped(VC1Context *v, int put_signed) { MpegEncContext *s = >s; uint8_t *dest; @@ -85,9 +85,14 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v) if (i > 3 ? v->mb_type[0][s->block_index[i] - s->block_wrap[i] - 1] : v->mb_type[0][s->block_index[i] - 2 * s->block_wrap[i] - 2]) { dest = s->dest[0] + ((i & 2) - 4) * 4 * s->linesize + ((i & 1) - 2) * 8; - s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][i], - i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize - 8 : dest, - i > 3 ? s->uvlinesize : s->linesize); +if (put_signed) + s->idsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][i], + i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize - 8 : dest, + i > 3 ? s->uvlinesize : s->linesize); +else + s->idsp.put_pixels_clamped(v->block[v->topleft_blk_idx][i], + i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize - 8 : dest, + i > 3 ? s->uvlinesize : s->linesize); } } } @@ -96,9 +101,14 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v) if (i > 3 ? v->mb_type[0][s->block_index[i] - s->block_wrap[i]] : v->mb_type[0][s->block_index[i] - 2 * s->block_wrap[i]]) { dest = s->dest[0] + ((i & 2) - 4) * 4 * s->linesize + (i & 1) * 8; - s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][i], - i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize : dest, - i > 3 ? s->uvlinesize : s->linesize); +if (put_signed) + s->idsp.put_signed_pixels_clamped(v->block[v->top_blk_idx][i], + i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize : dest, + i > 3 ? s->uvlinesize : s->linesize); +else +s->idsp.put_pixels_clamped(v->block[v->top_blk_idx][i], + i > 3 ? s->dest[i - 3] - 8 * s->uvlinesize : dest, + i > 3 ? s->uvlinesize : s->linesize); } } } @@ -114,9 +124,14 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v) dest = s->dest[0] + ((i & 2) >> 1) * s->linesize + ((i & 1) - 2) * 8; else dest = s->dest[0] + (i & 2) * 4 * s->linesize + ((i & 1) - 2) * 8; - s->idsp.put_signed_pixels_clamped(v->block[v->left_blk_idx][i], - i > 3 ? s->dest[i - 3] - 8 : dest, - i > 3 ? s->uvlinesize : s->linesize << fieldtx); +if (put_signed) + s->idsp.put_signed_pixels_clamped(v->block[v->left_blk_idx][i], + i > 3 ? s->dest[i - 3] - 8 : dest, + i > 3 ? s->uvlinesize : s->linesize << fieldtx); +else + s->idsp.put_pixels_clamped(v->block[v->left_blk_idx][i], + i > 3 ? s->dest[i - 3] - 8 : dest, + i > 3 ? s->uvlinesize : s->linesize << fieldtx); } } } @@ -129,9 +144,14 @@ static void vc1_put_signed_blocks_clamped(VC1Context *v) dest = s->dest[0] + ((i & 2) >> 1) * s->linesize + (i & 1) * 8; else dest = s->dest[0] + (i & 2) * 4 * s->linesize + (i & 1) * 8; -
[FFmpeg-devel] [PATCH 3/4] avcodec/vc1: rewrite vc1_decode_i_blocks to align with VC-1 spec
Change vc1_decode_i_blocks to use vc1_put_blocks_clamped and ff_vc1_i_loop_filter. Signed-off-by: Jerome Borsboom --- libavcodec/vc1_block.c | 77 ++ 1 file changed, 28 insertions(+), 49 deletions(-) diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c index ae179a15cc..1890ee8901 100644 --- a/libavcodec/vc1_block.c +++ b/libavcodec/vc1_block.c @@ -2541,26 +2541,24 @@ static void vc1_decode_i_blocks(VC1Context *v) s->mb_x = 0; init_block_index(v); for (; s->mb_x < v->end_mb_x; s->mb_x++) { -uint8_t *dst[6]; +int16_t (*block)[64] = v->block[v->cur_blk_idx]; ff_update_block_index(s); -dst[0] = s->dest[0]; -dst[1] = dst[0] + 8; -dst[2] = s->dest[0] + s->linesize * 8; -dst[3] = dst[2] + 8; -dst[4] = s->dest[1]; -dst[5] = s->dest[2]; -s->bdsp.clear_blocks(s->block[0]); +s->bdsp.clear_blocks(block[0]); mb_pos = s->mb_x + s->mb_y * s->mb_width; s->current_picture.mb_type[mb_pos] = MB_TYPE_INTRA; s->current_picture.qscale_table[mb_pos]= v->pq; -s->current_picture.motion_val[1][s->block_index[0]][0] = 0; -s->current_picture.motion_val[1][s->block_index[0]][1] = 0; +for (int i = 0; i < 4; i++) { +s->current_picture.motion_val[1][s->block_index[i]][0] = 0; +s->current_picture.motion_val[1][s->block_index[i]][1] = 0; +} // do actual MB decoding and displaying cbp = get_vlc2(>s.gb, ff_msmp4_mb_i_vlc.table, MB_INTRA_VLC_BITS, 2); v->s.ac_pred = get_bits1(>s.gb); for (k = 0; k < 6; k++) { +v->mb_type[0][s->block_index[k]] = 1; + val = ((cbp >> (5 - k)) & 1); if (k < 4) { @@ -2570,52 +2568,28 @@ static void vc1_decode_i_blocks(VC1Context *v) } cbp |= val << (5 - k); -vc1_decode_i_block(v, s->block[k], k, val, (k < 4) ? v->codingset : v->codingset2); +vc1_decode_i_block(v, block[k], k, val, (k < 4) ? v->codingset : v->codingset2); if (CONFIG_GRAY && k > 3 && (s->avctx->flags & AV_CODEC_FLAG_GRAY)) continue; -v->vc1dsp.vc1_inv_trans_8x8(s->block[k]); -if (v->pq >= 9 && v->overlap) { -if (v->rangeredfrm) -for (j = 0; j < 64; j++) -s->block[k][j] <<= 1; -s->idsp.put_signed_pixels_clamped(s->block[k], dst[k], - k & 4 ? s->uvlinesize -: s->linesize); -} else { -if (v->rangeredfrm) -for (j = 0; j < 64; j++) -s->block[k][j] = (s->block[k][j] - 64) << 1; -s->idsp.put_pixels_clamped(s->block[k], dst[k], - k & 4 ? s->uvlinesize - : s->linesize); -} +v->vc1dsp.vc1_inv_trans_8x8(block[k]); } -if (v->pq >= 9 && v->overlap) { -if (s->mb_x) { -v->vc1dsp.vc1_h_overlap(s->dest[0], s->linesize); -v->vc1dsp.vc1_h_overlap(s->dest[0] + 8 * s->linesize, s->linesize); -if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { -v->vc1dsp.vc1_h_overlap(s->dest[1], s->uvlinesize); -v->vc1dsp.vc1_h_overlap(s->dest[2], s->uvlinesize); -} -} -v->vc1dsp.vc1_h_overlap(s->dest[0] + 8, s->linesize); -v->vc1dsp.vc1_h_overlap(s->dest[0] + 8 * s->linesize + 8, s->linesize); -if (!s->first_slice_line) { -v->vc1dsp.vc1_v_overlap(s->dest[0], s->linesize); -v->vc1dsp.vc1_v_overlap(s->dest[0] + 8, s->linesize); -if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { -v->vc1dsp.vc1_v_overlap(s->dest[1], s->uvlinesize); -v->vc1dsp.vc1_v_overlap(s->dest[2], s->uvlinesize); -} -} -v->vc1dsp.vc1_v_overlap(s->dest[0] + 8 * s->linesize, s->linesize); -v->vc1dsp.vc1_v_overlap(s->dest[0] + 8 * s->linesize + 8, s->linesize); +if (v->overlap && v->pq >= 9) { +ff_vc1_i_overlap_filter(v); +if (v->rangeredfrm) +for (j = 0; j < 64; j++) +block[k][j] <<= 1; +vc1_put_blocks_clamped(v, 1); +}
[FFmpeg-devel] [PATCH 1/4] avcodec/vc1: fix overlap filtering for Simple and Main profile
Overlap filtering I and BI frames for Simple and Main profile is only dependent on PQUANT. Restrict testing for CONDOVER and OVERFLAGS to advanced profile. Signed-off-by: Jerome Borsboom --- This patch set should fix decoding of the SSL0015.rcv test file to make it bit-equal to the reference decoder. libavcodec/vc1_loopfilter.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/libavcodec/vc1_loopfilter.c b/libavcodec/vc1_loopfilter.c index aceb1f77ff..39b298cd28 100644 --- a/libavcodec/vc1_loopfilter.c +++ b/libavcodec/vc1_loopfilter.c @@ -108,8 +108,10 @@ void ff_vc1_i_overlap_filter(VC1Context *v) if (s->mb_x == 0 && (i & 5) != 1) continue; -if (v->pq >= 9 || v->condover == CONDOVER_ALL || -(v->over_flags_plane[mb_pos] && ((i & 5) == 1 || v->over_flags_plane[mb_pos - 1]))) +if (v->pq >= 9 || (v->profile == PROFILE_ADVANCED && + (v->condover == CONDOVER_ALL || +(v->over_flags_plane[mb_pos] && + ((i & 5) == 1 || v->over_flags_plane[mb_pos - 1]) vc1_h_overlap_filter(v, s->mb_x ? left_blk : cur_blk, cur_blk, i); } @@ -118,15 +120,18 @@ void ff_vc1_i_overlap_filter(VC1Context *v) if (s->first_slice_line && !(i & 2)) continue; -if (s->mb_x && (v->pq >= 9 || v->condover == CONDOVER_ALL || -(v->over_flags_plane[mb_pos - 1] && - ((i & 2) || v->over_flags_plane[mb_pos - 1 - s->mb_stride] +if (s->mb_x && +(v->pq >= 9 || (v->profile == PROFILE_ADVANCED && +(v->condover == CONDOVER_ALL || + (v->over_flags_plane[mb_pos - 1] && + ((i & 2) || v->over_flags_plane[mb_pos - 1 - s->mb_stride])) vc1_v_overlap_filter(v, s->first_slice_line ? left_blk : topleft_blk, left_blk, i); -if (s->mb_x == s->mb_width - 1) -if (v->pq >= 9 || v->condover == CONDOVER_ALL || -(v->over_flags_plane[mb_pos] && - ((i & 2) || v->over_flags_plane[mb_pos - s->mb_stride]))) -vc1_v_overlap_filter(v, s->first_slice_line ? cur_blk : top_blk, cur_blk, i); +if (s->mb_x == s->mb_width - 1 && +(v->pq >= 9 || (v->profile == PROFILE_ADVANCED && +(v->condover == CONDOVER_ALL || + (v->over_flags_plane[mb_pos] && + ((i & 2) || v->over_flags_plane[mb_pos - s->mb_stride])) +vc1_v_overlap_filter(v, s->first_slice_line ? cur_blk : top_blk, cur_blk, i); } } -- 2.13.6 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Evolution of lavfi's design and API
Michael Niedermayer (2018-06-04): > If noone, who has time to reply knows the awnser then you probably have to > find it out from the code and any unfinished patchsets > > sending nicolas a private mail may also be more vissible to him than the ML > in case he is busy In terms of design, the big thing missing from lavfi is a clean API to run a filter graph. Right now, it relies on requests on outputs, with a fragile heuristic to find the "oldest" one. A clean API would allow to run it as a whole and react to frames on output or requests on inputs, possibly with callbacks. This must come before threading, because it is what allows to control threading: threading is efficient when the system can start several threads and let them run, doing their work. If it is constantly stopping and re-starting because the calling API makes too small steps, much time is wasted. But more than that, it requires somebody working on it. Speaking for myself, the toxic ambiance in the project since a few months has destroyed my motivation for doing anything ambitious on it. And to be completely forthright, I feel that Paul is partly responsible for that toxic ambiance; see his interventions on the thread about enforcing the code of conduct for example. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 6/6] avformat/mxfdec: add support for recognizing timed text streams
tis 2018-06-05 klockan 20:33 +0200 skrev Marton Balint: > > On Tue, 5 Jun 2018, Tomas Härdin wrote: > > > tor 2018-05-31 klockan 02:05 +0200 skrev Marton Balint: > > > > Signed-off-by: Marton Balint > > > > > > --- > > > libavformat/mxfdec.c | 8 > > > 1 file changed, 8 insertions(+) > > > > > > +type = avcodec_get_type(st->codecpar->codec_id); > > > +if (type == AVMEDIA_TYPE_SUBTITLE) > > > +st->codecpar->codec_type = type; > > > > This feels like something that belongs in more generic parts of lavf. > > Filling codecpar with defaults for some given codec_id that is. > > I assumed some codecs can be audio and video at the same time, and this is > why it's not automatic. wrapped_avframe (like it or not) is such a codec. > In any case, I'd rather not change the way it works here... Huh, didn't know that. Actually, the separation of audio and video is probably one of the greatest crimes in digital multimedia /Tomas ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] lavu: add calling convention for OpenCL callback.
This fix a build error on Windows: C2440: connot convert from 'void (__cdecl *) (...)' to 'void (__stdcall *)(...)'. Signed-off-by: Ruiling Song --- libavutil/hwcontext_opencl.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c index 43b5c5a..e08d7bc 100644 --- a/libavutil/hwcontext_opencl.c +++ b/libavutil/hwcontext_opencl.c @@ -141,9 +141,10 @@ typedef struct OpenCLFramesContext { } OpenCLFramesContext; -static void opencl_error_callback(const char *errinfo, - const void *private_info, size_t cb, - void *user_data) +static void CL_CALLBACK opencl_error_callback(const char *errinfo, + const void *private_info, + size_t cb, + void *user_data) { AVHWDeviceContext *ctx = user_data; av_log(ctx, AV_LOG_ERROR, "OpenCL error: %s\n", errinfo); -- 2.7.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [GSOC] [PATCH] TensorFlow backend introduction for DNN module
Hi, 2018-06-05 20:23 GMT-03:00 Sergey Lavrushkin : > Here is the patch, that fixes described issues. When I try to run (video input), when tf is not enabled in configure it crashes. $ffmpeg -i in.mp4 -vf srcnn=dnn_backend=tensorflow out.mp4 ffmpeg version N-91232-g256386fd3e Copyright (c) 2000-2018 the FFmpeg developers built with gcc 7 (Ubuntu 7.3.0-16ubuntu3) configuration: libavutil 56. 18.102 / 56. 18.102 libavcodec 58. 19.105 / 58. 19.105 libavformat58. 17.100 / 58. 17.100 libavdevice58. 4.100 / 58. 4.100 libavfilter 7. 25.100 / 7. 25.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'in.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf58.17.100 Duration: 00:06:13.70, start: 0.00, bitrate: 5912 kb/s Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 5777 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc (default) Metadata: handler_name: VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name: SoundHandler Stream mapping: Stream #0:0 -> #0:0 (mpeg4 (native) -> mpeg4 (native)) Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help free(): invalid pointer Aborted (core dumped) When the output is an image, t does not crashes but neither fallback to native $ffmpeg -i in.jpg -vf srcnn=dnn_backend=tensorflow out.png ffmpeg version N-91232-g256386fd3e Copyright (c) 2000-2018 the FFmpeg developers built with gcc 7 (Ubuntu 7.3.0-16ubuntu3) configuration: libavutil 56. 18.102 / 56. 18.102 libavcodec 58. 19.105 / 58. 19.105 libavformat58. 17.100 / 58. 17.100 libavdevice58. 4.100 / 58. 4.100 libavfilter 7. 25.100 / 7. 25.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100 Input #0, image2, from 'in.jpg': Duration: 00:00:00.04, start: 0.00, bitrate: 43469 kb/s Stream #0:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1192x670 [SAR 1:1 DAR 596:335], 25 tbr, 25 tbn, 25 tbc Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> png (native)) Press [q] to stop, [?] for help [Parsed_srcnn_0 @ 0x557d3ea55980] could not create DNN module for requested backend [AVFilterGraph @ 0x557d3ea102c0] Error initializing filter 'srcnn' with args 'dnn_backend=tensorflow' Error reinitializing filters! Failed to inject frame into filter network: Cannot allocate memory Error while processing the decoded data for stream #0:0 Conversion failed! I think you could disable the tensorflow option if it is not enable in configure or fallback to native, either solution is ok for me. > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2] configure fix arm inline defines
On 6/6/2018 6:19 AM, John Cox wrote: >> Hi >> >> Actually this is the same patch as before but master has been fixed s.t. >> enabling arm inline asm no longer breaks it: >> >> I believe there is a bug in the arm feature detection for inline asm in >> configure and I have a patch for it. >> >> Currently using a command line like: >> >> ./configure --enable-cross-compile --arch=arm --cpu=cortex-a7 >> --target-os=linux --cross-prefix=arm-linux-gnueabihf- >> >> gives in config.h: >> >> #define HAVE_ARMV5TE 1 >> #define HAVE_ARMV6 1 >> #define HAVE_ARMV6T2 1 >> #define HAVE_ARMV8 0 >> #define HAVE_NEON 1 >> #define HAVE_VFP 1 >> #define HAVE_VFPV3 1 >> #define HAVE_SETEND 1 >> ... >> #define HAVE_ARMV5TE_EXTERNAL 1 >> #define HAVE_ARMV6_EXTERNAL 1 >> #define HAVE_ARMV6T2_EXTERNAL 1 >> #define HAVE_ARMV8_EXTERNAL 0 >> #define HAVE_NEON_EXTERNAL 0 >> #define HAVE_VFP_EXTERNAL 1 >> #define HAVE_VFPV3_EXTERNAL 1 >> #define HAVE_SETEND_EXTERNAL 1 >> ... >> #define HAVE_ARMV5TE_INLINE 0 >> #define HAVE_ARMV6_INLINE 0 >> #define HAVE_ARMV6T2_INLINE 0 >> #define HAVE_ARMV8_INLINE 0 >> #define HAVE_NEON_INLINE 0 >> #define HAVE_VFP_INLINE 0 >> #define HAVE_VFPV3_INLINE 0 >> #define HAVE_SETEND_INLINE 0 >> >> With the patch below you get >> >> ... >> #define HAVE_ARMV5TE 1 >> #define HAVE_ARMV6 1 >> #define HAVE_ARMV6T2 1 >> #define HAVE_ARMV8 0 >> #define HAVE_NEON 1 >> #define HAVE_VFP 1 >> #define HAVE_VFPV3 1 >> #define HAVE_SETEND 1 >> ... >> #define HAVE_ARMV5TE_EXTERNAL 1 >> #define HAVE_ARMV6_EXTERNAL 1 >> #define HAVE_ARMV6T2_EXTERNAL 1 >> #define HAVE_ARMV8_EXTERNAL 0 >> #define HAVE_NEON_EXTERNAL 0 >> #define HAVE_VFP_EXTERNAL 1 >> #define HAVE_VFPV3_EXTERNAL 1 >> #define HAVE_SETEND_EXTERNAL 1 >> ... >> #define HAVE_ARMV5TE_INLINE 1 >> #define HAVE_ARMV6_INLINE 1 >> #define HAVE_ARMV6T2_INLINE 1 >> #define HAVE_ARMV8_INLINE 0 >> #define HAVE_NEON_INLINE 0 >> #define HAVE_VFP_INLINE 1 >> #define HAVE_VFPV3_INLINE 1 >> #define HAVE_SETEND_INLINE 1 >> >> If I want to get Neon enabled as well then I need to have a --mfpu=neon >> on the command line too. I'm not sure how to get it there unless I pass >> it as extra flags. >> >> This patch adds quotes around the asm that is in the __asm__ statement >> >> Regards >> >> John Cox >> >> diff --git a/configure b/configure >> index 22eeca22a5..4dbee8d349 100755 >> --- a/configure >> +++ b/configure >> @@ -1040,7 +1040,7 @@ EOF >> >> check_insn(){ >> log check_insn "$@" >> -check_inline_asm ${1}_inline "$2" >> +check_inline_asm ${1}_inline "\"$2\"" >> check_as ${1}_external "$2" >> } >> ___ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > Ping > > This fixes the regression whereby no arm inline asm is ever enabled. > > There is still the neon inline regression, but that will be another > patch. > Master now compiles OK with arm inline asm enabled. (Which it didn't 1st > time this patch was suggested) Pushed, sorry for the delay. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] configure: Change license required for NewTek SDK
2018-06-06 8:50 GMT+02:00, Gyan Doshi : > configure, at present, allows all libraries in the nonfree > list to be built with the LGPL license without having to > pass --enable-nonfree. Is that intended? Yes, this is intended. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2] configure fix arm inline defines
>Hi > >Actually this is the same patch as before but master has been fixed s.t. >enabling arm inline asm no longer breaks it: > >I believe there is a bug in the arm feature detection for inline asm in >configure and I have a patch for it. > >Currently using a command line like: > >./configure --enable-cross-compile --arch=arm --cpu=cortex-a7 >--target-os=linux --cross-prefix=arm-linux-gnueabihf- > >gives in config.h: > >#define HAVE_ARMV5TE 1 >#define HAVE_ARMV6 1 >#define HAVE_ARMV6T2 1 >#define HAVE_ARMV8 0 >#define HAVE_NEON 1 >#define HAVE_VFP 1 >#define HAVE_VFPV3 1 >#define HAVE_SETEND 1 >... >#define HAVE_ARMV5TE_EXTERNAL 1 >#define HAVE_ARMV6_EXTERNAL 1 >#define HAVE_ARMV6T2_EXTERNAL 1 >#define HAVE_ARMV8_EXTERNAL 0 >#define HAVE_NEON_EXTERNAL 0 >#define HAVE_VFP_EXTERNAL 1 >#define HAVE_VFPV3_EXTERNAL 1 >#define HAVE_SETEND_EXTERNAL 1 >... >#define HAVE_ARMV5TE_INLINE 0 >#define HAVE_ARMV6_INLINE 0 >#define HAVE_ARMV6T2_INLINE 0 >#define HAVE_ARMV8_INLINE 0 >#define HAVE_NEON_INLINE 0 >#define HAVE_VFP_INLINE 0 >#define HAVE_VFPV3_INLINE 0 >#define HAVE_SETEND_INLINE 0 > >With the patch below you get > >... >#define HAVE_ARMV5TE 1 >#define HAVE_ARMV6 1 >#define HAVE_ARMV6T2 1 >#define HAVE_ARMV8 0 >#define HAVE_NEON 1 >#define HAVE_VFP 1 >#define HAVE_VFPV3 1 >#define HAVE_SETEND 1 >... >#define HAVE_ARMV5TE_EXTERNAL 1 >#define HAVE_ARMV6_EXTERNAL 1 >#define HAVE_ARMV6T2_EXTERNAL 1 >#define HAVE_ARMV8_EXTERNAL 0 >#define HAVE_NEON_EXTERNAL 0 >#define HAVE_VFP_EXTERNAL 1 >#define HAVE_VFPV3_EXTERNAL 1 >#define HAVE_SETEND_EXTERNAL 1 >... >#define HAVE_ARMV5TE_INLINE 1 >#define HAVE_ARMV6_INLINE 1 >#define HAVE_ARMV6T2_INLINE 1 >#define HAVE_ARMV8_INLINE 0 >#define HAVE_NEON_INLINE 0 >#define HAVE_VFP_INLINE 1 >#define HAVE_VFPV3_INLINE 1 >#define HAVE_SETEND_INLINE 1 > >If I want to get Neon enabled as well then I need to have a --mfpu=neon >on the command line too. I'm not sure how to get it there unless I pass >it as extra flags. > >This patch adds quotes around the asm that is in the __asm__ statement > >Regards > >John Cox > >diff --git a/configure b/configure >index 22eeca22a5..4dbee8d349 100755 >--- a/configure >+++ b/configure >@@ -1040,7 +1040,7 @@ EOF > > check_insn(){ > log check_insn "$@" >-check_inline_asm ${1}_inline "$2" >+check_inline_asm ${1}_inline "\"$2\"" > check_as ${1}_external "$2" > } >___ >ffmpeg-devel mailing list >ffmpeg-devel@ffmpeg.org >http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Ping This fixes the regression whereby no arm inline asm is ever enabled. There is still the neon inline regression, but that will be another patch. Master now compiles OK with arm inline asm enabled. (Which it didn't 1st time this patch was suggested) JC ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/1] fftools/ffmpeg: fix for all forced key frames when 'copyts' is enabled
On 6/5/18 2:09 AM, Michael Niedermayer wrote: > On Sun, May 06, 2018 at 10:38:59PM +0530, vdi...@akamai.com wrote: >> From: Vishwanath Dixit >> >> Forced key frames generation functionality was assuming the first PTS >> value as zero, but, when 'copyts' is enabled, the first PTS can be any >> big number. This was eventually forcing all the frames as key frames. >> To resolve this issue, update has been made to use first input pts as >> reference pts. >> --- >> fftools/ffmpeg.c | 6 +- >> fftools/ffmpeg.h | 1 + >> fftools/ffmpeg_opt.c | 1 + >> 3 files changed, 7 insertions(+), 1 deletion(-) > > will apply Thanks for applying the patch... > > thx > > [...] > > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH v3 2/2] lavfi: make vf_colorspace use functions from colorspace.c
These functions are shared among colorspace related filters. Signed-off-by: Ruiling Song --- libavfilter/Makefile| 2 +- libavfilter/vf_colorspace.c | 118 +--- 2 files changed, 23 insertions(+), 97 deletions(-) diff --git a/libavfilter/Makefile b/libavfilter/Makefile index d2c85cf..c20c270 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -166,7 +166,7 @@ OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER) += vf_colorchannelmixer.o OBJS-$(CONFIG_COLORKEY_FILTER) += vf_colorkey.o OBJS-$(CONFIG_COLORLEVELS_FILTER)+= vf_colorlevels.o OBJS-$(CONFIG_COLORMATRIX_FILTER)+= vf_colormatrix.o -OBJS-$(CONFIG_COLORSPACE_FILTER) += vf_colorspace.o colorspacedsp.o +OBJS-$(CONFIG_COLORSPACE_FILTER) += vf_colorspace.o colorspace.o colorspacedsp.o OBJS-$(CONFIG_CONVOLUTION_FILTER)+= vf_convolution.o OBJS-$(CONFIG_CONVOLUTION_OPENCL_FILTER) += vf_convolution_opencl.o opencl.o \ opencl/convolution.o diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c index 71ea08a..b593215 100644 --- a/libavfilter/vf_colorspace.c +++ b/libavfilter/vf_colorspace.c @@ -33,6 +33,7 @@ #include "formats.h" #include "internal.h" #include "video.h" +#include "colorspace.h" enum DitherMode { DITHER_NONE, @@ -110,21 +111,13 @@ static const enum AVColorSpace default_csp[CS_NB + 1] = { struct ColorPrimaries { enum Whitepoint wp; -double xr, yr, xg, yg, xb, yb; +struct PrimaryCoefficients coeff; }; struct TransferCharacteristics { double alpha, beta, gamma, delta; }; -struct LumaCoefficients { -double cr, cg, cb; -}; - -struct WhitepointCoefficients { -double xw, yw; -}; - typedef struct ColorSpaceContext { const AVClass *class; @@ -286,57 +279,30 @@ static const struct WhitepointCoefficients whitepoint_coefficients[WP_NB] = { }; static const struct ColorPrimaries color_primaries[AVCOL_PRI_NB] = { -[AVCOL_PRI_BT709] = { WP_D65, 0.640, 0.330, 0.300, 0.600, 0.150, 0.060 }, -[AVCOL_PRI_BT470M]= { WP_C, 0.670, 0.330, 0.210, 0.710, 0.140, 0.080 }, -[AVCOL_PRI_BT470BG] = { WP_D65, 0.640, 0.330, 0.290, 0.600, 0.150, 0.060,}, -[AVCOL_PRI_SMPTE170M] = { WP_D65, 0.630, 0.340, 0.310, 0.595, 0.155, 0.070 }, -[AVCOL_PRI_SMPTE240M] = { WP_D65, 0.630, 0.340, 0.310, 0.595, 0.155, 0.070 }, -[AVCOL_PRI_SMPTE428] = { WP_E, 0.735, 0.265, 0.274, 0.718, 0.167, 0.009 }, -[AVCOL_PRI_SMPTE431] = { WP_DCI, 0.680, 0.320, 0.265, 0.690, 0.150, 0.060 }, -[AVCOL_PRI_SMPTE432] = { WP_D65, 0.680, 0.320, 0.265, 0.690, 0.150, 0.060 }, -[AVCOL_PRI_FILM] = { WP_C, 0.681, 0.319, 0.243, 0.692, 0.145, 0.049 }, -[AVCOL_PRI_BT2020]= { WP_D65, 0.708, 0.292, 0.170, 0.797, 0.131, 0.046 }, -[AVCOL_PRI_JEDEC_P22] = { WP_D65, 0.630, 0.340, 0.295, 0.605, 0.155, 0.077 }, +[AVCOL_PRI_BT709] = { WP_D65, { 0.640, 0.330, 0.300, 0.600, 0.150, 0.060 } }, +[AVCOL_PRI_BT470M]= { WP_C, { 0.670, 0.330, 0.210, 0.710, 0.140, 0.080 } }, +[AVCOL_PRI_BT470BG] = { WP_D65, { 0.640, 0.330, 0.290, 0.600, 0.150, 0.060 } }, +[AVCOL_PRI_SMPTE170M] = { WP_D65, { 0.630, 0.340, 0.310, 0.595, 0.155, 0.070 } }, +[AVCOL_PRI_SMPTE240M] = { WP_D65, { 0.630, 0.340, 0.310, 0.595, 0.155, 0.070 } }, +[AVCOL_PRI_SMPTE428] = { WP_E, { 0.735, 0.265, 0.274, 0.718, 0.167, 0.009 } }, +[AVCOL_PRI_SMPTE431] = { WP_DCI, { 0.680, 0.320, 0.265, 0.690, 0.150, 0.060 } }, +[AVCOL_PRI_SMPTE432] = { WP_D65, { 0.680, 0.320, 0.265, 0.690, 0.150, 0.060 } }, +[AVCOL_PRI_FILM] = { WP_C, { 0.681, 0.319, 0.243, 0.692, 0.145, 0.049 } }, +[AVCOL_PRI_BT2020]= { WP_D65, { 0.708, 0.292, 0.170, 0.797, 0.131, 0.046 } }, +[AVCOL_PRI_JEDEC_P22] = { WP_D65, { 0.630, 0.340, 0.295, 0.605, 0.155, 0.077 } }, }; static const struct ColorPrimaries *get_color_primaries(enum AVColorPrimaries prm) { -const struct ColorPrimaries *coeffs; +const struct ColorPrimaries *p; if (prm >= AVCOL_PRI_NB) return NULL; -coeffs = _primaries[prm]; -if (!coeffs->xr) +p = _primaries[prm]; +if (!p->coeff.xr) return NULL; -return coeffs; -} - -static void invert_matrix3x3(const double in[3][3], double out[3][3]) -{ -double m00 = in[0][0], m01 = in[0][1], m02 = in[0][2], - m10 = in[1][0], m11 = in[1][1], m12 = in[1][2], - m20 = in[2][0], m21 = in[2][1], m22 = in[2][2]; -int i, j; -double det; - -out[0][0] = (m11 * m22 - m21 * m12); -out[0][1] = -(m01 * m22 - m21 * m02); -out[0][2] = (m01 * m12 - m11 * m02); -out[1][0] = -(m10 * m22 - m20 * m12); -out[1][1] = (m00 * m22 - m20 * m02); -out[1][2] = -(m00 * m12 - m10 * m02); -out[2][0] = (m10 * m21 - m20 * m11); -out[2][1] = -(m00 * m21 - m20 * m01); -out[2][2] = (m00 * m11 - m10 *
[FFmpeg-devel] [PATCH v3 1/2] lavfi: add opencl tonemap filter.
This filter does HDR(HDR10/HLG) to SDR conversion with tone-mapping. An example command to use this filter with vaapi codecs: FFMPEG -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device \ opencl=ocl@va -hwaccel vaapi -hwaccel_device va -hwaccel_output_format \ vaapi -i INPUT -filter_hw_device ocl -filter_complex \ '[0:v]hwmap,tonemap_opencl=t=bt2020:tonemap=linear:format=p010[x1]; \ [x1]hwmap=derive_device=vaapi:reverse=1' -c:v hevc_vaapi -profile 2 OUTPUT Signed-off-by: Ruiling Song --- this version mainly address Mark's comments on v2. Thanks! Ruiling configure | 1 + libavfilter/Makefile| 2 + libavfilter/allfilters.c| 1 + libavfilter/colorspace.c| 90 + libavfilter/colorspace.h| 41 ++ libavfilter/opencl/colorspace_common.cl | 220 +++ libavfilter/opencl/tonemap.cl | 272 + libavfilter/opencl_source.h | 2 + libavfilter/vf_tonemap_opencl.c | 657 9 files changed, 1286 insertions(+) create mode 100644 libavfilter/colorspace.c create mode 100644 libavfilter/colorspace.h create mode 100644 libavfilter/opencl/colorspace_common.cl create mode 100644 libavfilter/opencl/tonemap.cl create mode 100644 libavfilter/vf_tonemap_opencl.c diff --git a/configure b/configure index 53224f0..4ff651f 100755 --- a/configure +++ b/configure @@ -3410,6 +3410,7 @@ tinterlace_filter_deps="gpl" tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" tonemap_filter_deps="const_nan" +tonemap_opencl_filter_deps="opencl const_nan" unsharp_opencl_filter_deps="opencl" uspp_filter_deps="gpl avcodec" vaguedenoiser_filter_deps="gpl" diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 5b4be49..d2c85cf 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -356,6 +356,8 @@ OBJS-$(CONFIG_TINTERLACE_FILTER) += vf_tinterlace.o OBJS-$(CONFIG_TLUT2_FILTER) += vf_lut2.o framesync.o OBJS-$(CONFIG_TMIX_FILTER) += vf_mix.o framesync.o OBJS-$(CONFIG_TONEMAP_FILTER)+= vf_tonemap.o +OBJS-$(CONFIG_TONEMAP_OPENCL_FILTER) += vf_tonemap_opencl.o colorspace.o opencl.o \ +opencl/tonemap.o opencl/colorspace_common.o OBJS-$(CONFIG_TRANSPOSE_FILTER) += vf_transpose.o OBJS-$(CONFIG_TRIM_FILTER) += trim.o OBJS-$(CONFIG_UNPREMULTIPLY_FILTER) += vf_premultiply.o framesync.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index f2d27d2..fa85c29 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -345,6 +345,7 @@ extern AVFilter ff_vf_tinterlace; extern AVFilter ff_vf_tlut2; extern AVFilter ff_vf_tmix; extern AVFilter ff_vf_tonemap; +extern AVFilter ff_vf_tonemap_opencl; extern AVFilter ff_vf_transpose; extern AVFilter ff_vf_trim; extern AVFilter ff_vf_unpremultiply; diff --git a/libavfilter/colorspace.c b/libavfilter/colorspace.c new file mode 100644 index 000..7fd7bdf --- /dev/null +++ b/libavfilter/colorspace.c @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2016 Ronald S. Bultje + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "colorspace.h" + + +void invert_matrix3x3(const double in[3][3], double out[3][3]) +{ +double m00 = in[0][0], m01 = in[0][1], m02 = in[0][2], + m10 = in[1][0], m11 = in[1][1], m12 = in[1][2], + m20 = in[2][0], m21 = in[2][1], m22 = in[2][2]; +int i, j; +double det; + +out[0][0] = (m11 * m22 - m21 * m12); +out[0][1] = -(m01 * m22 - m21 * m02); +out[0][2] = (m01 * m12 - m11 * m02); +out[1][0] = -(m10 * m22 - m20 * m12); +out[1][1] = (m00 * m22 - m20 * m02); +out[1][2] = -(m00 * m12 - m10 * m02); +out[2][0] = (m10 * m21 - m20 * m11); +out[2][1] = -(m00 * m21 - m20 * m01); +out[2][2] = (m00 * m11 - m10 * m01); + +det = m00 * out[0][0] + m10 * out[0][1] + m20 * out[0][2]; +det = 1.0 / det; + +for (i = 0; i < 3; i++) { +for (j = 0; j < 3; j++) +out[i][j] *= det; +} +} + +void mul3x3(double dst[3][3], const double src1[3][3], const
Re: [FFmpeg-devel] [PATCH] configure: Change license required for NewTek SDK
On 06-06-2018 12:05 PM, Roger Pack wrote: FWIW. It might be compatible with the LGPL. configure, at present, allows all libraries in the nonfree list to be built with the LGPL license without having to pass --enable-nonfree. Is that intended? Libav's script disables them if the flag isn't passed. Regards, Gyan ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] configure: Change license required for NewTek SDK
On Wed, Feb 14, 2018 at 6:48 AM, Ricardo Constantino wrote: > On 14 February 2018 at 12:56, Tomas Härdin wrote: > > > On 2018-02-14 13:50, Kyle Schwarz wrote: > > > >> On Wed, Feb 14, 2018 at 7:45 AM, Hendrik Leppkes > >> wrote: > >> > >>> On Wed, Feb 14, 2018 at 1:32 PM, Kyle Schwarz > wrote: > >>> > On Wed, Feb 14, 2018 at 7:20 AM, Carl Eugen Hoyos > > wrote: > > > 2018-02-14 13:12 GMT+01:00 Kyle Schwarz : > > > >> On Wed, Feb 14, 2018 at 6:54 AM, Carl Eugen Hoyos < > ceffm...@gmail.com> > >> wrote: > >> > >>> 2018-02-14 12:21 GMT+01:00 Kyle Schwarz : > >>> Sorry, I wasn't immediately able to find the sources for the > >>> ndi library: Please post a link. > >>> > >> The only official way I know to get the SDK is by providing them > with > >> an email when selecting "Download": https://www.newtek.com/ndi/sdk/ > >> > > Do you have the sources that allow to build the library "ndi" (that > > FFmpeg links against), to change it and redistribute it? > > > No, the library comes pre built in the SDK. > > >>> If you need to link against a proprietary binary, then the resulting > >>> binary is no longer GPL compatible, and as such non-free, no matter > >>> the license of the headers. > >>> > >> Good to know, thanks for clearing this up. Sounds like NewTek might be > >> a little confused about this: > >> https://ffmpeg.zeranoe.com/forum/viewtopic.php?f=42=13238#p13238 > >> > > > > This applies only to the CLI. The libraries are LGPL, so things may be > > different there depending on how things are packaged/linked. The LGPL > > permits distributing proprietary object files such that a functioning > > library may be linked together. See https://www.gnu.org/licenses/g > > pl-faq.en.html#LGPLStaticVsDynamic > > > > > The SDK license agreement also mentions that it's unredistributable. > Doesn't that make it as nonfree as decklink's? > Interestingly, they SDK license says the SDK is "non redistributable" but says that particular files can override that. for instance here is the file "Processing.NDI.Lib.h" header: // NOTE : The following MIT license applies to this file ONLY and not to the SDK as a whole. Please review the SDK documentation // for the description of the full license terms, which are also provided in the file "NDI License Agreement.pdf" within the SDK or // online at http://new.tk/ndisdk_license/. Your use of any part of this SDK is acknowledgment that you agree to the SDK license // terms. THe full NDI SDK may be downloaded at https://www.newtek.com/ndi/sdk/ // //*** // // Copyright(c) 2014-2017 NewTek, inc // // 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. // //*** … FWIW. It might be compatible with the LGPL. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel