Re: [FFmpeg-devel] [PATCH 1/2 v3] avfilter: add readvitc filter
On 08.04.2016 23:08, Carl Eugen Hoyos wrote: Tobias Rapp noa-archive.com> writes: Wouldn't the algorithm also work for GBR? If VITC lines are green, yes . I just tested the sample you uploaded with the following command after adding AV_PIX_FMT_GBRP to the supported input formats: $ ffprobe -of compact=p=0 -show_entries frame=pkt_pts:frame_tags -f lavfi movie=sample-vitc.avi,readvitc Output looks identical to yuv420p so I guess white is ok... (I assume you also converted the sample file to GBRP.) It might work with RGB input in some cases but the algorithm really only looks at one component and assumes it is luma. For real RGB support one would have to combine the three color components and then feed it to the "read_vitc_line" function. Regards, Tobias ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swscale/arm: add yuv2planeX_8_neon
Hi, (again, thanks to both of you for documenting all this assembly /NEON code) On 09/04/2016 10:22, Matthieu Bouron wrote: From: Matthieu Bouron --- Hello, The following patch add yuv2planeX_8_neon function for the arm platform. It is currently restricted to 8-bit per component sources until I fix fate issues with 10-bit sources (the dnxhd-*-10bit tests fail but I haven't figured out yet where it comes from). Matthieu --- libswscale/arm/Makefile | 1 + libswscale/arm/output.S | 78 libswscale/arm/swscale.c | 7 + libswscale/utils.c | 3 +- 4 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 libswscale/arm/output.S [...] diff --git a/libswscale/arm/output.S b/libswscale/arm/output.S new file mode 100644 index 000..4437447 --- /dev/null +++ b/libswscale/arm/output.S @@ -0,0 +1,78 @@ [...] +function ff_yuv2planeX_8_neon, export=1 +push {r4-r12, lr} +vpush {q4-q7} +ldr r4, [sp, #104] @ dstW +ldr r5, [sp, #108] @ dither +ldr r6, [sp, #112] @ offset +vld1.8 {d0}, [r5] @ load 8x8-bit dither values +tst r6, #0 @ check offsetting which can be 0 or 3 only +beq 1f +vext.u8 d0, d0, d0, #3 @ honor offseting which can be 3 only +1: vmovl.u8q0, d0 @ extend dither to 16-bit +vshll.u16 q1, d0, #12@ extend dither to 32-bit with left shift by 12 (part 1) +vshll.u16 q2, d1, #12@ extend dither to 32-bit with left shift by 12 (part 2) +mov r7, #0 @ i = 0 +2: vmov.u8 q3, q1 @ initialize accumulator with dithering values (part 1) +vmov.u8 q4, q2 @ initialize accumulator with dithering values (part 2) +mov r8, r1 @ tmpFilterSize = filterSize +mov r9, r2 @ srcp +mov r10, r0@ filterp +3: ldr r11, [r9], #4 @ get pointer @ src[j] +ldr r12, [r9], #4 @ get pointer @ src[j+1] +add r11, r11, r7, lsl #1 @ &src[j][i] +add r12, r12, r7, lsl #1 @ &src[j+1][i] +vld1.16 {q5}, [r11]@ read 8x16-bit @ src[j ][i + {0..7}]: A,B,C,D,E,F,G,H +vld1.16 {q6}, [r12]@ read 8x16-bit @ src[j+1][i + {0..7}]: I,J,K,L,M,N,O,P +ldr r11, [r10], #4 @ read 2x16-bit coeffs (X, Y) at (filter[j], filter[j+1]) +vmov.16 q7, q5 @ copy 8x16-bit @ src[j ][i + {0..7}] for following inplace zip instruction +vmov.16 q8, q6 @ copy 8x16-bit @ src[j+1][i + {0..7}] for following inplace zip instruction +vzip.16 q7, q8 @ A,I,B,J,C,K,D,L,E,M,F,N,G,O,H,L nit: O,H,P -- Ben ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
On Mon, 11 Apr 2016 03:12:20 +0200 Michael Niedermayer wrote: > On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote: > > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer > > wrote: > > > > > The bits_per_raw_sample represents the number of bits of precission per > > > sample. > > > > > > The field is added at the logical place, not at the end as the code was > > > just > > > recently added > > > > > > This fixes the regression about loosing the audio sample precission > > > information > > > > > > The change in the fate test checksum un-does the change from the merge > > > > > > Signed-off-by: Michael Niedermayer > > > --- > > > libavcodec/avcodec.h | 17 + > > > libavcodec/utils.c |2 ++ > > > tests/ref/lavf/ffm |2 +- > > > 3 files changed, 20 insertions(+), 1 deletion(-) > > > > > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > > > index b3655c5..87739d7 100644 > > > --- a/libavcodec/avcodec.h > > > +++ b/libavcodec/avcodec.h > > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters { > > > */ > > > int64_t bit_rate; > > > > > > +/** > > > + * The number of bits per sample in the codedwords. > > > + * > > > + * This is basically the bitrate per sample > > > + * > > > + * This could be for example 4 for ADPCM > > > + * For PCM formats this matches bits_per_raw_sample > > > + * Can be 0 > > > + */ > > > int bits_per_coded_sample; > > > > > > /** > > > + * The number of bits of precission in the samples. > > > + * > > > + * For ADPCM this might be 12 or 16 or similar > > > + * Can be 0 > > > + */ > > > +int bits_per_raw_sample; > > > > > > > > Precision spelt wrong. Also needs more clarification as to the difference > > between the two > > on one side of a bitstream format there is raw pcm data (raw samples) > and on the other a compressed bitstream (aka coded samples) > these 2 where intended to specify the number of bits per sample in > these 2 representations > > i really dont know how to word this so that its clear and everyone > understands it > > > > - I have no idea what the difference is or why one would > > use bits_per_coded_sample for anything. > > bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm, > ...) in avi as a single byte extradata. so it must be transported from > the demuxer (avi headers) to the decoder and encoder to muxer > to make this worse, in some of these codecs it matches the > bits_per_raw_sample, in some it does not I still don't understand. bits_per_coded_sample is part of the AVCodecParameters struct. So what's the difference between per_coded and per_raw? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/qsv: export session management functionality
Signed-off-by: nablet developer --- libavcodec/qsv.c | 64 +-- libavcodec/qsv.h | 53 +++ libavcodec/qsv_api.c | 26 +++ libavcodec/qsv_internal.h | 15 +-- libavcodec/qsvdec.c | 13 +- libavcodec/qsvdec.h | 3 ++- libavcodec/qsvenc.c | 16 ++-- libavcodec/qsvenc.h | 2 +- 8 files changed, 125 insertions(+), 67 deletions(-) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 4c8e6b0..81d1f0c 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -18,14 +18,19 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include - #include #include #include "libavutil/avstring.h" #include "libavutil/error.h" +#include "libavutil/log.h" + +#include "qsv.h" + +#if CONFIG_QSV + +#include +#include #include "avcodec.h" #include "qsv_internal.h" @@ -51,7 +56,7 @@ int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id) return AVERROR(ENOSYS); } -int ff_qsv_error(int mfx_err) +int av_qsv_error(int mfx_err) { switch (mfx_err) { case MFX_ERR_NONE: @@ -85,7 +90,7 @@ int ff_qsv_error(int mfx_err) return AVERROR_UNKNOWN; } } -static int ff_qsv_set_display_handle(AVCodecContext *avctx, QSVSession *qs) +static int ff_qsv_set_display_handle(AVClass *avccl, struct AVQSVSession *qs) { // this code is only required for Linux. It searches for a valid // display handle. First in /dev/dri/renderD then in /dev/dri/card @@ -115,14 +120,14 @@ static int ff_qsv_set_display_handle(AVCodecContext *avctx, QSVSession *qs) fd = open(adapterpath, O_RDWR); if (fd < 0) { -av_log(avctx, AV_LOG_ERROR, +av_log(avccl, AV_LOG_ERROR, "mfx init: %s fd open failed\n", adapterpath); continue; } va_dpy = vaGetDisplayDRM(fd); if (!va_dpy) { -av_log(avctx, AV_LOG_ERROR, +av_log(avccl, AV_LOG_ERROR, "mfx init: %s vaGetDisplayDRM failed\n", adapterpath); close(fd); continue; @@ -130,22 +135,22 @@ static int ff_qsv_set_display_handle(AVCodecContext *avctx, QSVSession *qs) va_res = vaInitialize(va_dpy, &major_version, &minor_version); if (VA_STATUS_SUCCESS != va_res) { -av_log(avctx, AV_LOG_ERROR, +av_log(avccl, AV_LOG_ERROR, "mfx init: %s vaInitialize failed\n", adapterpath); close(fd); fd = -1; continue; } else { -av_log(avctx, AV_LOG_VERBOSE, +av_log(avccl, AV_LOG_VERBOSE, "mfx initialization: %s vaInitialize successful\n",adapterpath); qs->fd_display = fd; qs->va_display = va_dpy; ret = MFXVideoCORE_SetHandle(qs->session, (mfxHandleType)MFX_HANDLE_VA_DISPLAY, (mfxHDL)va_dpy); if (ret < 0) { -av_log(avctx, AV_LOG_ERROR, +av_log(avccl, AV_LOG_ERROR, "Error %d during set display handle\n", ret); -return ff_qsv_error(ret); +return av_qsv_error(ret); } break; } @@ -153,22 +158,7 @@ static int ff_qsv_set_display_handle(AVCodecContext *avctx, QSVSession *qs) #endif //AVCODEC_QSV_LINUX_SESSION_HANDLE return 0; } -/** - * @brief Initialize a MSDK session - * - * Media SDK is based on sessions, so this is the prerequisite - * initialization for HW acceleration. For Windows the session is - * complete and ready to use, for Linux a display handle is - * required. For releases of Media Server Studio >= 2015 R4 the - * render nodes interface is preferred (/dev/dri/renderD). - * Using Media Server Studio 2015 R4 or newer is recommended - * but the older /dev/dri/card interface is also searched - * for broader compatibility. - * - * @param avctxffmpeg metadata for this codec context - * @param session the MSDK session used - */ -int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs, +int av_qsv_init_session(AVClass *avccl, struct AVQSVSession *qs, const char *load_plugins) { mfxIMPL impl = MFX_IMPL_AUTO_ANY; @@ -179,11 +169,11 @@ int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs, ret = MFXInit(impl, &ver, &qs->session); if (ret < 0) { -av_log(avctx, AV_LOG_ERROR, "Error initializing an internal MFX session\n"); -return ff_qsv_error(ret); +av_log(avccl, AV_LOG_ERROR, "Error initializing an internal MFX session\n"); +return av_qsv_error(ret); } -ret = ff_qsv_set_display_handle(avctx, qs); +ret = ff_qsv_set_display_handle(avccl, qs); if (ret < 0) return ret; @@ -212,7 +202,7 @@ int ff_qsv_init_internal_session(AVCodecContext *avctx,
Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
On 4/11/16, wm4 wrote: > On Mon, 11 Apr 2016 03:12:20 +0200 > Michael Niedermayer wrote: > >> On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote: >> > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer >> > >> > wrote: >> > >> > > The bits_per_raw_sample represents the number of bits of precission >> > > per >> > > sample. >> > > >> > > The field is added at the logical place, not at the end as the code >> > > was >> > > just >> > > recently added >> > > >> > > This fixes the regression about loosing the audio sample precission >> > > information >> > > >> > > The change in the fate test checksum un-does the change from the merge >> > > >> > > Signed-off-by: Michael Niedermayer >> > > --- >> > > libavcodec/avcodec.h | 17 + >> > > libavcodec/utils.c |2 ++ >> > > tests/ref/lavf/ffm |2 +- >> > > 3 files changed, 20 insertions(+), 1 deletion(-) >> > > >> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h >> > > index b3655c5..87739d7 100644 >> > > --- a/libavcodec/avcodec.h >> > > +++ b/libavcodec/avcodec.h >> > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters { >> > > */ >> > > int64_t bit_rate; >> > > >> > > +/** >> > > + * The number of bits per sample in the codedwords. >> > > + * >> > > + * This is basically the bitrate per sample >> > > + * >> > > + * This could be for example 4 for ADPCM >> > > + * For PCM formats this matches bits_per_raw_sample >> > > + * Can be 0 >> > > + */ >> > > int bits_per_coded_sample; >> > > >> > > /** >> > > + * The number of bits of precission in the samples. >> > > + * >> > > + * For ADPCM this might be 12 or 16 or similar >> > > + * Can be 0 >> > > + */ >> > > +int bits_per_raw_sample; >> > > >> > > >> > Precision spelt wrong. Also needs more clarification as to the >> > difference >> > between the two >> >> on one side of a bitstream format there is raw pcm data (raw samples) >> and on the other a compressed bitstream (aka coded samples) >> these 2 where intended to specify the number of bits per sample in >> these 2 representations >> >> i really dont know how to word this so that its clear and everyone >> understands it >> >> >> > - I have no idea what the difference is or why one would >> > use bits_per_coded_sample for anything. >> >> bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm, >> ...) in avi as a single byte extradata. so it must be transported from >> the demuxer (avi headers) to the decoder and encoder to muxer >> to make this worse, in some of these codecs it matches the >> bits_per_raw_sample, in some it does not > > I still don't understand. bits_per_coded_sample is part of the > AVCodecParameters struct. So what's the difference between per_coded > and per_raw? bits per coded can be different from bits per raw sample. For ADPCM its usually 4 for codeded and 16 for raw. > > ___ > 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] lavfi/perspective: Add basic timeline editing.
On Sun, Apr 10, 2016 at 18:33:47 +0200, Thilo Borgmann wrote: > +It accepts the following values: > +@table @samp > +@item init > +only evaluate expressions once during the filter initialization or > +when a command is processed Please add (somewhere) that this is the default. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/cfhd: Don't decode coefficients if no end of header tag found. Fixes fuzzed files
On Sun, Apr 10, 2016 at 04:22:26PM +0100, Kieran Kunhya wrote: > --- > libavcodec/cfhd.c | 20 +++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c > index d369568..d82eab8 100644 > --- a/libavcodec/cfhd.c > +++ b/libavcodec/cfhd.c > @@ -137,11 +137,17 @@ static void vert_filter(int16_t *output, int > out_stride, int16_t *low, int low_s > static void free_buffers(AVCodecContext *avctx) > { > CFHDContext *s = avctx->priv_data; > -int i; > +int i, j; > > for (i = 0; i < 4; i++) { > av_freep(&s->plane[i].idwt_buf); > av_freep(&s->plane[i].idwt_tmp); > + > +for (j = 0; j < 9; j++) > +s->plane[i].subband[j] = NULL; > + > +for (j = 0; j < 8; j++) > +s->plane[i].l_h[j] = NULL; memset() or 8/9 could be replaced by FF_ARRAY_ELEMS to avoid litteraly duplicating the array size > } > s->a_height = 0; > s->a_width = 0; > @@ -450,6 +456,12 @@ static int cfhd_decode(AVCodecContext *avctx, void > *data, int *got_frame, > int lowpass_a_height = > s->plane[s->channel_num].band[0][0].a_height; > int lowpass_a_width = > s->plane[s->channel_num].band[0][0].a_width; > > +if (!got_buffer) { > +av_log(avctx, AV_LOG_ERROR, "No end of header tag found\n"); > +ret = AVERROR(EINVAL); > +goto end; > +} AVERROR_INVALIDDATA patch should be ok otherwise [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answer. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavfi/perspective: Add basic timeline editing.
Am 11.04.16 um 12:13 schrieb Moritz Barsnick: > On Sun, Apr 10, 2016 at 18:33:47 +0200, Thilo Borgmann wrote: >> +It accepts the following values: >> +@table @samp >> +@item init >> +only evaluate expressions once during the filter initialization or >> +when a command is processed > > Please add (somewhere) that this is the default. This is already in: [...] + +Default value is @samp{init}. @end table [...] -Thilo ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavfi/perspective: Add basic timeline editing.
On Mon, Apr 11, 2016 at 12:30:26 +0200, Thilo Borgmann wrote: > > Please add (somewhere) that this is the default. > This is already in: Oh darn, sorry. I apparently checked above and inline. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
On Mon, Apr 11, 2016 at 11:29 AM, wm4 wrote: > On Mon, 11 Apr 2016 03:12:20 +0200 > Michael Niedermayer wrote: > >> On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote: >> > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer >> > wrote: >> > >> > > The bits_per_raw_sample represents the number of bits of precission per >> > > sample. >> > > >> > > The field is added at the logical place, not at the end as the code was >> > > just >> > > recently added >> > > >> > > This fixes the regression about loosing the audio sample precission >> > > information >> > > >> > > The change in the fate test checksum un-does the change from the merge >> > > >> > > Signed-off-by: Michael Niedermayer >> > > --- >> > > libavcodec/avcodec.h | 17 + >> > > libavcodec/utils.c |2 ++ >> > > tests/ref/lavf/ffm |2 +- >> > > 3 files changed, 20 insertions(+), 1 deletion(-) >> > > >> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h >> > > index b3655c5..87739d7 100644 >> > > --- a/libavcodec/avcodec.h >> > > +++ b/libavcodec/avcodec.h >> > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters { >> > > */ >> > > int64_t bit_rate; >> > > >> > > +/** >> > > + * The number of bits per sample in the codedwords. >> > > + * >> > > + * This is basically the bitrate per sample >> > > + * >> > > + * This could be for example 4 for ADPCM >> > > + * For PCM formats this matches bits_per_raw_sample >> > > + * Can be 0 >> > > + */ >> > > int bits_per_coded_sample; >> > > >> > > /** >> > > + * The number of bits of precission in the samples. >> > > + * >> > > + * For ADPCM this might be 12 or 16 or similar >> > > + * Can be 0 >> > > + */ >> > > +int bits_per_raw_sample; >> > > >> > > >> > Precision spelt wrong. Also needs more clarification as to the difference >> > between the two >> >> on one side of a bitstream format there is raw pcm data (raw samples) >> and on the other a compressed bitstream (aka coded samples) >> these 2 where intended to specify the number of bits per sample in >> these 2 representations >> >> i really dont know how to word this so that its clear and everyone >> understands it >> >> >> > - I have no idea what the difference is or why one would >> > use bits_per_coded_sample for anything. >> >> bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm, >> ...) in avi as a single byte extradata. so it must be transported from >> the demuxer (avi headers) to the decoder and encoder to muxer >> to make this worse, in some of these codecs it matches the >> bits_per_raw_sample, in some it does not > > I still don't understand. bits_per_coded_sample is part of the > AVCodecParameters struct. So what's the difference between per_coded > and per_raw? > As I understand it, coded is mandatory for a bunch of formats to actually decode it, ie. the number of bits for one sample in the actual coded bitstream. And raw is just the bits in a decoded (raw) sample. Sometimes those two can be the same, especially if the codec in question doesnt have a concept of coded bits per sample. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCHv2] add signature filter for MPEG7 video signature
On Mon, Apr 11, 2016 at 04:25:28AM +0200, Gerion Entrup wrote: > On Donnerstag, 7. April 2016 00:35:25 CEST Michael Niedermayer wrote: > > On Wed, Mar 30, 2016 at 11:02:36PM +0200, Gerion Entrup wrote: > > > On Mittwoch, 30. März 2016 22:57:47 CEST Gerion Entrup wrote: > > > > Add improved patch. > > > > > > Rebased to master. > > > > > > > > Changelog |1 > > > configure |1 > > > doc/filters.texi | 70 +++ > > > libavfilter/Makefile |1 > > > libavfilter/allfilters.c |1 > > > libavfilter/signature.h| 554 ++ > > > libavfilter/signature_lookup.c | 550 ++ > > > libavfilter/version.h |4 > > > libavfilter/vf_signature.c | 741 > > > + > > > 9 files changed, 1921 insertions(+), 2 deletions(-) > > > 9192f27ded45c607996b4e266b6746f807c9a7fd > > > 0001-add-signature-filter-for-MPEG7-video-signature.patch > > > From 9646ed6f0cf78356cf2914a60705c98d8f21fe8a Mon Sep 17 00:00:00 2001 > > > From: Gerion Entrup > > > Date: Sun, 20 Mar 2016 11:10:31 +0100 > > > Subject: [PATCH] add signature filter for MPEG7 video signature > > > > > > This filter does not implement all features of MPEG7. Missing features: > > > - compression of signature files > > > - work only on (cropped) parts of the video > > > --- > > > Changelog | 1 + > > > configure | 1 + > > > doc/filters.texi | 70 > > > libavfilter/Makefile | 1 + > > > libavfilter/allfilters.c | 1 + > > > libavfilter/signature.h| 554 ++ > > > libavfilter/signature_lookup.c | 550 ++ > > > libavfilter/version.h | 4 +- > > > libavfilter/vf_signature.c | 741 > > > + > > > 9 files changed, 1921 insertions(+), 2 deletions(-) > > > create mode 100644 libavfilter/signature.h > > > create mode 100644 libavfilter/signature_lookup.c > > > create mode 100644 libavfilter/vf_signature.c > > > > > > diff --git a/Changelog b/Changelog > > > index 7b0187d..8a2b7fd 100644 > > > --- a/Changelog > > > +++ b/Changelog > > > @@ -18,6 +18,7 @@ version : > > > - coreimage filter (GPU based image filtering on OSX) > > > - libdcadec removed > > > - bitstream filter for extracting DTS core > > > +- MPEG-7 Video Signature filter > > > > > > version 3.0: > > > - Common Encryption (CENC) MP4 encoding and decoding support > > > diff --git a/configure b/configure > > > index e550547..fe29827 100755 > > > --- a/configure > > > +++ b/configure > > > @@ -2979,6 +2979,7 @@ showspectrum_filter_deps="avcodec" > > > showspectrum_filter_select="fft" > > > showspectrumpic_filter_deps="avcodec" > > > showspectrumpic_filter_select="fft" > > > +signature_filter_deps="gpl avcodec avformat" > > > smartblur_filter_deps="gpl swscale" > > > sofalizer_filter_deps="netcdf avcodec" > > > sofalizer_filter_select="fft" > > > diff --git a/doc/filters.texi b/doc/filters.texi > > > index 5d6cf52..a95f5a7 100644 > > > --- a/doc/filters.texi > > > +++ b/doc/filters.texi > > > @@ -11559,6 +11559,76 @@ saturation maximum: > > > %@{metadata:lavfi.signalstats.SATMAX@} > > > @end example > > > @end itemize > > > > > > +@anchor{signature} > > > +@section signature > > > + > > > +Calculates the MPEG-7 Video Signature. The filter could handle more than > > > one > > > +input. In this case the matching between the inputs could be calculated. > > > The > > > +filter passthrough the first input. The output is written in XML. > > > + > > > +It accepts the following options: > > > + > > > +@table @option > > > +@item mode > > > > > +Enable the calculation of the matching. The option value must be 0 (to > > > disable > > > +or 1 (to enable). Optionally you can set the mode to 2. Then the > > > detection ends, > > > +if the first matching sequence it reached. This should be slightly > > > faster. > > > +Per default the detection is disabled. > > > > these shuld probably support named identifers not (only) 0/1/2 > done it should use AV_OPT_TYPE_INT and AV_OPT_TYPE_CONST not a string > > > > > > > > + > > > +@item nb_inputs > > > +Set the number of inputs. The option value must be a non negative > > > interger. > > > +Default value is 1. > > > + > > > +@item filename > > > +Set the path to witch the output is written. If there is more than one > > > input, > > > +the path must be a prototype, i.e. must contain %d or %0nd (where n is a > > > positive > > > +integer), that will be replaced with the input number. If no filename is > > > +specified, no output will be written. This is the default. > > > + > > > > > +@item xml > > > +Choose the output format. If set to 1 the filter will write XML, if set > > > to 0 > > > +the filter will write binary output. The default is 0. >
Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
On Mon, 11 Apr 2016 12:52:51 +0200 Hendrik Leppkes wrote: > On Mon, Apr 11, 2016 at 11:29 AM, wm4 wrote: > > On Mon, 11 Apr 2016 03:12:20 +0200 > > Michael Niedermayer wrote: > > > >> On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote: > >> > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer > >> > wrote: > >> > > >> > > The bits_per_raw_sample represents the number of bits of precission per > >> > > sample. > >> > > > >> > > The field is added at the logical place, not at the end as the code was > >> > > just > >> > > recently added > >> > > > >> > > This fixes the regression about loosing the audio sample precission > >> > > information > >> > > > >> > > The change in the fate test checksum un-does the change from the merge > >> > > > >> > > Signed-off-by: Michael Niedermayer > >> > > --- > >> > > libavcodec/avcodec.h | 17 + > >> > > libavcodec/utils.c |2 ++ > >> > > tests/ref/lavf/ffm |2 +- > >> > > 3 files changed, 20 insertions(+), 1 deletion(-) > >> > > > >> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > >> > > index b3655c5..87739d7 100644 > >> > > --- a/libavcodec/avcodec.h > >> > > +++ b/libavcodec/avcodec.h > >> > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters { > >> > > */ > >> > > int64_t bit_rate; > >> > > > >> > > +/** > >> > > + * The number of bits per sample in the codedwords. > >> > > + * > >> > > + * This is basically the bitrate per sample > >> > > + * > >> > > + * This could be for example 4 for ADPCM > >> > > + * For PCM formats this matches bits_per_raw_sample > >> > > + * Can be 0 > >> > > + */ > >> > > int bits_per_coded_sample; > >> > > > >> > > /** > >> > > + * The number of bits of precission in the samples. > >> > > + * > >> > > + * For ADPCM this might be 12 or 16 or similar > >> > > + * Can be 0 > >> > > + */ > >> > > +int bits_per_raw_sample; > >> > > > >> > > > >> > Precision spelt wrong. Also needs more clarification as to the difference > >> > between the two > >> > >> on one side of a bitstream format there is raw pcm data (raw samples) > >> and on the other a compressed bitstream (aka coded samples) > >> these 2 where intended to specify the number of bits per sample in > >> these 2 representations > >> > >> i really dont know how to word this so that its clear and everyone > >> understands it > >> > >> > >> > - I have no idea what the difference is or why one would > >> > use bits_per_coded_sample for anything. > >> > >> bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm, > >> ...) in avi as a single byte extradata. so it must be transported from > >> the demuxer (avi headers) to the decoder and encoder to muxer > >> to make this worse, in some of these codecs it matches the > >> bits_per_raw_sample, in some it does not > > > > I still don't understand. bits_per_coded_sample is part of the > > AVCodecParameters struct. So what's the difference between per_coded > > and per_raw? > > > > As I understand it, coded is mandatory for a bunch of formats to > actually decode it, ie. the number of bits for one sample in the > actual coded bitstream. > And raw is just the bits in a decoded (raw) sample. Sometimes those > two can be the same, especially if the codec in question doesnt have a > concept of coded bits per sample. Then I don't understand why the field can't be reused. One thing that would have to be done though is copying the field to the AVCodecContext.bits_per_raw_sample field in decoder init or so. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
On Mon, Apr 11, 2016 at 1:17 PM, wm4 wrote: > On Mon, 11 Apr 2016 12:52:51 +0200 > Hendrik Leppkes wrote: > >> On Mon, Apr 11, 2016 at 11:29 AM, wm4 wrote: >> > On Mon, 11 Apr 2016 03:12:20 +0200 >> > Michael Niedermayer wrote: >> > >> >> On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote: >> >> > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer >> >> > >> >> > wrote: >> >> > >> >> > > The bits_per_raw_sample represents the number of bits of precission >> >> > > per >> >> > > sample. >> >> > > >> >> > > The field is added at the logical place, not at the end as the code >> >> > > was >> >> > > just >> >> > > recently added >> >> > > >> >> > > This fixes the regression about loosing the audio sample precission >> >> > > information >> >> > > >> >> > > The change in the fate test checksum un-does the change from the merge >> >> > > >> >> > > Signed-off-by: Michael Niedermayer >> >> > > --- >> >> > > libavcodec/avcodec.h | 17 + >> >> > > libavcodec/utils.c |2 ++ >> >> > > tests/ref/lavf/ffm |2 +- >> >> > > 3 files changed, 20 insertions(+), 1 deletion(-) >> >> > > >> >> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h >> >> > > index b3655c5..87739d7 100644 >> >> > > --- a/libavcodec/avcodec.h >> >> > > +++ b/libavcodec/avcodec.h >> >> > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters { >> >> > > */ >> >> > > int64_t bit_rate; >> >> > > >> >> > > +/** >> >> > > + * The number of bits per sample in the codedwords. >> >> > > + * >> >> > > + * This is basically the bitrate per sample >> >> > > + * >> >> > > + * This could be for example 4 for ADPCM >> >> > > + * For PCM formats this matches bits_per_raw_sample >> >> > > + * Can be 0 >> >> > > + */ >> >> > > int bits_per_coded_sample; >> >> > > >> >> > > /** >> >> > > + * The number of bits of precission in the samples. >> >> > > + * >> >> > > + * For ADPCM this might be 12 or 16 or similar >> >> > > + * Can be 0 >> >> > > + */ >> >> > > +int bits_per_raw_sample; >> >> > > >> >> > > >> >> > Precision spelt wrong. Also needs more clarification as to the >> >> > difference >> >> > between the two >> >> >> >> on one side of a bitstream format there is raw pcm data (raw samples) >> >> and on the other a compressed bitstream (aka coded samples) >> >> these 2 where intended to specify the number of bits per sample in >> >> these 2 representations >> >> >> >> i really dont know how to word this so that its clear and everyone >> >> understands it >> >> >> >> >> >> > - I have no idea what the difference is or why one would >> >> > use bits_per_coded_sample for anything. >> >> >> >> bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm, >> >> ...) in avi as a single byte extradata. so it must be transported from >> >> the demuxer (avi headers) to the decoder and encoder to muxer >> >> to make this worse, in some of these codecs it matches the >> >> bits_per_raw_sample, in some it does not >> > >> > I still don't understand. bits_per_coded_sample is part of the >> > AVCodecParameters struct. So what's the difference between per_coded >> > and per_raw? >> > >> >> As I understand it, coded is mandatory for a bunch of formats to >> actually decode it, ie. the number of bits for one sample in the >> actual coded bitstream. >> And raw is just the bits in a decoded (raw) sample. Sometimes those >> two can be the same, especially if the codec in question doesnt have a >> concept of coded bits per sample. > > Then I don't understand why the field can't be reused. > > One thing that would have to be done though is copying the field to the > AVCodecContext.bits_per_raw_sample field in decoder init or so. How can it be reused if you practically have two values? One for coded, and one for raw? One is mandatory for decoding, and one is good to know so you can interpret S32 sample format properly. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec: Add bits_per_raw_sample to AVCodecParameters
On Mon, 11 Apr 2016 13:26:54 +0200 Hendrik Leppkes wrote: > On Mon, Apr 11, 2016 at 1:17 PM, wm4 wrote: > > On Mon, 11 Apr 2016 12:52:51 +0200 > > Hendrik Leppkes wrote: > > > >> On Mon, Apr 11, 2016 at 11:29 AM, wm4 wrote: > >> > On Mon, 11 Apr 2016 03:12:20 +0200 > >> > Michael Niedermayer wrote: > >> > > >> >> On Sun, Apr 10, 2016 at 11:39:57PM +, Kieran Kunhya wrote: > >> >> > On Mon, 11 Apr 2016 at 00:33 Michael Niedermayer > >> >> > > >> >> > wrote: > >> >> > > >> >> > > The bits_per_raw_sample represents the number of bits of precission > >> >> > > per > >> >> > > sample. > >> >> > > > >> >> > > The field is added at the logical place, not at the end as the code > >> >> > > was > >> >> > > just > >> >> > > recently added > >> >> > > > >> >> > > This fixes the regression about loosing the audio sample precission > >> >> > > information > >> >> > > > >> >> > > The change in the fate test checksum un-does the change from the > >> >> > > merge > >> >> > > > >> >> > > Signed-off-by: Michael Niedermayer > >> >> > > --- > >> >> > > libavcodec/avcodec.h | 17 + > >> >> > > libavcodec/utils.c |2 ++ > >> >> > > tests/ref/lavf/ffm |2 +- > >> >> > > 3 files changed, 20 insertions(+), 1 deletion(-) > >> >> > > > >> >> > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > >> >> > > index b3655c5..87739d7 100644 > >> >> > > --- a/libavcodec/avcodec.h > >> >> > > +++ b/libavcodec/avcodec.h > >> >> > > @@ -3832,9 +3832,26 @@ typedef struct AVCodecParameters { > >> >> > > */ > >> >> > > int64_t bit_rate; > >> >> > > > >> >> > > +/** > >> >> > > + * The number of bits per sample in the codedwords. > >> >> > > + * > >> >> > > + * This is basically the bitrate per sample > >> >> > > + * > >> >> > > + * This could be for example 4 for ADPCM > >> >> > > + * For PCM formats this matches bits_per_raw_sample > >> >> > > + * Can be 0 > >> >> > > + */ > >> >> > > int bits_per_coded_sample; > >> >> > > > >> >> > > /** > >> >> > > + * The number of bits of precission in the samples. > >> >> > > + * > >> >> > > + * For ADPCM this might be 12 or 16 or similar > >> >> > > + * Can be 0 > >> >> > > + */ > >> >> > > +int bits_per_raw_sample; > >> >> > > > >> >> > > > >> >> > Precision spelt wrong. Also needs more clarification as to the > >> >> > difference > >> >> > between the two > >> >> > >> >> on one side of a bitstream format there is raw pcm data (raw samples) > >> >> and on the other a compressed bitstream (aka coded samples) > >> >> these 2 where intended to specify the number of bits per sample in > >> >> these 2 representations > >> >> > >> >> i really dont know how to word this so that its clear and everyone > >> >> understands it > >> >> > >> >> > >> >> > - I have no idea what the difference is or why one would > >> >> > use bits_per_coded_sample for anything. > >> >> > >> >> bits_per_coded_sample is used by several codecs (huffyuv, ima adpcm, > >> >> ...) in avi as a single byte extradata. so it must be transported from > >> >> the demuxer (avi headers) to the decoder and encoder to muxer > >> >> to make this worse, in some of these codecs it matches the > >> >> bits_per_raw_sample, in some it does not > >> > > >> > I still don't understand. bits_per_coded_sample is part of the > >> > AVCodecParameters struct. So what's the difference between per_coded > >> > and per_raw? > >> > > >> > >> As I understand it, coded is mandatory for a bunch of formats to > >> actually decode it, ie. the number of bits for one sample in the > >> actual coded bitstream. > >> And raw is just the bits in a decoded (raw) sample. Sometimes those > >> two can be the same, especially if the codec in question doesnt have a > >> concept of coded bits per sample. > > > > Then I don't understand why the field can't be reused. > > > > One thing that would have to be done though is copying the field to the > > AVCodecContext.bits_per_raw_sample field in decoder init or so. > > How can it be reused if you practically have two values? One for > coded, and one for raw? One is mandatory for decoding, and one is good > to know so you can interpret S32 sample format properly. It's only a problem if they collide, but maybe it's really better to have them separate to avoid a potential mess. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/qsv: export session management functionality
On Thu, Apr 07, 2016 at 11:44:20AM -0400, nablet developer wrote: > Signed-off-by: nablet developer > --- > libavcodec/qsv.c | 64 > +-- > libavcodec/qsv.h | 53 +++ > libavcodec/qsv_api.c | 26 +++ > libavcodec/qsv_internal.h | 15 +-- > libavcodec/qsvdec.c | 13 +- > libavcodec/qsvdec.h | 3 ++- > libavcodec/qsvenc.c | 16 ++-- > libavcodec/qsvenc.h | 2 +- > 8 files changed, 125 insertions(+), 67 deletions(-) commit message is missing the explanation for "why?" > > diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c > index 4c8e6b0..81d1f0c 100644 > --- a/libavcodec/qsv.c > +++ b/libavcodec/qsv.c > @@ -18,14 +18,19 @@ > * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 > USA > */ > > -#include > -#include > - > #include > #include > > #include "libavutil/avstring.h" > #include "libavutil/error.h" > +#include "libavutil/log.h" > + > +#include "qsv.h" > + > +#if CONFIG_QSV conditional compilation belongs in the Makefile [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Democracy is the form of government in which you can choose your dictator signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCHv2] add signature filter for MPEG7 video signature
On Montag, 11. April 2016 12:57:17 CEST Michael Niedermayer wrote: > On Mon, Apr 11, 2016 at 04:25:28AM +0200, Gerion Entrup wrote: > > On Donnerstag, 7. April 2016 00:35:25 CEST Michael Niedermayer wrote: > > > On Wed, Mar 30, 2016 at 11:02:36PM +0200, Gerion Entrup wrote: > > > > On Mittwoch, 30. März 2016 22:57:47 CEST Gerion Entrup wrote: > > > > > Add improved patch. > > > > > > > > Rebased to master. > > > > > > > > > > > Changelog |1 > > > > configure |1 > > > > doc/filters.texi | 70 +++ > > > > libavfilter/Makefile |1 > > > > libavfilter/allfilters.c |1 > > > > libavfilter/signature.h| 554 ++ > > > > libavfilter/signature_lookup.c | 550 ++ > > > > libavfilter/version.h |4 > > > > libavfilter/vf_signature.c | 741 > > > > + > > > > 9 files changed, 1921 insertions(+), 2 deletions(-) > > > > 9192f27ded45c607996b4e266b6746f807c9a7fd > > > > 0001-add-signature-filter-for-MPEG7-video-signature.patch > > > > From 9646ed6f0cf78356cf2914a60705c98d8f21fe8a Mon Sep 17 00:00:00 2001 > > > > From: Gerion Entrup > > > > Date: Sun, 20 Mar 2016 11:10:31 +0100 > > > > Subject: [PATCH] add signature filter for MPEG7 video signature > > > > > > > > This filter does not implement all features of MPEG7. Missing features: > > > > - compression of signature files > > > > - work only on (cropped) parts of the video > > > > --- > > > > Changelog | 1 + > > > > configure | 1 + > > > > doc/filters.texi | 70 > > > > libavfilter/Makefile | 1 + > > > > libavfilter/allfilters.c | 1 + > > > > libavfilter/signature.h| 554 ++ > > > > libavfilter/signature_lookup.c | 550 ++ > > > > libavfilter/version.h | 4 +- > > > > libavfilter/vf_signature.c | 741 > > > > + > > > > 9 files changed, 1921 insertions(+), 2 deletions(-) > > > > create mode 100644 libavfilter/signature.h > > > > create mode 100644 libavfilter/signature_lookup.c > > > > create mode 100644 libavfilter/vf_signature.c > > > > > > > > diff --git a/Changelog b/Changelog > > > > index 7b0187d..8a2b7fd 100644 > > > > --- a/Changelog > > > > +++ b/Changelog > > > > @@ -18,6 +18,7 @@ version : > > > > - coreimage filter (GPU based image filtering on OSX) > > > > - libdcadec removed > > > > - bitstream filter for extracting DTS core > > > > +- MPEG-7 Video Signature filter > > > > > > > > version 3.0: > > > > - Common Encryption (CENC) MP4 encoding and decoding support > > > > diff --git a/configure b/configure > > > > index e550547..fe29827 100755 > > > > --- a/configure > > > > +++ b/configure > > > > @@ -2979,6 +2979,7 @@ showspectrum_filter_deps="avcodec" > > > > showspectrum_filter_select="fft" > > > > showspectrumpic_filter_deps="avcodec" > > > > showspectrumpic_filter_select="fft" > > > > +signature_filter_deps="gpl avcodec avformat" > > > > smartblur_filter_deps="gpl swscale" > > > > sofalizer_filter_deps="netcdf avcodec" > > > > sofalizer_filter_select="fft" > > > > diff --git a/doc/filters.texi b/doc/filters.texi > > > > index 5d6cf52..a95f5a7 100644 > > > > --- a/doc/filters.texi > > > > +++ b/doc/filters.texi > > > > @@ -11559,6 +11559,76 @@ saturation maximum: > > > > %@{metadata:lavfi.signalstats.SATMAX@} > > > > @end example > > > > @end itemize > > > > > > > > +@anchor{signature} > > > > +@section signature > > > > + > > > > +Calculates the MPEG-7 Video Signature. The filter could handle more > > > > than one > > > > +input. In this case the matching between the inputs could be > > > > calculated. The > > > > +filter passthrough the first input. The output is written in XML. > > > > + > > > > +It accepts the following options: > > > > + > > > > +@table @option > > > > +@item mode > > > > > > > +Enable the calculation of the matching. The option value must be 0 (to > > > > disable > > > > +or 1 (to enable). Optionally you can set the mode to 2. Then the > > > > detection ends, > > > > +if the first matching sequence it reached. This should be slightly > > > > faster. > > > > +Per default the detection is disabled. > > > > > > these shuld probably support named identifers not (only) 0/1/2 > > done > > it should use AV_OPT_TYPE_INT and AV_OPT_TYPE_CONST not a string > > > > > > > > > > > > > > + > > > > +@item nb_inputs > > > > +Set the number of inputs. The option value must be a non negative > > > > interger. > > > > +Default value is 1. > > > > + > > > > +@item filename > > > > +Set the path to witch the output is written. If there is more than one > > > > input, > > > > +the path must be a prototype, i.e. must contain %d or %0nd (where n is > > > > a positive > > > > +integer), tha
Re: [FFmpeg-devel] [PATCH] avcodec/qsv: export session management functionality
>> >> diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c >> index 4c8e6b0..81d1f0c 100644 >> --- a/libavcodec/qsv.c >> +++ b/libavcodec/qsv.c >> @@ -18,14 +18,19 @@ >> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 >> USA >> */ >> >> -#include >> -#include >> - >> #include >> #include >> >> #include "libavutil/avstring.h" >> #include "libavutil/error.h" >> +#include "libavutil/log.h" >> + >> +#include "qsv.h" >> + >> +#if CONFIG_QSV > > conditional compilation belongs in the Makefile the idea here is to provide API functions for QuickSync initialisation/de-initializtion stuff. as I understand, ffmpeg API functions must be always present, regardless if QuickSync is available or not. if QuickSync is not available, then "dummy" functions are provides that do nothing and just return an error. so, do I right understand that correct approach for it is providing two files : one with actual implementation (qsv.c), and another with dummy implementation (e.g. qsv_dummy.c), and select one of them in makefile? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCHv2] add signature filter for MPEG7 video signature
On Mon, Apr 11, 2016 at 02:30:37PM +0200, Gerion Entrup wrote: > On Montag, 11. April 2016 12:57:17 CEST Michael Niedermayer wrote: > > On Mon, Apr 11, 2016 at 04:25:28AM +0200, Gerion Entrup wrote: > > > On Donnerstag, 7. April 2016 00:35:25 CEST Michael Niedermayer wrote: > > > > On Wed, Mar 30, 2016 at 11:02:36PM +0200, Gerion Entrup wrote: > > > > > On Mittwoch, 30. März 2016 22:57:47 CEST Gerion Entrup wrote: > > > > > > Add improved patch. > > > > > > > > > > Rebased to master. > > > > > > > > > > > > > > Changelog |1 > > > > > configure |1 > > > > > doc/filters.texi | 70 +++ > > > > > libavfilter/Makefile |1 > > > > > libavfilter/allfilters.c |1 > > > > > libavfilter/signature.h| 554 ++ > > > > > libavfilter/signature_lookup.c | 550 ++ > > > > > libavfilter/version.h |4 > > > > > libavfilter/vf_signature.c | 741 > > > > > + > > > > > 9 files changed, 1921 insertions(+), 2 deletions(-) > > > > > 9192f27ded45c607996b4e266b6746f807c9a7fd > > > > > 0001-add-signature-filter-for-MPEG7-video-signature.patch > > > > > From 9646ed6f0cf78356cf2914a60705c98d8f21fe8a Mon Sep 17 00:00:00 2001 > > > > > From: Gerion Entrup > > > > > Date: Sun, 20 Mar 2016 11:10:31 +0100 > > > > > Subject: [PATCH] add signature filter for MPEG7 video signature > > > > > > > > > > This filter does not implement all features of MPEG7. Missing > > > > > features: > > > > > - compression of signature files > > > > > - work only on (cropped) parts of the video > > > > > --- > > > > > Changelog | 1 + > > > > > configure | 1 + > > > > > doc/filters.texi | 70 > > > > > libavfilter/Makefile | 1 + > > > > > libavfilter/allfilters.c | 1 + > > > > > libavfilter/signature.h| 554 ++ > > > > > libavfilter/signature_lookup.c | 550 ++ > > > > > libavfilter/version.h | 4 +- > > > > > libavfilter/vf_signature.c | 741 > > > > > + > > > > > 9 files changed, 1921 insertions(+), 2 deletions(-) > > > > > create mode 100644 libavfilter/signature.h > > > > > create mode 100644 libavfilter/signature_lookup.c > > > > > create mode 100644 libavfilter/vf_signature.c > > > > > > > > > > diff --git a/Changelog b/Changelog > > > > > index 7b0187d..8a2b7fd 100644 > > > > > --- a/Changelog > > > > > +++ b/Changelog > > > > > @@ -18,6 +18,7 @@ version : > > > > > - coreimage filter (GPU based image filtering on OSX) > > > > > - libdcadec removed > > > > > - bitstream filter for extracting DTS core > > > > > +- MPEG-7 Video Signature filter > > > > > > > > > > version 3.0: > > > > > - Common Encryption (CENC) MP4 encoding and decoding support > > > > > diff --git a/configure b/configure > > > > > index e550547..fe29827 100755 > > > > > --- a/configure > > > > > +++ b/configure > > > > > @@ -2979,6 +2979,7 @@ showspectrum_filter_deps="avcodec" > > > > > showspectrum_filter_select="fft" > > > > > showspectrumpic_filter_deps="avcodec" > > > > > showspectrumpic_filter_select="fft" > > > > > +signature_filter_deps="gpl avcodec avformat" > > > > > smartblur_filter_deps="gpl swscale" > > > > > sofalizer_filter_deps="netcdf avcodec" > > > > > sofalizer_filter_select="fft" > > > > > diff --git a/doc/filters.texi b/doc/filters.texi > > > > > index 5d6cf52..a95f5a7 100644 > > > > > --- a/doc/filters.texi > > > > > +++ b/doc/filters.texi > > > > > @@ -11559,6 +11559,76 @@ saturation maximum: > > > > > %@{metadata:lavfi.signalstats.SATMAX@} > > > > > @end example > > > > > @end itemize > > > > > > > > > > +@anchor{signature} > > > > > +@section signature > > > > > + > > > > > +Calculates the MPEG-7 Video Signature. The filter could handle more > > > > > than one > > > > > +input. In this case the matching between the inputs could be > > > > > calculated. The > > > > > +filter passthrough the first input. The output is written in XML. > > > > > + > > > > > +It accepts the following options: > > > > > + > > > > > +@table @option > > > > > +@item mode > > > > > > > > > +Enable the calculation of the matching. The option value must be 0 > > > > > (to disable > > > > > +or 1 (to enable). Optionally you can set the mode to 2. Then the > > > > > detection ends, > > > > > +if the first matching sequence it reached. This should be slightly > > > > > faster. > > > > > +Per default the detection is disabled. > > > > > > > > these shuld probably support named identifers not (only) 0/1/2 > > > done > > > > it should use AV_OPT_TYPE_INT and AV_OPT_TYPE_CONST not a string > > > > > > > > > > > > > > > > > > > > + > > > > > +@item nb_inputs > > > > > +Set the number of inputs. The option value must be a non negativ
Re: [FFmpeg-devel] [PATCH] swscale/arm: add yuv2planeX_8_neon
On Mon, Apr 11, 2016 at 9:58 AM, Benoit Fouet wrote: > Hi, > > (again, thanks to both of you for documenting all this assembly /NEON code) > > On 09/04/2016 10:22, Matthieu Bouron wrote: > >> From: Matthieu Bouron >> >> --- >> >> Hello, >> >> The following patch add yuv2planeX_8_neon function for the arm platform. >> It is >> currently restricted to 8-bit per component sources until I fix fate >> issues >> with 10-bit sources (the dnxhd-*-10bit tests fail but I haven't figured >> out yet >> where it comes from). >> >> Matthieu >> >> --- >> libswscale/arm/Makefile | 1 + >> libswscale/arm/output.S | 78 >> >> libswscale/arm/swscale.c | 7 + >> libswscale/utils.c | 3 +- >> 4 files changed, 88 insertions(+), 1 deletion(-) >> create mode 100644 libswscale/arm/output.S >> >> [...] >> >> diff --git a/libswscale/arm/output.S b/libswscale/arm/output.S >> new file mode 100644 >> index 000..4437447 >> --- /dev/null >> +++ b/libswscale/arm/output.S >> @@ -0,0 +1,78 @@ >> > > [...] > > > +function ff_yuv2planeX_8_neon, export=1 >> +push {r4-r12, lr} >> +vpush {q4-q7} >> +ldr r4, [sp, #104] @ >> dstW >> +ldr r5, [sp, #108] @ >> dither >> +ldr r6, [sp, #112] @ >> offset >> +vld1.8 {d0}, [r5] @ >> load 8x8-bit dither values >> +tst r6, #0 @ >> check offsetting which can be 0 or 3 only >> +beq 1f >> +vext.u8 d0, d0, d0, #3 @ >> honor offseting which can be 3 only >> +1: vmovl.u8q0, d0 @ >> extend dither to 16-bit >> +vshll.u16 q1, d0, #12@ >> extend dither to 32-bit with left shift by 12 (part 1) >> +vshll.u16 q2, d1, #12@ >> extend dither to 32-bit with left shift by 12 (part 2) >> +mov r7, #0 @ >> i = 0 >> +2: vmov.u8 q3, q1 @ >> initialize accumulator with dithering values (part 1) >> +vmov.u8 q4, q2 @ >> initialize accumulator with dithering values (part 2) >> +mov r8, r1 @ >> tmpFilterSize = filterSize >> +mov r9, r2 @ >> srcp >> +mov r10, r0@ >> filterp >> +3: ldr r11, [r9], #4 @ >> get pointer @ src[j] >> +ldr r12, [r9], #4 @ >> get pointer @ src[j+1] >> +add r11, r11, r7, lsl #1 @ >> &src[j][i] >> +add r12, r12, r7, lsl #1 @ >> &src[j+1][i] >> +vld1.16 {q5}, [r11]@ >> read 8x16-bit @ src[j ][i + {0..7}]: A,B,C,D,E,F,G,H >> +vld1.16 {q6}, [r12]@ >> read 8x16-bit @ src[j+1][i + {0..7}]: I,J,K,L,M,N,O,P >> +ldr r11, [r10], #4 @ >> read 2x16-bit coeffs (X, Y) at (filter[j], filter[j+1]) >> +vmov.16 q7, q5 @ >> copy 8x16-bit @ src[j ][i + {0..7}] for following inplace zip instruction >> +vmov.16 q8, q6 @ >> copy 8x16-bit @ src[j+1][i + {0..7}] for following inplace zip instruction >> +vzip.16 q7, q8 @ >> A,I,B,J,C,K,D,L,E,M,F,N,G,O,H,L >> > > nit: O,H,P Fixed. Patch updated fixing fate issues with 10-bit sources (the code was not honoring offsetting: tst r6, #0 has been replaced with cmp r6, #0). If there is no objection, I will push the patch in the next hours. Thanks for the review, Matthieu From 95186d8459c1cb1615299edd6756292140f7fb68 Mon Sep 17 00:00:00 2001 From: Matthieu Bouron Date: Fri, 8 Apr 2016 15:32:24 + Subject: [PATCH] swscale/arm: add yuv2planeX_8_neon --- libswscale/arm/Makefile | 1 + libswscale/arm/output.S | 78 libswscale/arm/swscale.c | 7 + libswscale/utils.c | 3 +- 4 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 libswscale/arm/output.S diff --git a/libswscale/arm/Makefile b/libswscale/arm/Makefile index b8b0134..792da6b 100644 --- a/libswscale/arm/Makefile +++ b/libswscale/arm/Makefile @@ -4,4 +4,5 @@ OBJS+= arm/swscale.o\ NEON-OBJS += arm/rgb2yuv_n
Re: [FFmpeg-devel] [PATCH] sws/aarch64: add ff_yuv2planeX_8_neon
On Fri, Apr 08, 2016 at 05:46:13PM +0200, Clément Bœsch wrote: > On Fri, Apr 08, 2016 at 05:35:20PM +0200, Clément Bœsch wrote: > > From: Clément Bœsch > > > > --- > > libswscale/aarch64/Makefile | 1 + > > libswscale/aarch64/output.S | 66 > > > > libswscale/aarch64/swscale.c | 7 + > > libswscale/utils.c | 3 +- > > 4 files changed, 76 insertions(+), 1 deletion(-) > > create mode 100644 libswscale/aarch64/output.S > > > > ./ffmpeg -nostats -f lavfi -i > testsrc2=uhd4320:d=1,format=yuv420p,bench=start,scale=1024x1024,bench=stop -f > null - > > before: [bench @ 0x37706390] t:0.395010 avg:0.395212 max:0.397024 min:0.394710 > after: [bench @ 0x22101390] t:0.262277 avg:0.262560 max:0.264740 min:0.260876 > Applied. -- Clément B. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] Developer required for EBU-STL subtitle decoding support
Hello, I am looking for a time/money quote for someone to add EBU-STL subtitle decoding to ffmpeg. I saw the list of available developers on the ffmpeg website, but I wasn't sure who was best to contact. I work for the IFI Irish Film Archive, and we receive EBU-STL subtitles for AS-11 UKDPP broadcast deliverables. It would aid us greatly if we had a CLI option to make access copies with burnt in subtitles. Best, Kieran. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] avformat/framehash: Add more information to the output
On Sun, Apr 10, 2016 at 06:22:53PM -0300, James Almer wrote: > From: Michael Niedermayer > > Signed-off-by: Michael Niedermayer > Signed-off-by: James Almer > --- > The differences with Michael's original patch are that this one is updated > to use codecpar, and adds the new output as framehash version 2 but doesn't > make it the default until further additions are made, like porting framecrc's > extradata and sidedata checksum. > > libavformat/framecrcenc.c | 2 +- > libavformat/framehash.c | 17 - > libavformat/hashenc.c | 6 +++--- > libavformat/internal.h| 2 +- > 4 files changed, 21 insertions(+), 6 deletions(-) LGTM thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB You can kill me, but you cannot change the truth. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] swscale/arm: add yuv2planeX_8_neon
On Mon, Apr 11, 2016 at 4:18 PM, Matthieu Bouron wrote: > > > On Mon, Apr 11, 2016 at 9:58 AM, Benoit Fouet > wrote: > >> Hi, >> >> (again, thanks to both of you for documenting all this assembly /NEON >> code) >> >> On 09/04/2016 10:22, Matthieu Bouron wrote: >> >>> From: Matthieu Bouron >>> >>> --- >>> >>> Hello, >>> >>> The following patch add yuv2planeX_8_neon function for the arm >>> platform. It is >>> currently restricted to 8-bit per component sources until I fix fate >>> issues >>> with 10-bit sources (the dnxhd-*-10bit tests fail but I haven't figured >>> out yet >>> where it comes from). >>> >>> Matthieu >>> >>> --- >>> libswscale/arm/Makefile | 1 + >>> libswscale/arm/output.S | 78 >>> >>> libswscale/arm/swscale.c | 7 + >>> libswscale/utils.c | 3 +- >>> 4 files changed, 88 insertions(+), 1 deletion(-) >>> create mode 100644 libswscale/arm/output.S >>> >>> [...] >>> >>> diff --git a/libswscale/arm/output.S b/libswscale/arm/output.S >>> new file mode 100644 >>> index 000..4437447 >>> --- /dev/null >>> +++ b/libswscale/arm/output.S >>> @@ -0,0 +1,78 @@ >>> >> >> [...] >> >> >> +function ff_yuv2planeX_8_neon, export=1 >>> +push {r4-r12, lr} >>> +vpush {q4-q7} >>> +ldr r4, [sp, #104] >>> @ dstW >>> +ldr r5, [sp, #108] >>> @ dither >>> +ldr r6, [sp, #112] >>> @ offset >>> +vld1.8 {d0}, [r5] >>> @ load 8x8-bit dither values >>> +tst r6, #0 >>> @ check offsetting which can be 0 or 3 only >>> +beq 1f >>> +vext.u8 d0, d0, d0, #3 >>> @ honor offseting which can be 3 only >>> +1: vmovl.u8q0, d0 >>> @ extend dither to 16-bit >>> +vshll.u16 q1, d0, #12 >>> @ extend dither to 32-bit with left shift by 12 (part 1) >>> +vshll.u16 q2, d1, #12 >>> @ extend dither to 32-bit with left shift by 12 (part 2) >>> +mov r7, #0 >>> @ i = 0 >>> +2: vmov.u8 q3, q1 >>> @ initialize accumulator with dithering values (part 1) >>> +vmov.u8 q4, q2 >>> @ initialize accumulator with dithering values (part 2) >>> +mov r8, r1 >>> @ tmpFilterSize = filterSize >>> +mov r9, r2 >>> @ srcp >>> +mov r10, r0 >>> @ filterp >>> +3: ldr r11, [r9], #4 >>> @ get pointer @ src[j] >>> +ldr r12, [r9], #4 >>> @ get pointer @ src[j+1] >>> +add r11, r11, r7, lsl #1 >>> @ &src[j][i] >>> +add r12, r12, r7, lsl #1 >>> @ &src[j+1][i] >>> +vld1.16 {q5}, [r11] >>> @ read 8x16-bit @ src[j ][i + {0..7}]: A,B,C,D,E,F,G,H >>> +vld1.16 {q6}, [r12] >>> @ read 8x16-bit @ src[j+1][i + {0..7}]: I,J,K,L,M,N,O,P >>> +ldr r11, [r10], #4 >>> @ read 2x16-bit coeffs (X, Y) at (filter[j], filter[j+1]) >>> +vmov.16 q7, q5 >>> @ copy 8x16-bit @ src[j ][i + {0..7}] for following inplace zip >>> instruction >>> +vmov.16 q8, q6 >>> @ copy 8x16-bit @ src[j+1][i + {0..7}] for following inplace zip >>> instruction >>> +vzip.16 q7, q8 >>> @ A,I,B,J,C,K,D,L,E,M,F,N,G,O,H,L >>> >> >> nit: O,H,P > > > Fixed. > > Patch updated fixing fate issues with 10-bit sources (the code was not > honoring offsetting: tst r6, #0 has been replaced with cmp r6, #0). > If there is no objection, I will push the patch in the next hours. > Patch applied. Matthieu ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] Developer required for EBU-STL subtitle decoding support
On Mon, Apr 11, 2016 at 04:34:02PM +0100, Kieran O Leary wrote: > Hello, > > I am looking for a time/money quote for someone to add EBU-STL > subtitle decoding to ffmpeg. I saw the list of available developers on > the ffmpeg website, but I wasn't sure who was best to contact. > > I work for the IFI Irish Film Archive, and we receive EBU-STL > subtitles for AS-11 UKDPP broadcast deliverables. It would aid us > greatly if we had a CLI option to make access copies with burnt in > subtitles. While I'm not available, anyone answering will probably need more information, like the spec (which I think is here: https://tech.ebu.ch/docs/tech/tech3264.pdf) but also what features you need immediately (the teletext and boxing support for example I would guess might take as much effort as the whole rest of the format). Also, whether you find a suitable offer or not, it would be of great help if you could make samples available (if you can find any where you can get the ok to make available publicly). With such special formats regression testing is fairly important, but cannot be done without public samples. Good luck :) , Reimar Döffinger ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Implement hdcd filtering
Benjamin St gmail.com> writes: > Attachment (hdcd.wav): audio/x-wav, 1584 KiB Please compress the input sample with a lossless audio encoder. Note that you also have to send a patch that adds the new license to allow fate to pass. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] doc/filters: document testsrc2 source filter
On Sun, 10 Apr 2016 20:27:07 +0200, Paul B Mahol wrote: > > LGTM Pushed. Thanks. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] libavcodec/exr : add support for datawindow who exceed display window
2016-04-10 19:50 GMT+02:00 Martin Vignali : > > > 2016-04-10 19:23 GMT+02:00 Paul B Mahol : > >> On 4/10/16, Martin Vignali wrote: >> > 2016-04-10 18:12 GMT+02:00 Paul B Mahol : >> > >> >> On 4/10/16, Martin Vignali wrote: >> >> > 2016-04-09 6:54 GMT+02:00 Paul B Mahol : >> >> > >> >> >> On 4/9/16, Martin Vignali wrote: >> >> >> > 2016-04-08 22:11 GMT+02:00 Paul B Mahol : >> >> >> > >> >> >> >> On 4/7/16, Martin Vignali wrote: >> >> >> >> > Hello, >> >> >> >> > >> >> >> >> > in attach, a patch with some modifications in size/data window >> >> >> >> management, >> >> >> >> > in order to manage >> >> >> >> > negative datawindow/display window, and datawindow who can >> exceed >> >> >> >> > display >> >> >> >> > window >> >> >> >> > >> >> >> >> > Size of the picture is now set from min and max value of the >> >> display >> >> >> >> window >> >> >> >> > (before the patch, xmin, ymin of the display window are ignored >> >> (and >> >> >> >> assume >> >> >> >> > to be 0)) >> >> >> >> > >> >> >> >> > With the previous patch (fix channel detection), official >> samples >> >> >> >> > ./scanline/Blobbies.exr >> >> >> >> > can now be correctly decode. >> >> >> >> > >> >> >> >> > >> >> >> >> > DataWindow bigger than display window is a feature of the >> >> >> >> > openExr. >> >> >> >> > It can be use in some softwares, (for example to improve blur >> >> >> >> > quality) >> >> >> >> > Following the official documentation, for display, we need to >> use >> >> the >> >> >> >> > display window only. >> >> >> >> > >> >> >> >> > >> >> >> >> > In this patch, xmin, xmax, ymin, ymax, are now int32_t instead >> of >> >> >> >> uint32_t, >> >> >> >> > because these values can be negative. (See officiel sample >> >> >> >> ./Displaywindow >> >> >> >> > >> >> >> >> >> >> >> >> >> >> http://download.savannah.nongnu.org/releases/openexr/openexr-images-1.7.0.tar.gz >> >> >> >> > ) >> >> >> >> > >> >> >> >> > Comments welcome >> >> >> >> >> >> >> >> Crashes with: >> >> >> >> >> >> >> >> openexr-images-1.7.0/DisplayWindow/t03.exr >> >> >> >> >> >> >> >> Strange, this sample didn't crash for me (Clang, OS 10.9). Decode >> >> it's >> >> >> > still not good after the patch but it's piz compression. >> >> >> > Can you tell me, what configure line, you use ? >> >> >> >> >> >> >> >> >> I still can't reproduce the crash for this sample. >> >> > Is it the only sample who crash in openexr-images-1.7.0/DisplayWindow >> >> > for >> >> > you ? >> >> >> >> No, also t05.exr. >> >> >> >> >> > Can you test with the new version of the patch in attach ? >> >> This one doesn't crash. >> >> >> Thanks for testing. > > I remove the log line, in the patch in attach. > I also add a test for wrong display window in decode_header func. > > > The last patch seems to have a trouble for some tile sample where datawindow exceed display window (i think for scanline the last patch is correct). I work on it, and i will send a new patch soon. Martin Jokyo Images ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] ffplay: convert to codecpar
Signed-off-by: Marton Balint --- ffplay.c | 56 ++-- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/ffplay.c b/ffplay.c index 123f4bc..804bcbc 100644 --- a/ffplay.c +++ b/ffplay.c @@ -641,6 +641,7 @@ static int decoder_decode_frame(Decoder *d, AVFrame *frame, AVSubtitle *sub) { static void decoder_destroy(Decoder *d) { av_packet_unref(&d->pkt); +avcodec_free_context(&d->avctx); } static void frame_queue_unref_item(Frame *vp) @@ -1139,13 +1140,13 @@ static void video_audio_display(VideoState *s) static void stream_component_close(VideoState *is, int stream_index) { AVFormatContext *ic = is->ic; -AVCodecContext *avctx; +AVCodecParameters *codecpar; if (stream_index < 0 || stream_index >= ic->nb_streams) return; -avctx = ic->streams[stream_index]->codec; +codecpar = ic->streams[stream_index]->codecpar; -switch (avctx->codec_type) { +switch (codecpar->codec_type) { case AVMEDIA_TYPE_AUDIO: decoder_abort(&is->auddec, &is->sampq); SDL_CloseAudio(); @@ -1175,8 +1176,7 @@ static void stream_component_close(VideoState *is, int stream_index) } ic->streams[stream_index]->discard = AVDISCARD_ALL; -avcodec_close(avctx); -switch (avctx->codec_type) { +switch (codecpar->codec_type) { case AVMEDIA_TYPE_AUDIO: is->audio_st = NULL; is->audio_stream = -1; @@ -1652,8 +1652,8 @@ display: aqsize / 1024, vqsize / 1024, sqsize, - is->video_st ? is->video_st->codec->pts_correction_num_faulty_dts : 0, - is->video_st ? is->video_st->codec->pts_correction_num_faulty_pts : 0); + is->video_st ? is->viddec.avctx->pts_correction_num_faulty_dts : 0, + is->video_st ? is->viddec.avctx->pts_correction_num_faulty_pts : 0); fflush(stdout); last_time = cur_time; } @@ -1905,7 +1905,7 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c char buffersrc_args[256]; int ret; AVFilterContext *filt_src = NULL, *filt_out = NULL, *last_filter = NULL; -AVCodecContext *codec = is->video_st->codec; +AVCodecParameters *codecpar = is->video_st->codecpar; AVRational fr = av_guess_frame_rate(is->ic, is->video_st, NULL); AVDictionaryEntry *e = NULL; @@ -1924,7 +1924,7 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", frame->width, frame->height, frame->format, is->video_st->time_base.num, is->video_st->time_base.den, - codec->sample_aspect_ratio.num, FFMAX(codec->sample_aspect_ratio.den, 1)); + codecpar->sample_aspect_ratio.num, FFMAX(codecpar->sample_aspect_ratio.den, 1)); if (fr.num && fr.den) av_strlcatf(buffersrc_args, sizeof(buffersrc_args), ":frame_rate=%d/%d", fr.num, fr.den); @@ -2651,7 +2651,7 @@ static int stream_component_open(VideoState *is, int stream_index) AVCodecContext *avctx; AVCodec *codec; const char *forced_codec_name = NULL; -AVDictionary *opts; +AVDictionary *opts = NULL; AVDictionaryEntry *t = NULL; int sample_rate, nb_channels; int64_t channel_layout; @@ -2660,7 +2660,15 @@ static int stream_component_open(VideoState *is, int stream_index) if (stream_index < 0 || stream_index >= ic->nb_streams) return -1; -avctx = ic->streams[stream_index]->codec; + +avctx = avcodec_alloc_context3(NULL); +if (!avctx) +return AVERROR(ENOMEM); + +ret = avcodec_parameters_to_context(avctx, ic->streams[stream_index]->codecpar); +if (ret < 0) +goto fail; +av_codec_set_pkt_timebase(avctx, ic->streams[stream_index]->time_base); codec = avcodec_find_decoder(avctx->codec_id); @@ -2676,7 +2684,8 @@ static int stream_component_open(VideoState *is, int stream_index) "No codec could be found with name '%s'\n", forced_codec_name); else av_log(NULL, AV_LOG_WARNING, "No codec could be found with id %d\n", avctx->codec_id); -return -1; +ret = AVERROR(EINVAL); +goto fail; } avctx->codec_id = codec->id; @@ -2762,7 +2771,7 @@ static int stream_component_open(VideoState *is, int stream_index) is->auddec.start_pts_tb = is->audio_st->time_base; } if ((ret = decoder_start(&is->auddec, audio_thread, is)) < 0) -goto fail; +goto out; SDL_PauseAudio(0); break; case AVMEDIA_TYPE_VIDEO: @@ -2774,7 +2783,7 @@ static int stream_component_open(VideoState *is, int stream_index) decoder_init(&is->viddec, avctx, &is->videoq, is->conti
[FFmpeg-devel] [PATCH 2/3] doc/examples: Enchance argument parsing in fffuzz
Now any combination of arguments is allowed. --- doc/examples/fffuzz.c | 91 +++ 1 file changed, 78 insertions(+), 13 deletions(-) diff --git a/doc/examples/fffuzz.c b/doc/examples/fffuzz.c index e59066d..23cdda1 100644 --- a/doc/examples/fffuzz.c +++ b/doc/examples/fffuzz.c @@ -28,6 +28,7 @@ * This can be useful for fuzz testing. * @example ddcf.c */ +#include #include #include @@ -210,27 +211,91 @@ static int open_codec_context(AVCodecContext **dec_ctx, AVFormatContext *fmt_ctx return ret; } +void exit_with_usage_msg(char* prog_name) +{ +fprintf(stderr, "\n" +"usage: %s [options] input_file output_file\n\n" +"API example program to show how to read frames from an input file.\n" +"This program reads frames from a file, decodes them, and writes decoded\n" +"frames to a rawvideo/rawaudio file named output_file.\n" +"Optionally format and codec can be specified.\n\n" +"Options:\n" +"-f format\n" +"\tSets the decode format\n" +"-c codec\n" +"\tSets the decode codec\n\n", prog_name); +exit(1); +} + int main (int argc, char **argv) { -int ret = 0; +int ret = 0, current_arg; +char option; const char *src_filename = NULL; const char *dst_filename = NULL; char* format = NULL; char* codec = NULL; +char* arg= NULL; +char* parameter = NULL; -if (argc != 5 && argc != 3) { -fprintf(stderr, "usage: %s input_file output_file [format codec]\n" -"API example program to show how to read frames from an input file.\n" -"This program reads frames from a file, decodes them, and writes decoded\n" -"frames to a rawvideo/rawaudio file named output_file.\n" -"Optionally format and codec can be specified.\n\n", argv[0]); -exit(1); +if (argc < 3) { +fprintf(stderr, +"%s: No input_file and/or output_file found\n", argv[0]); +exit_with_usage_msg(argv[0]); } -src_filename = argv[1]; -dst_filename = argv[2]; -if (argc == 5) { -format = argv[3]; -codec = argv[4]; + +/* parse all arguments passed to program */ +for (current_arg = 1; current_arg < argc; current_arg++) { +arg = argv[current_arg]; +if (arg[0] == '-') { //parse an option +if (strlen(arg) != 2) { +fprintf(stderr, "%s: Invalid option %s\n", argv[0], arg); +exit_with_usage_msg(argv[0]); +} +/* make sure we will be able to see input_file */ +/* and output_file after option is parsed */ +if (current_arg + 3 >= argc) { +fprintf(stderr, +"%s: No input_file and/or output_file found\n", argv[0]); +exit_with_usage_msg(argv[0]); +} +option = arg[1]; +current_arg++; +parameter = argv[current_arg]; +/* parameter can't be an option */ +if (parameter[0] == '-') { +fprintf(stderr, +"%s: No parameter for -%c option found\n", +argv[0], option); +exit_with_usage_msg(argv[0]); +} +switch (option) { +case 'f': +format = parameter; +break; +case 'c': +codec = parameter; +break; +default: +fprintf(stderr, "%s: Invalid option %s\n", argv[0], arg); +exit_with_usage_msg(argv[0]); +} +} else { //all options set, parse input_file and output_file +if (current_arg + 1 != argc - 1) { +fprintf(stderr, +"%s: input_file and output_file should be passed as final arguments\n", +argv[0]); +exit_with_usage_msg(argv[0]); +} +src_filename = argv[current_arg]; +current_arg++; +dst_filename = argv[current_arg]; +if (dst_filename[0] == '-') { +fprintf(stderr, +"%s: No output_file found\n", argv[0]); +exit_with_usage_msg(argv[0]); +} +} } /* log all debug messages */ -- 2.6.4 (Apple Git-63) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/3] doc/examples: Add thread_type flag to fffuzz
--- doc/examples/fffuzz.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/examples/fffuzz.c b/doc/examples/fffuzz.c index 23cdda1..293c178 100644 --- a/doc/examples/fffuzz.c +++ b/doc/examples/fffuzz.c @@ -223,7 +223,9 @@ void exit_with_usage_msg(char* prog_name) "-f format\n" "\tSets the decode format\n" "-c codec\n" -"\tSets the decode codec\n\n", prog_name); +"\tSets the decode codec\n" +"-t slice|frame\n" +"\tSets threading mode (slice or frame threads)\n\n", prog_name); exit(1); } @@ -235,8 +237,11 @@ int main (int argc, char **argv) const char *dst_filename = NULL; char* format = NULL; char* codec = NULL; +char* thread_mode= NULL; char* arg= NULL; char* parameter = NULL; +char frame_threads[] = "frame"; +char slice_threads[] = "slice"; if (argc < 3) { fprintf(stderr, @@ -276,6 +281,9 @@ int main (int argc, char **argv) case 'c': codec = parameter; break; +case 't': +thread_mode = parameter; +break; default: fprintf(stderr, "%s: Invalid option %s\n", argv[0], arg); exit_with_usage_msg(argv[0]); @@ -298,6 +306,16 @@ int main (int argc, char **argv) } } +/* if thread_mode was passed, verify its value */ +if (thread_mode != NULL) { +if (strcmp(thread_mode, frame_threads) && strcmp(thread_mode, slice_threads)) { +fprintf(stderr, +"%s: wrong thread mode passed using -t flag\n", +argv[0]); +exit_with_usage_msg(argv[0]); +} +} + /* log all debug messages */ av_log_set_level(AV_LOG_DEBUG); @@ -336,6 +354,12 @@ int main (int argc, char **argv) ret = 1; goto end; } +/* set threading mode */ +if (av_dict_set(&opts, "thread_type", thread_mode, 0) < 0) { +fprintf(stderr, "Could not set thread_type.\n"); +ret = 1; +goto end; +} if (format) { fmt = av_find_input_format(format); -- 2.6.4 (Apple Git-63) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/3] doc/examples: Add fffuzz example
There are some afl specific macros inside, to make the example usable with afl fuzzer. --- doc/examples/fffuzz.c | 373 ++ 1 file changed, 373 insertions(+) create mode 100644 doc/examples/fffuzz.c diff --git a/doc/examples/fffuzz.c b/doc/examples/fffuzz.c new file mode 100644 index 000..e59066d --- /dev/null +++ b/doc/examples/fffuzz.c @@ -0,0 +1,373 @@ +/* + * Copyright (c) 2012 Stefano Sabatini + * Copyright (c) 2015 Andreas Cadhalpun + * + * 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. + */ + +/** + * @file + * Demuxing and decoding (a codec/format combination) example. + * + * This can be useful for fuzz testing. + * @example ddcf.c + */ + +#include +#include +#include +#include +#include + +/* needed for decoding video */ +static int width, height; +static enum AVPixelFormat pix_fmt; +static uint8_t *video_dst_data[4] = {NULL}; +static int video_dst_linesize[4]; +static int video_dst_bufsize; + +static int decode_packet(AVCodecContext *dec_ctx, FILE *dst_file, AVFrame *frame, int *got_frame, int *frame_count, AVPacket *pkt) +{ +int ret = -1; +*got_frame = 0; +AVSubtitle sub; +unsigned i, j, k, l; + +if (dec_ctx->codec_type == AVMEDIA_TYPE_VIDEO) { +ret = 0; +/* decode video frame */ +ret = avcodec_decode_video2(dec_ctx, frame, got_frame, pkt); +if (ret < 0) { +fprintf(stderr, "Error decoding video frame (%s)\n", av_err2str(ret)); +return ret; +} + +if (*got_frame) { + +if (frame->width != width || frame->height != height || +frame->format != pix_fmt) { +fprintf(stderr, "Error: input video width/height/format changed:\n" +"old: width = %d, height = %d, format = %s\n" +"new: width = %d, height = %d, format = %s\n", +width, height, av_get_pix_fmt_name(pix_fmt), +dec_ctx->width, dec_ctx->height, +av_get_pix_fmt_name(dec_ctx->pix_fmt)); +return -1; +} + +printf("video_frame n:%d coded_n:%d pts:%s\n", + *frame_count, frame->coded_picture_number, + av_ts2timestr(frame->pts, &dec_ctx->time_base)); + +/* copy decoded frame to destination buffer: + * this is required since rawvideo expects non aligned data */ +av_image_copy(video_dst_data, video_dst_linesize, + (const uint8_t **)(frame->data), frame->linesize, + pix_fmt, width, height); +*frame_count += 1; + +/* write to rawvideo file */ +fwrite(video_dst_data[0], 1, video_dst_bufsize, dst_file); +} +} else if (dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { +ret = 0; +/* decode audio frame */ +ret = avcodec_decode_audio4(dec_ctx, frame, got_frame, pkt); +if (ret < 0) { +fprintf(stderr, "Error decoding audio frame (%s)\n", av_err2str(ret)); +return ret; +} +/* Some audio decoders decode only part of the packet, and have to be + * called again with the remainder of the packet data. + * Sample: fate-suite/lossless-audio/luckynight-partial.shn + * Also, some decoders might over-read the packet. */ +ret = FFMIN(ret, pkt->size); + +if (*got_frame) { +size_t unpadded_linesize = frame->nb_samples * av_get_bytes_per_sample(frame->format); +printf("audio_frame n:%d nb_samples:%d pts:%s\n", + *frame_count, frame->nb_samples, + av_ts2timestr(frame->pts, &dec_ctx->time_base)); +*frame_count += 1; + +/* Write the raw audio data samples of the first plane. This works + * fine for packed formats (e.g. AV_SAMPLE_FMT_S16). Howev
Re: [FFmpeg-devel] [PATCH] ffplay: convert to codecpar
On Mon, Apr 11, 2016 at 11:11:00PM +0200, Marton Balint wrote: > Signed-off-by: Marton Balint > --- > ffplay.c | 56 ++-- > 1 file changed, 34 insertions(+), 22 deletions(-) seems working, also no new issue in valgrind in my quick test there are some sdl/x11 related leaks though but they are not new ==16410== Thread 1: ==16410== 1 bytes in 1 blocks are definitely lost in loss record 1 of 352 ==16410==at 0x4C2C66F: malloc (vg_replace_malloc.c:270) ==16410==by 0x52977CD: _XlcDefaultMapModifiers (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x5297BC5: XSetLocaleModifiers (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x6B4987B: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B4A4A2: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B3AAEC: SDL_VideoInit (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B111AB: SDL_InitSubSystem (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B1121B: SDL_Init (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x49F9A8: ??? (in /home/michael/ffmpeg-git/ffmpeg/ffplay) ==16410==by 0xFFF676C: (below main) (libc-start.c:226) ==16410== ==16410== 14 bytes in 2 blocks are definitely lost in loss record 9 of 352 ==16410==at 0x4C2C66F: malloc (vg_replace_malloc.c:270) ==16410==by 0x1005CDA1: strdup (strdup.c:43) ==16410==by 0x52A6A0D: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x52A7923: _XimSetICValueData (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x52A2FDE: _XimLocalCreateIC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x5288A92: XCreateIC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x6B49556: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B4A4A2: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B3AAEC: SDL_VideoInit (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B111AB: SDL_InitSubSystem (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B1121B: SDL_Init (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x49F9A8: ??? (in /home/michael/ffmpeg-git/ffmpeg/ffplay) ==16410== ==16410== 192 (16 direct, 176 indirect) bytes in 1 blocks are definitely lost in loss record 276 of 352 ==16410==at 0x4C2C861: realloc (vg_replace_malloc.c:662) ==16410==by 0x528E42B: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x528E8BD: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x528FE90: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x5290665: _XlcCreateLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x52ADB4F: _XlcDefaultLoader (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x5297A01: _XOpenLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x5297B47: _XlcCurrentLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x5297B9D: XSetLocaleModifiers (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x6B4982B: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B4A4A2: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B3AAEC: SDL_VideoInit (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410== ==16410== 1,688 (136 direct, 1,552 indirect) bytes in 1 blocks are definitely lost in loss record 329 of 352 ==16410==at 0x4C2C861: realloc (vg_replace_malloc.c:662) ==16410==by 0x528E42B: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x528E8BD: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x528FE90: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x5290665: _XlcCreateLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x52B1A0F: _XlcUtf8Loader (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x5297A01: _XOpenLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x5297B47: _XlcCurrentLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x5297B9D: XSetLocaleModifiers (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0) ==16410==by 0x6B4987B: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B4A4A2: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B3AAEC: SDL_VideoInit (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410== ==16410== 1,866,240 bytes in 3 blocks are definitely lost in loss record 352 of 352 ==16410==at 0x4C2C66F: malloc (vg_replace_malloc.c:270) ==16410==by 0x6B4B9BF: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x6B3BEE6: SDL_CreateYUVOverlay (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.3) ==16410==by 0x4A103D: ??? (in /home/michael/ffmpeg-git/ff
Re: [FFmpeg-devel] [Patch][GSoC] Motion Estimation filter
On Sat, Apr 09, 2016 at 11:50:07PM +, Davinder Singh wrote: > ok, applied the changes. with new closest vector condition. will add > threshold now. it may be beyond the scope of this qualification task but to get good quality vectors the surrounding vectors will have to be considered in choosing each vector [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The bravest are surely those who have the clearest vision of what is before them, glory and danger alike, and yet notwithstanding go out to meet it. -- Thucydides signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] lavf/matroskaenc.c: use metadata key/value to set mastering metadata
We've added support for the correct elements in matroskadec and matroskaenc: https://github.com/FFmpeg/FFmpeg/commit/e7e5c5e6c4d7e85531bd90a84cbd35c3d84f0453 https://github.com/FFmpeg/FFmpeg/commit/bbda13a7713b8ae8c725c5bb774ac45d614b34eb The intention of this patch is to expose a way to set this data via the command-line, but in hindsight I see that wasn't clear in my description. I'm proposing using the key/value pair on command line to set the values, e.g., -metadata:s:v:0 master-display="G(13248,34499)B(7500,2999)R(34000,15999)WP(15700,17550)L(1000,100)" The value is not written in the matroska tags, only to the colour elements. I'm happy to consider alternatives, but wasn't sure there was a precedent for instantiating the packet side data from command line. On Sun, Apr 3, 2016 at 5:13 PM, Dave Rice wrote: > >> On Apr 3, 2016, at 6:38 PM, Neil Birkbeck wrote: >> >> Use "master_display" key/value pair to specify mastering metadata in a >> similar formatting as accepted by libx265 (unless there is some other >> generic way to add side data to a stream from command line). >> Currently, the packet side data propagates from an input file to >> output file if it is transmuxed (mkv -> mkv). Perhaps we want to also >> use this same metadata key in matroskadec to also allow for the >> metadata to propagate during transcoding. >> <0001-lavf-matroskaenc.c-use-metadata-key-value-to-set-mas.patch>___ > > Wouldn’t it reduce confusion if the proposed MasteringMetadata elements[1] > were used rather than rather than storing the same data as Matroska tags? > > Dave Rice > > [1] as discussed on the CELLAR list > https://mailarchive.ietf.org/arch/msg/cellar/hIKLhMdgTMTEwUTeA4ct38h0tmE > ___ > 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] [WIP] Updated MLP encoder - Qualification Task (TrueHD)
On Sun, Apr 10, 2016 at 04:57:33AM +0530, Jai Luthra wrote: > Hi, > > I've updated the patch (attached): > * Fixed the build warnings > * Applied atomnuker's changes to update the mlp_encode_frame function > * Added AudioFrameQueue as suggested by atomnuker > > The encoder now works without any errors to silence and can encode > stereo files with a valid bitstream. > > I guess the qualification task is now complete (except validating > bitstream without using ffmpeg) > > I've noticed that it doesn't generate valid bitstream for mono files. > ffplay's output is full of: > [mlp @ 0x7fd2b4001980] No restart header present in substream 0. > [mlp @ 0x7fd2b4001980] No samples to output. > [mlp @ 0x7fd2b4001980] Max channel must be equal max matrix channel. > > I'll find a fix for this asap, and might need some help from the mentor if I > get stuck. if you havnt found the issue yet, the slow but foolproof way to find such bugs is to print all kinds or things like values written to the bitstream and also print whats read in the decoder and similarly all the matching things that you printed in the encoder and compare with diff or equivalent to find the spot where things start to differ one can do that by more or less brute force or in some sort of bisect over the code approuch [...] > diff --git a/libavcodec/mlp.c b/libavcodec/mlp.c > index 87f7c77..1a56d9f 100644 > --- a/libavcodec/mlp.c > +++ b/libavcodec/mlp.c > @@ -41,6 +41,20 @@ const uint8_t ff_mlp_huffman_tables[3][18][2] = { > } > }; > > +ChannelInformation ff_mlp_ch_info[21] = { const > +{ 0x01, 0x01, 0x00, 0x1f }, { 0x03, 0x02, 0x00, 0x1b }, > +{ 0x07, 0x02, 0x01, 0x1f }, { 0x0F, 0x02, 0x02, 0x19 }, > +{ 0x07, 0x02, 0x01, 0x03 }, { 0x0F, 0x02, 0x02, 0x1f }, > +{ 0x1F, 0x02, 0x03, 0x01 }, { 0x07, 0x02, 0x01, 0x1a }, > +{ 0x0F, 0x02, 0x02, 0x1f }, { 0x1F, 0x02, 0x03, 0x18 }, > +{ 0x0F, 0x02, 0x02, 0x02 }, { 0x1F, 0x02, 0x03, 0x1f }, > +{ 0x3F, 0x02, 0x04, 0x00 }, { 0x0F, 0x03, 0x01, 0x1f }, > +{ 0x1F, 0x03, 0x02, 0x18 }, { 0x0F, 0x03, 0x01, 0x02 }, > +{ 0x1F, 0x03, 0x02, 0x1f }, { 0x3F, 0x03, 0x03, 0x00 }, > +{ 0x1F, 0x04, 0x01, 0x01 }, { 0x1F, 0x04, 0x01, 0x18 }, > +{ 0x3F, 0x04, 0x02, 0x00 }, > +}; [...] > +/** Min and max values that can be encoded with each codebook. The values for > + * the third codebook take into account the fact that the sign shift for > this > + * codebook is outside the coded value, so it has one more bit of precision. > + * It should actually be -7 -> 7, shifted down by 0.5. > + */ > +static int codebook_extremes[3][2] = { const > +{-9, 8}, {-8, 7}, {-15, 14}, > +}; [...] > +input_and_return: > + > +if (data) { > +ctx->frame_size[ctx->frame_index] = avctx->frame_size; > +ctx->next_major_frame_size += avctx->frame_size; > +ctx->next_major_number_of_frames++; > +input_data(ctx, data); > +} else if (!ctx->last_frame) { > +ctx->last_frame = ctx->inout_buffer; > +} > + > +restart_frame = (ctx->frame_index + 1) % ctx->min_restart_interval; > + > +if (!restart_frame) { > +int seq_index; > + > +for (seq_index = 0; > + seq_index < ctx->restart_intervals && (seq_index * > ctx->min_restart_interval) <= ctx->avctx->frame_number; > + seq_index++) { > +unsigned int number_of_samples = 0; > +unsigned int index; > + > +ctx->sample_buffer = ctx->major_scratch_buffer; > +ctx->inout_buffer = ctx->major_inout_buffer; > +ctx->seq_index = seq_index; > + > +ctx->starting_frame_index = (ctx->avctx->frame_number - > (ctx->avctx->frame_number % ctx->min_restart_interval) > + - (seq_index * ctx->min_restart_interval)) > % ctx->max_restart_interval; > +ctx->number_of_frames = ctx->next_major_number_of_frames; > +ctx->number_of_subblocks = ctx->next_major_number_of_frames + 1; > + > +ctx->seq_channel_params = (ChannelParams *) ctx->channel_params + > + (ctx->frame_index / > ctx->min_restart_interval)*(ctx->sequence_size)*(ctx->avctx->channels) + > + > (ctx->seq_offset[seq_index])*(ctx->avctx->channels); > + > +ctx->seq_decoding_params = (DecodingParams *) ctx->decoding_params + > + (ctx->frame_index / > ctx->min_restart_interval)*(ctx->sequence_size)*(ctx->num_substreams) + > + > (ctx->seq_offset[seq_index])*(ctx->num_substreams); > + > +for (index = 0; index < ctx->number_of_frames; index++) { > +number_of_samples += ctx->frame_size[(ctx->starting_frame_index > + index) % ctx->max_restart_interval]; > +} > +ctx->number_of_samples = number_of_samples; > + > +for (index = 0; index < ctx->seq_size[seq_index]; index++) { > +clear_channel_params(ctx, ctx->seq_channel_params + > index*(ctx->avctx->c