[FFmpeg-devel] [DEVEL][PATCH] ffmpeg: fix channel_layout bug on non-default layout

2017-09-30 Thread pkv.stream

Hello

the submitted patch addresses the regression discussed in ticket #6706.

 

The -channel_layout option is not working when the channel layout is not
a default one (ex: for 4 channels, quad is interpreted as 4.0 which is
the default layout for 4 channels; or octagonal interpreted as 7.1).
This leads to the spurious auto-insertion of an auto-resampler filter
remapping the channels even if input and output have identical channel
layouts.

Thanks for any comments.

Regards


From e8216768be2323659081fab7b391fed132d1c2d9 Mon Sep 17 00:00:00 2001
From: pkviet 
Date: Sat, 30 Sep 2017 01:29:48 +0200
Subject: [PATCH] ffmpeg: fix channel_layout bug on non-default layout

Fix for ticket 6706.
The -channel_layout option was not working when the channel layout was not
a default one (ex: for 4 channels, quad was interpreted as 4.0 which is
the default layout for 4 channels; or octagonal interpreted as 7.1).
This led to the spurious auto-insertion of an auto-resampler filter
remapping the channels even if input and output had identical channel
layouts.
The fix operates by directly calling the channel layout if defined in
options. If the layout is undefined, the default layout is selected as
before the fix.
---
 ffmpeg_opt.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 100fa76..c8dcf4d 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1800,11 +1800,16 @@ static OutputStream *new_audio_stream(OptionsContext 
*o, AVFormatContext *oc, in
 MATCH_PER_STREAM_OPT(filters,str, ost->filters,oc, st);
 
 if (!ost->stream_copy) {
-char *sample_fmt = NULL;
+
+   char *sample_fmt = NULL;
 
 MATCH_PER_STREAM_OPT(audio_channels, i, audio_enc->channels, oc, st);
 
-MATCH_PER_STREAM_OPT(sample_fmts, str, sample_fmt, oc, st);
+   AVDictionaryEntry *output_layout = 
av_dict_get(o->g->codec_opts, "channel_layout",NULL, AV_DICT_MATCH_CASE);
+if (output_layout)
+ost->enc_ctx->channel_layout = _strtoui64(output_layout->value, 
NULL, 10);
+
+   MATCH_PER_STREAM_OPT(sample_fmts, str, sample_fmt, oc, st);
 if (sample_fmt &&
 (audio_enc->sample_fmt = av_get_sample_fmt(sample_fmt)) == 
AV_SAMPLE_FMT_NONE) {
 av_log(NULL, AV_LOG_FATAL, "Invalid sample format '%s'\n", 
sample_fmt);
@@ -2524,7 +2529,10 @@ loop_end:
(count + 1) * sizeof(*f->sample_rates));
 }
 if (ost->enc_ctx->channels) {
-f->channel_layout = 
av_get_default_channel_layout(ost->enc_ctx->channels);
+   if (ost->enc_ctx->channel_layout)
+   f->channel_layout = 
ost->enc_ctx->channel_layout;
+   else
+   f->channel_layout = 
av_get_default_channel_layout(ost->enc_ctx->channels);
 } else if (ost->enc->channel_layouts) {
 count = 0;
 while (ost->enc->channel_layouts[count])
-- 
2.10.1.windows.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/3] avcodec/v4l2_context: Reduce spelling variations

2017-09-30 Thread Michael Niedermayer
On Thu, Sep 28, 2017 at 04:32:48PM -0800, Lou Logan wrote:
> On Thu, Sep 28, 2017, at 04:28 PM, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/v4l2_context.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> LGTM

will apply, will also apply the rest of the set

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"I am not trying to be anyone's saviour, I'm trying to think about the
 future and not be sad" - Elon Musk



signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] avcodec/x86/lossless_videoencdsp: Fix warning: signed dword value exceeds bounds

2017-09-30 Thread Henrik Gramner
On Sat, Sep 30, 2017 at 12:58 AM, Michael Niedermayer
 wrote:
> -andi, -2 * regsize
> +andi, -(2 * regsize)

regsize is defined to mmsize / 2 in the relevant case so the
expression resolves to -2 * 16 / 2

In nasm integers are 64-bit and / is unsigned division (// is signed
division). When you perform unsigned division on a negative number you
get a large number that doesn't fit inside a 32-bit immediate. E.g.
the warning is working as intended.

A better fix is to either use parentheses in the regsize definition
(e.g. what you'd normally do in an equivalent C define), or use
%assign instead of %define. Using // is kind of ugly so I rather avoid
that.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] avcodec/x86/lossless_videoencdsp: Fix warning: signed dword value exceeds bounds

2017-09-30 Thread Michael Niedermayer
On Sat, Sep 30, 2017 at 08:50:57AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Fri, Sep 29, 2017 at 6:58 PM, Michael Niedermayer  > wrote:
> 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/x86/lossless_videoencdsp.asm | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/x86/lossless_videoencdsp.asm
> > b/libavcodec/x86/lossless_videoencdsp.asm
> > index a9c7a0a73c..89f20dc4e2 100644
> > --- a/libavcodec/x86/lossless_videoencdsp.asm
> > +++ b/libavcodec/x86/lossless_videoencdsp.asm
> > @@ -45,7 +45,7 @@ cglobal diff_bytes, 4,5,2, dst, src1, src2, w
> >  ; labels to jump to if w < regsize and w < 0
> >  %macro DIFF_BYTES_LOOP_PREP 2
> >  movi, wq
> > -andi, -2 * regsize
> > +andi, -(2 * regsize)
> >  js%2
> >  jz%1
> >  add dstq, i
> > --
> > 2.14.2
> 
> 
> OK.
> 
> (Is this a particular version of an assembler and maybe something that
> should be reported upstream?)

this report from 2011 sounds similar:
https://bugzilla.nasm.us/show_bug.cgi?id=3311133
the issue is still open


NASM version 2.10.09 compiled on Dec 29 2013
and
NASM version 2.11.08
are both affected


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] MAINTAINERS: change the decklink maintainer to myself

2017-09-30 Thread Deti Fliegl

Thanks.

On 30.09.17 23:39, Marton Balint wrote:

Signed-off-by: Marton Balint 
---
  MAINTAINERS | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 412680abac..9027ed5846 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -282,7 +282,7 @@ libavdevice
  
  
avfoundation.mThilo Borgmann

-  decklink* Deti Fliegl
+  decklink* Marton Balint
dshow.c   Roger Pack (CC rogerdp...@gmail.com)
fbdev_enc.c   Lukasz Marek
gdigrab.c Roger Pack (CC rogerdp...@gmail.com)



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavf/bit: Fix the G.729 bit auto-detection

2017-09-30 Thread Michael Niedermayer
On Sat, Sep 30, 2017 at 08:46:28PM +0200, Carl Eugen Hoyos wrote:
> 2017-09-30 3:19 GMT+02:00 Michael Niedermayer :
> > On Fri, Sep 29, 2017 at 07:23:17PM +0200, Carl Eugen Hoyos wrote:
> >> Hi!
> >>
> >> The G.729 bit auto-detection has never worked, patch attached.
> >>
> >> Please comment, Carl Eugen
> >
> >>  bit.c |   23 +--
> >>  1 file changed, 13 insertions(+), 10 deletions(-)
> >> 1eaabbb2e56d350949d0c8c439a2ba49513069f2  
> >> 0001-lavf-bit-Fix-the-G.729-bit-probe-function.patch
> >> From 2521a9bd86d807a3e18fe930b35039beb7674b3e Mon Sep 17 00:00:00 2001
> >> From: Carl Eugen Hoyos 
> >> Date: Fri, 29 Sep 2017 19:10:46 +0200
> >> Subject: [PATCH] lavf/bit: Fix the G.729 bit auto-detection.
> >>
> >> ---
> >>  libavformat/bit.c |   23 +--
> >>  1 file changed, 13 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/libavformat/bit.c b/libavformat/bit.c
> >> index d742a5b..f90e4a7 100644
> >> --- a/libavformat/bit.c
> >> +++ b/libavformat/bit.c
> >> @@ -32,20 +32,23 @@
> >>  #if CONFIG_BIT_DEMUXER
> >>  static int probe(AVProbeData *p)
> >>  {
> >> -int i, j;
> >> +int i = 0, j, valid = 0;
> >>
> >> -if(p->buf_size < 0x40)
> >> -return 0;
> >> -
> >> -for(i=0; i+3buf_size && i< 10*0x50; ){
> >> -if(AV_RL16(>buf[0]) != SYNC_WORD)
> >> +while (2 * i + 3 < p->buf_size){
> >> +if (AV_RL16(>buf[2 * i++]) != SYNC_WORD)
> >>  return 0;
> >> -j=AV_RL16(>buf[2]);
> >> -if(j!=0x40 && j!=0x50)
> >> +j = AV_RL16(>buf[2 * i++]);
> >> +if (j != 0 && j != 0x10 && j != 0x40 && j != 0x50)
> >>  return 0;
> >> -i+=j;
> >> +if (j)
> >> +valid++;
> >> +i += j;
> >>  }
> >> -return AVPROBE_SCORE_EXTENSION;
> >> +if (valid > 10)
> >> +return AVPROBE_SCORE_MAX;
> >
> > this looks like a g729 stream encapsulated i another container could
> > return AVPROBE_SCORE_MAX. This may be sub optimal
> 
> SYNC_WORD only exists in BIT streams, not in raw g.729 streams
> as muxed in other formats.

i dont think assuming the non existance of one kind of container to
ever be put in another is a safe assumtation.

also theres tar and other generic containers.

still this checks the files first few bytes so its probably ok as
most other containrs wouldnt match here

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] MAINTAINERS: change the decklink maintainer to myself

2017-09-30 Thread Lou Logan
On Sat, Sep 30, 2017, at 01:39 PM, Marton Balint wrote:
> Signed-off-by: Marton Balint 
> ---
>  MAINTAINERS | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Fine with me if you don't hear from Deti for a week or so.

Otherwise, just add yourself as a co-maintainer and push anytime.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] MAINTAINERS: change the decklink maintainer to myself

2017-09-30 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 412680abac..9027ed5846 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -282,7 +282,7 @@ libavdevice
 
 
   avfoundation.mThilo Borgmann
-  decklink* Deti Fliegl
+  decklink* Marton Balint
   dshow.c   Roger Pack (CC rogerdp...@gmail.com)
   fbdev_enc.c   Lukasz Marek
   gdigrab.c Roger Pack (CC rogerdp...@gmail.com)
-- 
2.13.5

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 4/4] livavdevice/decklink: Don't allow any codecs but V210 and UYVY422

2017-09-30 Thread Marton Balint



On Tue, 26 Sep 2017, Devin Heitmueller wrote:


Make sure that codecs other than V210 or wrapped avframes with
uyvy422 video are passed to decklink output (which would result
in undefined behavior).

Signed-off-by: Devin Heitmueller 
---
libavdevice/decklink_enc.cpp | 4 
1 file changed, 4 insertions(+)

diff --git a/libavdevice/decklink_enc.cpp b/libavdevice/decklink_enc.cpp
index 0d965699ec..8f08ded933 100644
--- a/libavdevice/decklink_enc.cpp
+++ b/libavdevice/decklink_enc.cpp
@@ -159,6 +159,10 @@ static int decklink_setup_video(AVFormatContext *avctx, 
AVStream *st)
   " Only AV_PIX_FMT_UYVY422 is supported.\n");
return -1;
}
+} else if (c->codec_id != AV_CODEC_ID_V210) {
+av_log(avctx, AV_LOG_ERROR, "Unsupported codec type!"
+   " Only V210 and wrapped frame with AV_PIX_FMT_UYVY422 are 
supported.\n");
+return -1;


I think you should squash this with the previous patch.

Regards,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/4] Add support for 10-bit output for Decklink SDI

2017-09-30 Thread Marton Balint



On Tue, 26 Sep 2017, Devin Heitmueller wrote:


From: Devin Heitmueller 

Can be tested via the following command:

./ffmpeg -i foo.ts -f decklink -vcodec v210 'DeckLink Duo (1)'

Note that the 8-bit support works as it did before, and setting
the pix_fmt isn't required for 10-bit mode.  The code defaults to
operating in 8-bit mode when no vcodec is specified, for backward
compatibility.

Signed-off-by: Devin Heitmueller 
---
libavdevice/decklink_enc.cpp | 110 ---
1 file changed, 83 insertions(+), 27 deletions(-)

diff --git a/libavdevice/decklink_enc.cpp b/libavdevice/decklink_enc.cpp
index 0f654faa19..0d965699ec 100644
--- a/libavdevice/decklink_enc.cpp
+++ b/libavdevice/decklink_enc.cpp
@@ -44,20 +44,45 @@ extern "C" {
class decklink_frame : public IDeckLinkVideoFrame
{
public:
-decklink_frame(struct decklink_ctx *ctx, AVFrame *avframe) :
-   _ctx(ctx), _avframe(avframe),  _refs(1) { }
-
-virtual long   STDMETHODCALLTYPE GetWidth  (void)  { 
return _avframe->width; }
-virtual long   STDMETHODCALLTYPE GetHeight (void)  { 
return _avframe->height; }
-virtual long   STDMETHODCALLTYPE GetRowBytes   (void)  { return 
_avframe->linesize[0] < 0 ? -_avframe->linesize[0] : _avframe->linesize[0]; }
-virtual BMDPixelFormat STDMETHODCALLTYPE GetPixelFormat(void)  { 
return bmdFormat8BitYUV; }
-virtual BMDFrameFlags  STDMETHODCALLTYPE GetFlags  (void)  { return 
_avframe->linesize[0] < 0 ? bmdFrameFlagFlipVertical : bmdFrameFlagDefault; }
+decklink_frame(struct decklink_ctx *ctx, AVFrame *avframe, AVCodecID 
codec_id, int height, int width) :
+_ctx(ctx), _avframe(avframe), _avpacket(NULL), _codec_id(codec_id), 
_height(height), _width(width),  _refs(1) { }
+decklink_frame(struct decklink_ctx *ctx, AVPacket *avpacket, AVCodecID 
codec_id, int height, int width) :
+_ctx(ctx), _avframe(NULL), _avpacket(avpacket), _codec_id(codec_id), 
_height(height), _width(width), _refs(1) { }
+
+virtual long   STDMETHODCALLTYPE GetWidth  (void)  { 
return _width; }
+virtual long   STDMETHODCALLTYPE GetHeight (void)  { 
return _height; }
+virtual long   STDMETHODCALLTYPE GetRowBytes   (void)
+{
+  if (_codec_id == AV_CODEC_ID_WRAPPED_AVFRAME)
+  return _avframe->linesize[0] < 0 ? -_avframe->linesize[0] : 
_avframe->linesize[0];
+  else
+  return ((GetWidth() + 47) / 48) * 128;
+}
+virtual BMDPixelFormat STDMETHODCALLTYPE GetPixelFormat(void)
+{
+if (_codec_id == AV_CODEC_ID_WRAPPED_AVFRAME)
+return bmdFormat8BitYUV;
+else
+return bmdFormat10BitYUV;
+}
+virtual BMDFrameFlags  STDMETHODCALLTYPE GetFlags  (void)
+{
+   if (_codec_id == AV_CODEC_ID_WRAPPED_AVFRAME)
+   return _avframe->linesize[0] < 0 ? bmdFrameFlagFlipVertical : 
bmdFrameFlagDefault;
+   else
+   return bmdFrameFlagDefault;
+}
+
virtual HRESULTSTDMETHODCALLTYPE GetBytes  (void **buffer)
{
+  if (_avframe) {


Maybe you should check for codec id here as well for consistency.


if (_avframe->linesize[0] < 0)
*buffer = (void *)(_avframe->data[0] + _avframe->linesize[0] * 
(_avframe->height - 1));
else
*buffer = (void *)(_avframe->data[0]);


I think this section is short enough to reindent it in the same patch.


+  } else {
+*buffer = (void *)(_avpacket->data);


The DeckLink SDK requires a 128 byte alignment for data. I am thinking 
AVPacket does not always provides that. Maybe we should simply ignore the 
SDK requirement (if it works without it?) Can you test this somehow?



+  }
return S_OK;
}

@@ -70,7 +95,10 @@ public:
{
int ret = --_refs;
if (!ret) {
-av_frame_free(&_avframe);
+if (_codec_id == AV_CODEC_ID_WRAPPED_AVFRAME)
+av_frame_free(&_avframe);
+else
+av_packet_unref(_avpacket);


You are using av_packet_unref instead of av_packet_free, is this 
intentional? av_frame_free and av_packet_free can handle NULL pointers, 
so you don't have to check the codec type, just free both.



delete this;
}
return ret;
@@ -78,6 +106,10 @@ public:

struct decklink_ctx *_ctx;
AVFrame *_avframe;
+AVPacket *_avpacket;
+AVCodecID _codec_id;
+int _height;
+int _width;

private:
std::atomic  _refs;
@@ -92,7 +124,10 @@ public:
struct decklink_ctx *ctx = frame->_ctx;
AVFrame *avframe = frame->_avframe;

-av_frame_unref(avframe);
+if (avframe)
+av_frame_unref(avframe);
+else
+av_packet_unref(frame->_avpacket);


Maybe something like this is simpler and easier to follow:

Re: [FFmpeg-devel] [PATCH 2/4] libavdevice/decklink: add support for -sources and -sinks arguments

2017-09-30 Thread Marton Balint



On Tue, 26 Sep 2017, Devin Heitmueller wrote:


Add support for enumerating the sources/sinks via the ffmpeg
command line options, as opposed to having to create a real pipeline
and use the "-list_devices" option which does exit() after dumping
out the options.

Note that this patch preserves the existing "-list_devices" option,
but now shares common code for the actual enumeration.

Signed-off-by: Devin Heitmueller 
---
libavdevice/decklink_common.cpp | 52 +
libavdevice/decklink_common.h   |  2 +-
libavdevice/decklink_dec.cpp| 22 -
libavdevice/decklink_dec.h  |  1 +
libavdevice/decklink_dec_c.c|  1 +
libavdevice/decklink_enc.cpp| 22 -
libavdevice/decklink_enc.h  |  1 +
libavdevice/decklink_enc_c.c|  1 +
8 files changed, 95 insertions(+), 7 deletions(-)

diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 7745575d0e..86d6fbb74b 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -37,6 +37,7 @@ extern "C" {
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/bswap.h"
+#include "avdevice.h"
}

#include "decklink_common.h"
@@ -261,24 +262,67 @@ int ff_decklink_set_format(AVFormatContext *avctx, 
decklink_direction_t directio
return ff_decklink_set_format(avctx, 0, 0, 0, 0, AV_FIELD_UNKNOWN, 
direction, num);
}

-int ff_decklink_list_devices(AVFormatContext *avctx)
+int ff_decklink_list_devices(AVFormatContext *avctx,
+struct AVDeviceInfoList *device_list,
+int show_inputs, int show_outputs)
{
IDeckLink *dl = NULL;
IDeckLinkIterator *iter = CreateDeckLinkIteratorInstance();
+int ret = 0;
+
if (!iter) {
av_log(avctx, AV_LOG_ERROR, "Could not create DeckLink iterator\n");
return AVERROR(EIO);
}
-av_log(avctx, AV_LOG_INFO, "Blackmagic DeckLink devices:\n");
+
while (iter->Next() == S_OK) {


This probably needs an additional && ret == 0 condition, if there was an 
ENOMEM error, you want to return instantly instead of trying with the next 
device, and ignoring the ENOMEM.



+IDeckLinkOutput *output_config;
+IDeckLinkInput *input_config;
const char *displayName;
+AVDeviceInfo *new_device = NULL;
+int add = 0;
+
ff_decklink_get_display_name(dl, );
-av_log(avctx, AV_LOG_INFO, "\t'%s'\n", displayName);
+
+if (show_outputs) {
+if (dl->QueryInterface(IID_IDeckLinkOutput, (void 
**)_config) == S_OK) {
+output_config->Release();
+add = 1;
+}
+}
+
+if (show_inputs) {
+if (dl->QueryInterface(IID_IDeckLinkInput, (void **)_config) 
== S_OK) {
+input_config->Release();
+add = 1;
+}
+}
+
+if (add == 1) {
+new_device = (AVDeviceInfo *) av_mallocz(sizeof(AVDeviceInfo));
+if (!new_device) {
+ret = AVERROR(ENOMEM);
+goto next;
+}
+new_device->device_name = av_strdup(displayName);
+new_device->device_description = av_strdup(displayName);
+if (!new_device->device_description || !new_device->device_name) {


you might leak device_name here.


+ret = AVERROR(ENOMEM);
+goto next;
+}
+
+if ((ret = av_dynarray_add_nofree(_list->devices,
+  _list->nb_devices, 
new_device)) < 0) {


you should free the struct on error here I think


+goto next;
+}
+}
+
+next:
av_free((void *) displayName);


av_freep


dl->Release();
}
iter->Release();
-return 0;
+return ret;
}

int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t 
direction)
diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h
index 749eb0f8b8..f81b33ada4 100644
--- a/libavdevice/decklink_common.h
+++ b/libavdevice/decklink_common.h
@@ -135,7 +135,7 @@ static const BMDVideoConnection 
decklink_video_connection_map[] = {
HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName);
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);
int ff_decklink_set_format(AVFormatContext *avctx, decklink_direction_t 
direction, int num);
-int ff_decklink_list_devices(AVFormatContext *avctx);
+int ff_decklink_list_devices(AVFormatContext *avctx, struct AVDeviceInfoList 
*device_list, int show_inputs, int show_outputs);
int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t 
direction = DIRECTION_OUT);
void ff_decklink_cleanup(AVFormatContext *avctx);
int 

Re: [FFmpeg-devel] [PATCH] avfilter: add vmafmotion filter

2017-09-30 Thread Carl Eugen Hoyos
2017-09-30 20:30 GMT+02:00 Ronald S. Bultje :
> Hi Carl,
>
> On Sat, Sep 30, 2017 at 2:19 PM, Carl Eugen Hoyos 
> wrote:
>
>> 2017-09-30 19:47 GMT+02:00 Ronald S. Bultje :
>> > Hi Carl,
>> >
>> > On Sat, Sep 30, 2017 at 1:31 PM, Carl Eugen Hoyos 
>> > wrote:
>> >
>> >> Hi!
>> >>
>> >> 2017-09-15 22:47 GMT+02:00 Ashish Pratap Singh :
>> >>
>> >> > +static int query_formats(AVFilterContext *ctx)
>> >> > +{
>> >> > +static const enum AVPixelFormat pix_fmts[] = {
>> >> > +AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
>> >> > AV_PIX_FMT_YUV420P,
>> >> > +AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10,
>> >> > AV_PIX_FMT_YUV420P10,
>> >>
>> >> Is the algorithm only defined for these formats and bit-depth
>> >> or are there just missing features?
>> >> Gray and gray10 come to mind...
>> >>
>> >
>> > Great question! I _believe_ that vmaf overall is luma-only, so it should
>> be
>> > entirely independent of chroma.
>>
>> Then imo, above function is just wrong, it should check for
>> non-rgb or similar (think of YUVA444 and friends).
>>
>
> I don't think I'm familiar enough with lavfi to send a patch, can you send
> one? What I've asked Ashish to do (and what he's done here) is simply to
> reproduce as closely as possible what Netflix' code does, and they only
> support 420, 422 and 444 for 8 and 10 bits/component. I'm happy to support
> more if I know how to.

Attached patch also support GBRP, I don't know if this is a good or
bad idea.

Carl Eugen
From c7da156438424bf9b08aaddaada4967868d28105 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Sat, 30 Sep 2017 21:39:08 +0200
Subject: [PATCH] lavfi/vmafmotion: Allow more pix_fmts.

---
 libavfilter/vf_vmafmotion.c |   22 +-
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/libavfilter/vf_vmafmotion.c b/libavfilter/vf_vmafmotion.c
index 6b6150a..48986b7 100644
--- a/libavfilter/vf_vmafmotion.c
+++ b/libavfilter/vf_vmafmotion.c
@@ -261,15 +261,19 @@ int ff_vmafmotion_init(VMAFMotionData *s,
 
 static int query_formats(AVFilterContext *ctx)
 {
-static const enum AVPixelFormat pix_fmts[] = {
-AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P,
-AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV420P10,
-AV_PIX_FMT_NONE
-};
-
-AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
-if (!fmts_list)
-return AVERROR(ENOMEM);
+AVFilterFormats *fmts_list = NULL;
+int format, ret;
+
+for (format = 0; av_pix_fmt_desc_get(format); format++) {
+const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
+if (!(desc->flags & (AV_PIX_FMT_FLAG_HWACCEL | AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_PAL)) &&
+(desc->flags & AV_PIX_FMT_FLAG_PLANAR || desc->nb_components == 1) &&
+(!(desc->flags & AV_PIX_FMT_FLAG_BE) == !HAVE_BIGENDIAN || desc->comp[0].depth == 8) &&
+(desc->comp[0].depth == 8 || desc->comp[0].depth == 10) &&
+(ret = ff_add_format(_list, format)) < 0)
+return ret;
+}
+
 return ff_set_common_formats(ctx, fmts_list);
 }
 
-- 
1.7.10.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavf/bit: Fix the G.729 bit auto-detection

2017-09-30 Thread Carl Eugen Hoyos
2017-09-30 3:19 GMT+02:00 Michael Niedermayer :
> On Fri, Sep 29, 2017 at 07:23:17PM +0200, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> The G.729 bit auto-detection has never worked, patch attached.
>>
>> Please comment, Carl Eugen
>
>>  bit.c |   23 +--
>>  1 file changed, 13 insertions(+), 10 deletions(-)
>> 1eaabbb2e56d350949d0c8c439a2ba49513069f2  
>> 0001-lavf-bit-Fix-the-G.729-bit-probe-function.patch
>> From 2521a9bd86d807a3e18fe930b35039beb7674b3e Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos 
>> Date: Fri, 29 Sep 2017 19:10:46 +0200
>> Subject: [PATCH] lavf/bit: Fix the G.729 bit auto-detection.
>>
>> ---
>>  libavformat/bit.c |   23 +--
>>  1 file changed, 13 insertions(+), 10 deletions(-)
>>
>> diff --git a/libavformat/bit.c b/libavformat/bit.c
>> index d742a5b..f90e4a7 100644
>> --- a/libavformat/bit.c
>> +++ b/libavformat/bit.c
>> @@ -32,20 +32,23 @@
>>  #if CONFIG_BIT_DEMUXER
>>  static int probe(AVProbeData *p)
>>  {
>> -int i, j;
>> +int i = 0, j, valid = 0;
>>
>> -if(p->buf_size < 0x40)
>> -return 0;
>> -
>> -for(i=0; i+3buf_size && i< 10*0x50; ){
>> -if(AV_RL16(>buf[0]) != SYNC_WORD)
>> +while (2 * i + 3 < p->buf_size){
>> +if (AV_RL16(>buf[2 * i++]) != SYNC_WORD)
>>  return 0;
>> -j=AV_RL16(>buf[2]);
>> -if(j!=0x40 && j!=0x50)
>> +j = AV_RL16(>buf[2 * i++]);
>> +if (j != 0 && j != 0x10 && j != 0x40 && j != 0x50)
>>  return 0;
>> -i+=j;
>> +if (j)
>> +valid++;
>> +i += j;
>>  }
>> -return AVPROBE_SCORE_EXTENSION;
>> +if (valid > 10)
>> +return AVPROBE_SCORE_MAX;
>
> this looks like a g729 stream encapsulated i another container could
> return AVPROBE_SCORE_MAX. This may be sub optimal

SYNC_WORD only exists in BIT streams, not in raw g.729 streams
as muxed in other formats.

Patch pushed.

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]fate: Add a test for latm-in-dvb autodetection

2017-09-30 Thread Carl Eugen Hoyos
2017-09-27 17:12 GMT+02:00 Carl Eugen Hoyos :
> Hi!
>
> Attached patch adds a test for ticket #6657.

New patch attached.

Carl Eugen
From cc022fb1c6398e4dac3ce43b0205908481c07a08 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Sat, 30 Sep 2017 20:33:09 +0200
Subject: [PATCH] fate: Add a test for latm-in-dvb auto-detection, ticket
 #6657.

---
 tests/Makefile   |1 +
 tests/fate/mpegts.mak|   14 ++
 tests/ref/fate/mpegts-probe-latm |   14 ++
 3 files changed, 29 insertions(+)
 create mode 100644 tests/fate/mpegts.mak
 create mode 100644 tests/ref/fate/mpegts-probe-latm

diff --git a/tests/Makefile b/tests/Makefile
index 99f7e17..278be24 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -156,6 +156,7 @@ include $(SRC_PATH)/tests/fate/mov.mak
 include $(SRC_PATH)/tests/fate/mp3.mak
 include $(SRC_PATH)/tests/fate/mpc.mak
 include $(SRC_PATH)/tests/fate/mpeg4.mak
+include $(SRC_PATH)/tests/fate/mpegts.mak
 include $(SRC_PATH)/tests/fate/mxf.mak
 include $(SRC_PATH)/tests/fate/opus.mak
 include $(SRC_PATH)/tests/fate/pcm.mak
diff --git a/tests/fate/mpegts.mak b/tests/fate/mpegts.mak
new file mode 100644
index 000..9f3efa4
--- /dev/null
+++ b/tests/fate/mpegts.mak
@@ -0,0 +1,14 @@
+#
+# Test probing MPEGTS format and codecs
+#
+PROBE_CODEC_NAME_COMMAND = \
+ffprobe$(PROGSSUF)$(EXESUF) -show_entries stream=codec_name \
+-print_format default -bitexact -v 0
+
+FATE_MPEGTS_PROBE-$(call DEMDEC, MPEGTS, HEVC, AAC_LATM) += fate-mpegts-probe-latm
+fate-mpegts-probe-latm: SRC = $(TARGET_SAMPLES)/mpegts/loewe.ts
+fate-mpegts-probe-latm: CMD = run $(PROBE_CODEC_NAME_COMMAND) -i "$(SRC)"
+
+FATE_SAMPLES_FFPROBE += $(FATE_MPEGTS_PROBE-yes)
+
+fate-mpegts: $(FATE_MPEGTS_PROBE-yes)
diff --git a/tests/ref/fate/mpegts-probe-latm b/tests/ref/fate/mpegts-probe-latm
new file mode 100644
index 000..13aea2b
--- /dev/null
+++ b/tests/ref/fate/mpegts-probe-latm
@@ -0,0 +1,14 @@
+[PROGRAM]
+[STREAM]
+codec_name=hevc
+[/STREAM]
+[STREAM]
+codec_name=aac_latm
+[/STREAM]
+[/PROGRAM]
+[STREAM]
+codec_name=hevc
+[/STREAM]
+[STREAM]
+codec_name=aac_latm
+[/STREAM]
-- 
1.7.10.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add vmafmotion filter

2017-09-30 Thread Ronald S. Bultje
Hi Carl,

On Sat, Sep 30, 2017 at 2:19 PM, Carl Eugen Hoyos 
wrote:

> 2017-09-30 19:47 GMT+02:00 Ronald S. Bultje :
> > Hi Carl,
> >
> > On Sat, Sep 30, 2017 at 1:31 PM, Carl Eugen Hoyos 
> > wrote:
> >
> >> Hi!
> >>
> >> 2017-09-15 22:47 GMT+02:00 Ashish Pratap Singh :
> >>
> >> > +static int query_formats(AVFilterContext *ctx)
> >> > +{
> >> > +static const enum AVPixelFormat pix_fmts[] = {
> >> > +AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
> >> > AV_PIX_FMT_YUV420P,
> >> > +AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10,
> >> > AV_PIX_FMT_YUV420P10,
> >>
> >> Is the algorithm only defined for these formats and bit-depth
> >> or are there just missing features?
> >> Gray and gray10 come to mind...
> >>
> >
> > Great question! I _believe_ that vmaf overall is luma-only, so it should
> be
> > entirely independent of chroma.
>
> Then imo, above function is just wrong, it should check for
> non-rgb or similar (think of YUVA444 and friends).
>

I don't think I'm familiar enough with lavfi to send a patch, can you send
one? What I've asked Ashish to do (and what he's done here) is simply to
reproduce as closely as possible what Netflix' code does, and they only
support 420, 422 and 444 for 8 and 10 bits/component. I'm happy to support
more if I know how to.

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add vmafmotion filter

2017-09-30 Thread Carl Eugen Hoyos
2017-09-30 19:47 GMT+02:00 Ronald S. Bultje :
> Hi Carl,
>
> On Sat, Sep 30, 2017 at 1:31 PM, Carl Eugen Hoyos 
> wrote:
>
>> Hi!
>>
>> 2017-09-15 22:47 GMT+02:00 Ashish Pratap Singh :
>>
>> > +static int query_formats(AVFilterContext *ctx)
>> > +{
>> > +static const enum AVPixelFormat pix_fmts[] = {
>> > +AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
>> > AV_PIX_FMT_YUV420P,
>> > +AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10,
>> > AV_PIX_FMT_YUV420P10,
>>
>> Is the algorithm only defined for these formats and bit-depth
>> or are there just missing features?
>> Gray and gray10 come to mind...
>>
>
> Great question! I _believe_ that vmaf overall is luma-only, so it should be
> entirely independent of chroma.

Then imo, above function is just wrong, it should check for
non-rgb or similar (think of YUVA444 and friends).

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add vmafmotion filter

2017-09-30 Thread Ronald S. Bultje
Hi Carl,

On Sat, Sep 30, 2017 at 1:31 PM, Carl Eugen Hoyos 
wrote:

> Hi!
>
> 2017-09-15 22:47 GMT+02:00 Ashish Pratap Singh :
>
> > +static int query_formats(AVFilterContext *ctx)
> > +{
> > +static const enum AVPixelFormat pix_fmts[] = {
> > +AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
> > AV_PIX_FMT_YUV420P,
> > +AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10,
> > AV_PIX_FMT_YUV420P10,
>
> Is the algorithm only defined for these formats and bit-depth
> or are there just missing features?
> Gray and gray10 come to mind...
>

Great question! I _believe_ that vmaf overall is luma-only, so it should be
entirely independent of chroma. As such, gray and gray10 could probably be
added to the list and it should just work.

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add vmafmotion filter

2017-09-30 Thread Carl Eugen Hoyos
Hi!

2017-09-15 22:47 GMT+02:00 Ashish Pratap Singh :

> +static int query_formats(AVFilterContext *ctx)
> +{
> +static const enum AVPixelFormat pix_fmts[] = {
> +AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P,
> AV_PIX_FMT_YUV420P,
> +AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV422P10,
> AV_PIX_FMT_YUV420P10,

Is the algorithm only defined for these formats and bit-depth
or are there just missing features?
Gray and gray10 come to mind...

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/3] avcodec/truemotion2: Fix integer overflows in tm2_high_chroma()

2017-09-30 Thread Michael Niedermayer
Fixes: runtime error: signed integer overflow: -1408475220 + -1408475220 cannot 
be represented in type 'int'
Fixes: 3336/clusterfuzz-testcase-minimized-5656839179993088

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(-)

diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index a463a925fd..f077f0e4bd 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -465,7 +465,7 @@ static inline void tm2_apply_deltas(TM2Context *ctx, int* 
Y, int stride, int *de
 }
 }
 
-static inline void tm2_high_chroma(int *data, int stride, int *last, int *CD, 
int *deltas)
+static inline void tm2_high_chroma(int *data, int stride, int *last, unsigned 
*CD, int *deltas)
 {
 int i, j;
 for (j = 0; j < 2; j++) {
-- 
2.14.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/3] avcodec/aacdec_template: Clear tns present flag on error

2017-09-30 Thread Michael Niedermayer
Fixes: 3444/clusterfuzz-testcase-minimized-6270352105668608

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/aacdec_template.c | 44 
 1 file changed, 28 insertions(+), 16 deletions(-)

diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 3558f1f550..082cc908d2 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -1999,16 +1999,17 @@ static int decode_ics(AACContext *ac, 
SingleChannelElement *sce,
 global_gain = get_bits(gb, 8);
 
 if (!common_window && !scale_flag) {
-if (decode_ics_info(ac, ics, gb) < 0)
-return AVERROR_INVALIDDATA;
+ret = decode_ics_info(ac, ics, gb);
+if (ret < 0)
+goto fail;
 }
 
 if ((ret = decode_band_types(ac, sce->band_type,
  sce->band_type_run_end, gb, ics)) < 0)
-return ret;
+goto fail;
 if ((ret = decode_scalefactors(ac, sce->sf, gb, global_gain, ics,
   sce->band_type, sce->band_type_run_end)) < 0)
-return ret;
+goto fail;
 
 pulse_present = 0;
 if (!scale_flag) {
@@ -2016,37 +2017,48 @@ static int decode_ics(AACContext *ac, 
SingleChannelElement *sce,
 if (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) {
 av_log(ac->avctx, AV_LOG_ERROR,
"Pulse tool not allowed in eight short sequence.\n");
-return AVERROR_INVALIDDATA;
+ret = AVERROR_INVALIDDATA;
+goto fail;
 }
 if (decode_pulses(, gb, ics->swb_offset, ics->num_swb)) {
 av_log(ac->avctx, AV_LOG_ERROR,
"Pulse data corrupt or invalid.\n");
-return AVERROR_INVALIDDATA;
+ret = AVERROR_INVALIDDATA;
+goto fail;
 }
 }
 tns->present = get_bits1(gb);
-if (tns->present && !er_syntax)
-if (decode_tns(ac, tns, gb, ics) < 0)
-return AVERROR_INVALIDDATA;
+if (tns->present && !er_syntax) {
+ret = decode_tns(ac, tns, gb, ics);
+if (ret < 0)
+goto fail;
+}
 if (!eld_syntax && get_bits1(gb)) {
 avpriv_request_sample(ac->avctx, "SSR");
-return AVERROR_PATCHWELCOME;
+ret = AVERROR_PATCHWELCOME;
+goto fail;
 }
 // I see no textual basis in the spec for this occurring after SSR gain
 // control, but this is what both reference and real implmentations do
-if (tns->present && er_syntax)
-if (decode_tns(ac, tns, gb, ics) < 0)
-return AVERROR_INVALIDDATA;
+if (tns->present && er_syntax) {
+ret = decode_tns(ac, tns, gb, ics);
+if (ret < 0)
+goto fail;
+}
 }
 
-if (decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present,
-, ics, sce->band_type) < 0)
-return AVERROR_INVALIDDATA;
+ret = decode_spectrum_and_dequant(ac, out, gb, sce->sf, pulse_present,
+, ics, sce->band_type);
+if (ret < 0)
+goto fail;
 
 if (ac->oc[1].m4ac.object_type == AOT_AAC_MAIN && !common_window)
 apply_prediction(ac, sce);
 
 return 0;
+fail:
+tns->present = 0;
+return ret;
 }
 
 /**
-- 
2.14.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 3/3] avcodec/dxv: Check for end of input in dxv_decompress_dxt5()

2017-09-30 Thread Michael Niedermayer
Fixes: Timeout
Fixes: 3291/clusterfuzz-testcase-4630024655208448

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/dxv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index 6f3c075d06..529e211258 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -197,6 +197,8 @@ static int dxv_decompress_dxt5(AVCodecContext *avctx)
 AV_WL32(ctx->tex_data + 4 * pos, prev);
 pos++;
 } else {
+if (bytestream2_get_bytes_left(gbc) < 1)
+return AVERROR_INVALIDDATA;
 if (state == 0) {
 value = bytestream2_get_le32(gbc);
 state = 16;
-- 
2.14.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add vmafmotion filter

2017-09-30 Thread Ronald S. Bultje
Hi,

On Fri, Sep 29, 2017 at 9:39 AM, Ronald S. Bultje 
wrote:

> Hi,
>
> On Fri, Sep 15, 2017 at 4:47 PM, Ashish Pratap Singh 
> wrote:
>
>> From: Ashish Singh 
>>
>> Hi, this patch addresses the previous issues and changes it to a single
>> input filter.
>>
>> Signed-off-by: Ashish Singh 
>> ---
>>  Changelog   |   1 +
>>  doc/filters.texi|  14 ++
>>  libavfilter/Makefile|   1 +
>>  libavfilter/allfilters.c|   1 +
>>  libavfilter/vf_vmafmotion.c | 325 ++
>> ++
>>  libavfilter/vmaf_motion.h   |  58 
>>  6 files changed, 400 insertions(+)
>>  create mode 100644 libavfilter/vf_vmafmotion.c
>>  create mode 100644 libavfilter/vmaf_motion.h
>
>
> I made tiny changes to this patch (see attached patch). Basically, it adds
> an option (similar to psnr/ssim filters) to log the per-frame scores to a
> file, which can be convenient for debugging the per-frame scores, or using
> them externally using CLI. Secondly, it adjusts the filter/sad so that the
> calculations use a slightly higher internal depth for the fixed-point
> integer calculations. This makes the score slightly closer to the
> floating-point equivalent in the reference code. Lastly, it normalizes the
> 10-bit score back to 8-bit, which is what the reference code does also. It
> also makes use of the vmafdsp.sad() function pointer instead of calling
> image_sad() directly, so SIMD will be used when added later on.
>
> This should address all review comments (the rest were basically things
> that will be used in subsequent patches, so whether we address it or not
> doesn't really affect the final product), so if there's no further
> comments, I'll squash the two patches together and push it.
>

And ... pushed.

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] avcodec/x86/lossless_videoencdsp: Fix warning: signed dword value exceeds bounds

2017-09-30 Thread Ronald S. Bultje
Hi,

On Fri, Sep 29, 2017 at 6:58 PM, Michael Niedermayer  wrote:

> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/x86/lossless_videoencdsp.asm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/x86/lossless_videoencdsp.asm
> b/libavcodec/x86/lossless_videoencdsp.asm
> index a9c7a0a73c..89f20dc4e2 100644
> --- a/libavcodec/x86/lossless_videoencdsp.asm
> +++ b/libavcodec/x86/lossless_videoencdsp.asm
> @@ -45,7 +45,7 @@ cglobal diff_bytes, 4,5,2, dst, src1, src2, w
>  ; labels to jump to if w < regsize and w < 0
>  %macro DIFF_BYTES_LOOP_PREP 2
>  movi, wq
> -andi, -2 * regsize
> +andi, -(2 * regsize)
>  js%2
>  jz%1
>  add dstq, i
> --
> 2.14.2


OK.

(Is this a particular version of an assembler and maybe something that
should be reported upstream?)

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel