Re: [FFmpeg-devel] [PATCH] avfilter, swresample, swscale: use fabs, fabsf instead of FFABS

2015-10-15 Thread Hendrik Leppkes
On Thu, Oct 15, 2015 at 12:53 PM, Ganesh Ajjanagadde  wrote:
> On Thu, Oct 15, 2015 at 6:50 AM, Hendrik Leppkes  wrote:
>> On Thu, Oct 15, 2015 at 12:41 PM, Ganesh Ajjanagadde  
>> wrote:
>>> On Thu, Oct 15, 2015 at 6:37 AM, Hendrik Leppkes  
>>> wrote:
 On Thu, Oct 15, 2015 at 12:34 PM, Ganesh Ajjanagadde  
 wrote:
> On Wed, Oct 14, 2015 at 6:50 AM, Hendrik Leppkes  
> wrote:
>> On Wed, Oct 14, 2015 at 12:37 PM, Ganesh Ajjanagadde  
>> wrote:
>>> On Wed, Oct 14, 2015 at 5:01 AM, Matt Oliver  
>>> wrote:
 On 14 October 2015 at 09:46, Ganesh Ajjanagadde  
 wrote:

> On Tue, Oct 13, 2015 at 9:12 AM, Ganesh Ajjanagadde 
> wrote:
> > On Tue, Oct 13, 2015 at 4:02 AM, Clément Bœsch  wrote:
> >> On Tue, Oct 13, 2015 at 09:25:03AM +0200, Paul B Mahol wrote:
> >> [...]
> >>> What about fmax/FFMAX?
> >>
> >> Feel free to try that out (it looks OT regarding the patch), but 
> >> fmax()
> >> looks glibc specific
>
> Seems they are actually ISO:
> http://en.cppreference.com/w/c/numeric/math/fmax
>
> Can someone check availability on all of our platforms of interest
> (e.g Microsoft)?
>

 fmax and fmin are only available on msvc using 2013 or newer. 
 Currently the
 only msvc version without fmax/fmin that FFmpeg supports is 2012 which 
 uses
 the C99 to C89 converter.
>>>
>>> And does that converter handle fmin, fmax, fmaxf, etc?
>>> Does it need patches?
>>> Bottom line: are they safe to use at the moment?
>>>
>>
>> No, they are not.
>>
>> One thing I don't understand - why are we bothering with something
>> that at best comes out as "same speed" from tests performed? (low
>> number of runs are irrelevant as they are not statistically
>> significant).
>
> Because if you actually bothered to run my random numbers benchmark
> instead of posting with no basis claiming "statistical
> insignificance", or for that matter matter bothered to actually check
> the libc link, or even looked at Clement's asm test - you would
> finally understand.
>
> Also, what needs to be done to get fmax, fmin, etc into the converter?
>

 The converter doesn't provide any functions, just alters the syntax if
 needed. Functions not available cannot be fixed that way, sorry.
>>>
>>> Thanks for clarifying. I am still confused: how do we have llabs then?
>>> Per MSDN, this was not present in MSVC 2012, and was added in MSVC
>>> 2013 (looks like a similar case to fabs, fabsf).
>>>
>>
>> Docs appear to be wrong in that particular case. It happens sometimes
>> that functions are available but didn't get added to the docs.
>
> But with respect to fmin, fmax, etc - they were not available in 2012,
> and the docs are right? Are you sure, and have you tested?
>

Yes those are definitely not available.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] ffmpeg_dxva2: set AVFrame.data[0] to the surface pointer as well

2015-10-15 Thread Hendrik Leppkes
Some decoders specifically test if data[0] is set to check if a frame is
valid. This allows these checks to pass and decoding to continue.
---
 ffmpeg_dxva2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ffmpeg_dxva2.c b/ffmpeg_dxva2.c
index 905bf89..8641a0d 100644
--- a/ffmpeg_dxva2.c
+++ b/ffmpeg_dxva2.c
@@ -248,6 +248,7 @@ static int dxva2_get_buffer(AVCodecContext *s, AVFrame 
*frame, int flags)
 ctx->surface_infos[i].used = 1;
 ctx->surface_infos[i].age  = ctx->surface_age++;
 
+frame->data[0] =
 frame->data[3] = (uint8_t *)surface;
 
 return 0;
-- 
2.5.3.windows.1

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


Re: [FFmpeg-devel] [PATCH 1/2] avfilter/internal: Doxygen for ff_fmt_is_in

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 1:45 AM, Timothy Gu  wrote:
> On Wed, Oct 14, 2015 at 8:05 PM Ganesh Ajjanagadde 
> wrote:
>> This clarifies and Doxygen's the comment for ff_fmt_is_in.
>
>  ^
> gajjanag.c:1:23: error: unexpected token ‘adjective’

sorry, missing something - does "This clarifies and adds Doxygen for
ff_fmt_is_in" fix it?

>
>>
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavfilter/internal.h | 8 +++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavfilter/internal.h b/libavfilter/internal.h
>> index bb94707..c07d306 100644
>> --- a/libavfilter/internal.h
>> +++ b/libavfilter/internal.h
>> @@ -152,7 +152,13 @@ struct AVFilterInternal {
>>  avfilter_execute_func *execute;
>>  };
>>
>> -/** Tell is a format is contained in the provided list terminated by -1.
>> */
>> +/**
>
>
>>
>> + * Tell if a format is contained in the provided -1 terminated list of
>> formats.
>
>
> -1-terminated
>
> Also what's the format supposed to be? If it can be used for all integers
> (as the source seems to indicate) then say "tell if an integer is contained
> … list of integers. This is useful for determining if BLAH format is in an
> array of supported formats."

Yes, the source is weird. If it is a pixel format, shouldn't the type
signature have an enum instead of an int? At the moment though, you
are completely right - will update and send new patch. Thanks.

>
>>
>> + *
>> + * @param fmt provided format
>> + * @param fmts -1 terminated list of formats
>> + * @return 1 if present, 0 if absent
>> + */
>>  int ff_fmt_is_in(int fmt, const int *fmts);
>
>
> Timothy
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mips: disable all features in configure if no cpu is matched

2015-10-15 Thread Nedeljko Babic
Hello,

>Signed-off-by: Vicente Olivert Riera 
>---
> configure |9 +
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
>diff --git a/configure b/configure
>index 7e55e92..cd27ad7 100755
>--- a/configure
>+++ b/configure
>@@ -4130,6 +4130,15 @@ elif enabled mips; then
> disable mips64r6
> disable msa
> ;;
>+*)
>+disable mipsfpu
>+disable mips32r2
>+disable mips32r5
>+disable mips64r6
>+disable mipsdspr1
>+disable mipsdspr2
>+disable msa
>+;;
> esac

This case will never be reached.

If configure  “--cpu” option is not used, default is cpu=generic.

On the other hand, if cpu option is used with some cpu that is not supported in
 the list, configuration will break since “-march” is set to that cpu value.

> 
> elif enabled ppc; then

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


Re: [FFmpeg-devel] [PATCH] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Clément Bœsch
On Thu, Oct 15, 2015 at 08:18:02AM -0400, Ganesh Ajjanagadde wrote:
> It has been demonstrated that using libc provided floating point
> functions is beneficial, in the context of fabs() vs FFABS.
> 
> Unfortunately, MSVC 2012 (and earlier) lack the ISO C99 fmax, fmaxf,
> fmin, fminf functions. This patch adds them, thus making their usage in
> FFmpeg safe.
> 

Do we have any use of fmax/fmin? The functions don't exist to make
FFMAX-like faster, it actually is more complex:

   These functions return the maximum of x and y.

   If one argument is a NaN, the other argument is returned.

   If both arguments are NaN, a NaN is returned.

Which means it's likely slower but will do more. Not that I mind, but in this
case, if we happen to use them, you will want to fix your local implementation
to match this behaviour.

[...]

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] avfilter, swresample, swscale: use fabs, fabsf instead of FFABS

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 6:50 AM, Hendrik Leppkes  wrote:
> On Thu, Oct 15, 2015 at 12:41 PM, Ganesh Ajjanagadde  wrote:
>> On Thu, Oct 15, 2015 at 6:37 AM, Hendrik Leppkes  wrote:
>>> On Thu, Oct 15, 2015 at 12:34 PM, Ganesh Ajjanagadde  
>>> wrote:
 On Wed, Oct 14, 2015 at 6:50 AM, Hendrik Leppkes  
 wrote:
> On Wed, Oct 14, 2015 at 12:37 PM, Ganesh Ajjanagadde  
> wrote:
>> On Wed, Oct 14, 2015 at 5:01 AM, Matt Oliver  
>> wrote:
>>> On 14 October 2015 at 09:46, Ganesh Ajjanagadde  
>>> wrote:
>>>
 On Tue, Oct 13, 2015 at 9:12 AM, Ganesh Ajjanagadde 
 wrote:
 > On Tue, Oct 13, 2015 at 4:02 AM, Clément Bœsch  wrote:
 >> On Tue, Oct 13, 2015 at 09:25:03AM +0200, Paul B Mahol wrote:
 >> [...]
 >>> What about fmax/FFMAX?
 >>
 >> Feel free to try that out (it looks OT regarding the patch), but 
 >> fmax()
 >> looks glibc specific

 Seems they are actually ISO:
 http://en.cppreference.com/w/c/numeric/math/fmax

 Can someone check availability on all of our platforms of interest
 (e.g Microsoft)?

>>>
>>> fmax and fmin are only available on msvc using 2013 or newer. Currently 
>>> the
>>> only msvc version without fmax/fmin that FFmpeg supports is 2012 which 
>>> uses
>>> the C99 to C89 converter.
>>
>> And does that converter handle fmin, fmax, fmaxf, etc?
>> Does it need patches?
>> Bottom line: are they safe to use at the moment?
>>
>
> No, they are not.
>
> One thing I don't understand - why are we bothering with something
> that at best comes out as "same speed" from tests performed? (low
> number of runs are irrelevant as they are not statistically
> significant).

 Because if you actually bothered to run my random numbers benchmark
 instead of posting with no basis claiming "statistical
 insignificance", or for that matter matter bothered to actually check
 the libc link, or even looked at Clement's asm test - you would
 finally understand.

 Also, what needs to be done to get fmax, fmin, etc into the converter?

>>>
>>> The converter doesn't provide any functions, just alters the syntax if
>>> needed. Functions not available cannot be fixed that way, sorry.
>>
>> Thanks for clarifying. I am still confused: how do we have llabs then?
>> Per MSDN, this was not present in MSVC 2012, and was added in MSVC
>> 2013 (looks like a similar case to fabs, fabsf).
>>
>
> Docs appear to be wrong in that particular case. It happens sometimes
> that functions are available but didn't get added to the docs.

But with respect to fmin, fmax, etc - they were not available in 2012,
and the docs are right? Are you sure, and have you tested?

>
> - Hendrik
> ___
> 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] avfilter: add setfps filter

2015-10-15 Thread Paul B Mahol
On 10/15/15, Nicolas George  wrote:
> Le quartidi 24 vendemiaire, an CCXXIV, Paul B Mahol a ecrit :
>> IMHO, it is far easier to use this filter than some complicated setpts
>> expression.
>
> True, but shortcuts in the setpts filter would be a better solution for
> that: having a bunch of filters that do slightly different things with the
> PTS is very bad for users because they have a hard time figuring which one
> is suited for their needs.
>
> (Also, the thing that this setfps filter does is evil, so it should not be
> encouraged.)

It should duplicate assumefps from avs/vs.

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


Re: [FFmpeg-devel] [PATCH] avfilter, swresample, swscale: use fabs, fabsf instead of FFABS

2015-10-15 Thread Ganesh Ajjanagadde
On Wed, Oct 14, 2015 at 6:50 AM, Hendrik Leppkes  wrote:
> On Wed, Oct 14, 2015 at 12:37 PM, Ganesh Ajjanagadde  wrote:
>> On Wed, Oct 14, 2015 at 5:01 AM, Matt Oliver  wrote:
>>> On 14 October 2015 at 09:46, Ganesh Ajjanagadde  wrote:
>>>
 On Tue, Oct 13, 2015 at 9:12 AM, Ganesh Ajjanagadde 
 wrote:
 > On Tue, Oct 13, 2015 at 4:02 AM, Clément Bœsch  wrote:
 >> On Tue, Oct 13, 2015 at 09:25:03AM +0200, Paul B Mahol wrote:
 >> [...]
 >>> What about fmax/FFMAX?
 >>
 >> Feel free to try that out (it looks OT regarding the patch), but fmax()
 >> looks glibc specific

 Seems they are actually ISO:
 http://en.cppreference.com/w/c/numeric/math/fmax

 Can someone check availability on all of our platforms of interest
 (e.g Microsoft)?

>>>
>>> fmax and fmin are only available on msvc using 2013 or newer. Currently the
>>> only msvc version without fmax/fmin that FFmpeg supports is 2012 which uses
>>> the C99 to C89 converter.
>>
>> And does that converter handle fmin, fmax, fmaxf, etc?
>> Does it need patches?
>> Bottom line: are they safe to use at the moment?
>>
>
> No, they are not.
>
> One thing I don't understand - why are we bothering with something
> that at best comes out as "same speed" from tests performed? (low
> number of runs are irrelevant as they are not statistically
> significant).

Because if you actually bothered to run my random numbers benchmark
instead of posting with no basis claiming "statistical
insignificance", or for that matter matter bothered to actually check
the libc link, or even looked at Clement's asm test - you would
finally understand.

Also, what needs to be done to get fmax, fmin, etc into the converter?

> ___
> 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] avfilter, swresample, swscale: use fabs, fabsf instead of FFABS

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 6:41 AM, Ganesh Ajjanagadde  wrote:
> On Thu, Oct 15, 2015 at 6:37 AM, Hendrik Leppkes  wrote:
>> On Thu, Oct 15, 2015 at 12:34 PM, Ganesh Ajjanagadde  
>> wrote:
>>> On Wed, Oct 14, 2015 at 6:50 AM, Hendrik Leppkes  
>>> wrote:
 On Wed, Oct 14, 2015 at 12:37 PM, Ganesh Ajjanagadde  
 wrote:
> On Wed, Oct 14, 2015 at 5:01 AM, Matt Oliver  wrote:
>> On 14 October 2015 at 09:46, Ganesh Ajjanagadde  wrote:
>>
>>> On Tue, Oct 13, 2015 at 9:12 AM, Ganesh Ajjanagadde 
>>> wrote:
>>> > On Tue, Oct 13, 2015 at 4:02 AM, Clément Bœsch  wrote:
>>> >> On Tue, Oct 13, 2015 at 09:25:03AM +0200, Paul B Mahol wrote:
>>> >> [...]
>>> >>> What about fmax/FFMAX?
>>> >>
>>> >> Feel free to try that out (it looks OT regarding the patch), but 
>>> >> fmax()
>>> >> looks glibc specific
>>>
>>> Seems they are actually ISO:
>>> http://en.cppreference.com/w/c/numeric/math/fmax
>>>
>>> Can someone check availability on all of our platforms of interest
>>> (e.g Microsoft)?
>>>
>>
>> fmax and fmin are only available on msvc using 2013 or newer. Currently 
>> the
>> only msvc version without fmax/fmin that FFmpeg supports is 2012 which 
>> uses
>> the C99 to C89 converter.
>
> And does that converter handle fmin, fmax, fmaxf, etc?
> Does it need patches?
> Bottom line: are they safe to use at the moment?
>

 No, they are not.

 One thing I don't understand - why are we bothering with something
 that at best comes out as "same speed" from tests performed? (low
 number of runs are irrelevant as they are not statistically
 significant).
>>>
>>> Because if you actually bothered to run my random numbers benchmark
>>> instead of posting with no basis claiming "statistical
>>> insignificance", or for that matter matter bothered to actually check
>>> the libc link, or even looked at Clement's asm test - you would
>>> finally understand.
>>>
>>> Also, what needs to be done to get fmax, fmin, etc into the converter?
>>>
>>
>> The converter doesn't provide any functions, just alters the syntax if
>> needed. Functions not available cannot be fixed that way, sorry.
>
> Thanks for clarifying. I am still confused: how do we have llabs then?
> Per MSDN, this was not present in MSVC 2012, and was added in MSVC
> 2013 (looks like a similar case to fabs, fabsf).

sorry, fabs, fabsf -> fmin, fmax etc.

>
>>
>> - Hendrik
>> ___
>> 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] avfilter, swresample, swscale: use fabs, fabsf instead of FFABS

2015-10-15 Thread Hendrik Leppkes
On Thu, Oct 15, 2015 at 12:41 PM, Ganesh Ajjanagadde  wrote:
> On Thu, Oct 15, 2015 at 6:37 AM, Hendrik Leppkes  wrote:
>> On Thu, Oct 15, 2015 at 12:34 PM, Ganesh Ajjanagadde  
>> wrote:
>>> On Wed, Oct 14, 2015 at 6:50 AM, Hendrik Leppkes  
>>> wrote:
 On Wed, Oct 14, 2015 at 12:37 PM, Ganesh Ajjanagadde  
 wrote:
> On Wed, Oct 14, 2015 at 5:01 AM, Matt Oliver  wrote:
>> On 14 October 2015 at 09:46, Ganesh Ajjanagadde  wrote:
>>
>>> On Tue, Oct 13, 2015 at 9:12 AM, Ganesh Ajjanagadde 
>>> wrote:
>>> > On Tue, Oct 13, 2015 at 4:02 AM, Clément Bœsch  wrote:
>>> >> On Tue, Oct 13, 2015 at 09:25:03AM +0200, Paul B Mahol wrote:
>>> >> [...]
>>> >>> What about fmax/FFMAX?
>>> >>
>>> >> Feel free to try that out (it looks OT regarding the patch), but 
>>> >> fmax()
>>> >> looks glibc specific
>>>
>>> Seems they are actually ISO:
>>> http://en.cppreference.com/w/c/numeric/math/fmax
>>>
>>> Can someone check availability on all of our platforms of interest
>>> (e.g Microsoft)?
>>>
>>
>> fmax and fmin are only available on msvc using 2013 or newer. Currently 
>> the
>> only msvc version without fmax/fmin that FFmpeg supports is 2012 which 
>> uses
>> the C99 to C89 converter.
>
> And does that converter handle fmin, fmax, fmaxf, etc?
> Does it need patches?
> Bottom line: are they safe to use at the moment?
>

 No, they are not.

 One thing I don't understand - why are we bothering with something
 that at best comes out as "same speed" from tests performed? (low
 number of runs are irrelevant as they are not statistically
 significant).
>>>
>>> Because if you actually bothered to run my random numbers benchmark
>>> instead of posting with no basis claiming "statistical
>>> insignificance", or for that matter matter bothered to actually check
>>> the libc link, or even looked at Clement's asm test - you would
>>> finally understand.
>>>
>>> Also, what needs to be done to get fmax, fmin, etc into the converter?
>>>
>>
>> The converter doesn't provide any functions, just alters the syntax if
>> needed. Functions not available cannot be fixed that way, sorry.
>
> Thanks for clarifying. I am still confused: how do we have llabs then?
> Per MSDN, this was not present in MSVC 2012, and was added in MSVC
> 2013 (looks like a similar case to fabs, fabsf).
>

Docs appear to be wrong in that particular case. It happens sometimes
that functions are available but didn't get added to the docs.

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


[FFmpeg-devel] [PATCH] vp9: use AVFrame.buf[0] to check if a frame is valid

2015-10-15 Thread Hendrik Leppkes
AVFrame.data[0] is not guaranteed to be set with a HWAccel
---
 libavcodec/vp9.c | 46 +++---
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 27fb956..3753e89 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -527,9 +527,9 @@ static int decode_frame_header(AVCodecContext *ctx,
 s->s.h.signbias[1]= get_bits1(>gb) && !s->s.h.errorres;
 s->s.h.refidx[2]  = get_bits(>gb, 3);
 s->s.h.signbias[2]= get_bits1(>gb) && !s->s.h.errorres;
-if (!s->s.refs[s->s.h.refidx[0]].f->data[0] ||
-!s->s.refs[s->s.h.refidx[1]].f->data[0] ||
-!s->s.refs[s->s.h.refidx[2]].f->data[0]) {
+if (!s->s.refs[s->s.h.refidx[0]].f->buf[0] ||
+!s->s.refs[s->s.h.refidx[1]].f->buf[0] ||
+!s->s.refs[s->s.h.refidx[2]].f->buf[0]) {
 av_log(ctx, AV_LOG_ERROR, "Not all references are 
available\n");
 return AVERROR_INVALIDDATA;
 }
@@ -3880,15 +3880,15 @@ static av_cold int vp9_decode_free(AVCodecContext *ctx)
 int i;
 
 for (i = 0; i < 3; i++) {
-if (s->s.frames[i].tf.f->data[0])
+if (s->s.frames[i].tf.f->buf[0])
 vp9_unref_frame(ctx, >s.frames[i]);
 av_frame_free(>s.frames[i].tf.f);
 }
 for (i = 0; i < 8; i++) {
-if (s->s.refs[i].f->data[0])
+if (s->s.refs[i].f->buf[0])
 ff_thread_release_buffer(ctx, >s.refs[i]);
 av_frame_free(>s.refs[i].f);
-if (s->next_refs[i].f->data[0])
+if (s->next_refs[i].f->buf[0])
 ff_thread_release_buffer(ctx, >next_refs[i]);
 av_frame_free(>next_refs[i].f);
 }
@@ -3916,7 +3916,7 @@ static int vp9_decode_frame(AVCodecContext *ctx, void 
*frame,
 if ((res = decode_frame_header(ctx, data, size, )) < 0) {
 return res;
 } else if (res == 0) {
-if (!s->s.refs[ref].f->data[0]) {
+if (!s->s.refs[ref].f->buf[0]) {
 av_log(ctx, AV_LOG_ERROR, "Requested reference %d not 
available\n", ref);
 return AVERROR_INVALIDDATA;
 }
@@ -3925,9 +3925,9 @@ static int vp9_decode_frame(AVCodecContext *ctx, void 
*frame,
 ((AVFrame *)frame)->pkt_pts = pkt->pts;
 ((AVFrame *)frame)->pkt_dts = pkt->dts;
 for (i = 0; i < 8; i++) {
-if (s->next_refs[i].f->data[0])
+if (s->next_refs[i].f->buf[0])
 ff_thread_release_buffer(ctx, >next_refs[i]);
-if (s->s.refs[i].f->data[0] &&
+if (s->s.refs[i].f->buf[0] &&
 (res = ff_thread_ref_frame(>next_refs[i], >s.refs[i])) < 
0)
 return res;
 }
@@ -3938,18 +3938,18 @@ static int vp9_decode_frame(AVCodecContext *ctx, void 
*frame,
 size -= res;
 
 if (!retain_segmap_ref || s->s.h.keyframe || s->s.h.intraonly) {
-if (s->s.frames[REF_FRAME_SEGMAP].tf.f->data[0])
+if (s->s.frames[REF_FRAME_SEGMAP].tf.f->buf[0])
 vp9_unref_frame(ctx, >s.frames[REF_FRAME_SEGMAP]);
-if (!s->s.h.keyframe && !s->s.h.intraonly && !s->s.h.errorres && 
s->s.frames[CUR_FRAME].tf.f->data[0] &&
+if (!s->s.h.keyframe && !s->s.h.intraonly && !s->s.h.errorres && 
s->s.frames[CUR_FRAME].tf.f->buf[0] &&
 (res = vp9_ref_frame(ctx, >s.frames[REF_FRAME_SEGMAP], 
>s.frames[CUR_FRAME])) < 0)
 return res;
 }
-if (s->s.frames[REF_FRAME_MVPAIR].tf.f->data[0])
+if (s->s.frames[REF_FRAME_MVPAIR].tf.f->buf[0])
 vp9_unref_frame(ctx, >s.frames[REF_FRAME_MVPAIR]);
-if (!s->s.h.intraonly && !s->s.h.keyframe && !s->s.h.errorres && 
s->s.frames[CUR_FRAME].tf.f->data[0] &&
+if (!s->s.h.intraonly && !s->s.h.keyframe && !s->s.h.errorres && 
s->s.frames[CUR_FRAME].tf.f->buf[0] &&
 (res = vp9_ref_frame(ctx, >s.frames[REF_FRAME_MVPAIR], 
>s.frames[CUR_FRAME])) < 0)
 return res;
-if (s->s.frames[CUR_FRAME].tf.f->data[0])
+if (s->s.frames[CUR_FRAME].tf.f->buf[0])
 vp9_unref_frame(ctx, >s.frames[CUR_FRAME]);
 if ((res = vp9_alloc_frame(ctx, >s.frames[CUR_FRAME])) < 0)
 return res;
@@ -3959,7 +3959,7 @@ static int vp9_decode_frame(AVCodecContext *ctx, void 
*frame,
 ls_y = f->linesize[0];
 ls_uv =f->linesize[1];
 
-if (s->s.frames[REF_FRAME_SEGMAP].tf.f->data[0] &&
+if (s->s.frames[REF_FRAME_SEGMAP].tf.f->buf[0] &&
 (s->s.frames[REF_FRAME_MVPAIR].tf.f->width  != 
s->s.frames[CUR_FRAME].tf.f->width ||
  s->s.frames[REF_FRAME_MVPAIR].tf.f->height != 
s->s.frames[CUR_FRAME].tf.f->height)) {
 vp9_unref_frame(ctx, >s.frames[REF_FRAME_SEGMAP]);
@@ -3967,11 +3967,11 @@ static int vp9_decode_frame(AVCodecContext *ctx, void 
*frame,
 
 // ref frame setup
 for (i = 0; i < 8; i++) {
-if (s->next_refs[i].f->data[0])
+if (s->next_refs[i].f->buf[0])
 ff_thread_release_buffer(ctx, 

Re: [FFmpeg-devel] [PATCH] mips: disable all features in configure if no cpu is matched

2015-10-15 Thread Vicente Olivert Riera
Dear Nedeljko Babic,

On 10/15/2015 01:05 PM, Nedeljko Babic wrote:
> Hello,
> 
>> Signed-off-by: Vicente Olivert Riera 
>> ---
>> configure |9 +
>> 1 files changed, 9 insertions(+), 0 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 7e55e92..cd27ad7 100755
>> --- a/configure
>> +++ b/configure
>> @@ -4130,6 +4130,15 @@ elif enabled mips; then
>> disable mips64r6
>> disable msa
>> ;;
>> +*)
>> +disable mipsfpu
>> +disable mips32r2
>> +disable mips32r5
>> +disable mips64r6
>> +disable mipsdspr1
>> +disable mipsdspr2
>> +disable msa
>> +;;
>> esac
> 
> This case will never be reached.
> 
> If configure  “--cpu” option is not used, default is cpu=generic.
> 
> On the other hand, if cpu option is used with some cpu that is not supported 
> in
>  the list, configuration will break since “-march” is set to that cpu value.

Are you sure? What happen if you pass --cpu=mips32r2? Then -march will
be set to mips32r2 which is valid :-)

Regards,

Vincent.

>>
>> elif enabled ppc; then
> 
> -Nedeljko
> 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Carl Eugen Hoyos
Ganesh Ajjanagadde  gmail.com> writes:

> It has been demonstrated that using libc provided floating point
> functions is beneficial, in the context of fabs() vs FFABS.

Please provide actual numbers for this patch.

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 8:31 AM, Clément Bœsch  wrote:
> On Thu, Oct 15, 2015 at 08:18:02AM -0400, Ganesh Ajjanagadde wrote:
>> It has been demonstrated that using libc provided floating point
>> functions is beneficial, in the context of fabs() vs FFABS.
>>
>> Unfortunately, MSVC 2012 (and earlier) lack the ISO C99 fmax, fmaxf,
>> fmin, fminf functions. This patch adds them, thus making their usage in
>> FFmpeg safe.
>>
>
> Do we have any use of fmax/fmin? The functions don't exist to make
> FFMAX-like faster, it actually is more complex:
>
>These functions return the maximum of x and y.
>
>If one argument is a NaN, the other argument is returned.
>
>If both arguments are NaN, a NaN is returned.
>
> Which means it's likely slower but will do more. Not that I mind, but in this
> case, if we happen to use them, you will want to fix your local implementation
> to match this behaviour.

2 comments:
1. There is a tradeoff: the gain from possible better optimization of
>=, versus the nan handling.
2. NaN handling is not being done currently (by FFMAX and the like) -
so I don't know and can't comment whether we want it. You are right
that if we change to a fmax, we should make it consistent everywhere
on all platforms . Anyone else has comments on this?

>
> [...]
>
> --
> Clément B.
>
> ___
> 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] avfilter, swresample, swscale: use fabs, fabsf instead of FFABS

2015-10-15 Thread Ganesh Ajjanagadde
On Wed, Oct 14, 2015 at 6:53 AM, Hendrik Leppkes  wrote:
> On Wed, Oct 14, 2015 at 12:49 PM, Carl Eugen Hoyos  wrote:
>> Ganesh Ajjanagadde  mit.edu> writes:
>>
>>> What? My numbers actually show that the new code may be faster -
>>
>> No, you are misunderstanding the numbers you posted.
>> (Or I misunderstand them but nobody said so yet.)
>>
>> Highest runs are most relevant, skips have to be
>> avoided (afaik).
>>
>> [...]
>>
>>> If you continue to post such stuff that has no basis, I might actually
>>> get tempted into finding out for which floating point values the new
>>> code is significantly faster, craft a relevant audio file, and post it
>>> showing a huge performance difference - my random numbers benchmark
>>> shows there must exist such values.
>>
>> Please do so!
>>
>>> > The more important question is if you can see the same
>>> > changes in the disassembly of af_astats.o as what
>>> > ubitux posted here for a short test function?
>>>
>>> I do. He uses clang/gcc, so do I.
>>
>> Sorry, my understanding fails here (I am not a native speaker):
>> You did look at the disassembly of af_astats.o and there is
>> inlined code instead of a function call?
>>
>>> The reason (irrelevant) is that both
>>> of us run Arch.
>>>
>>> What is "more relevant" is if _you_ can see the changes
>>> on some non Linux platform.
>>
>> If you could show that it is faster on any platform
>> I would already be happy!
>>
>
> A more important check would be that its not significantly slower on
> any other platform. Just because one compiler/glibc combination
> manages to produce an efficient inlined function doesn't necessarily
> mean that some other compiler or libc couldn't produce a full function
> call with all the overhead that comes with it, becoming significantly
> slower.

As I point out, all a libc implementer needs to do to be on par with
the macro is to add the inline keyword. This was added in c99. If said
libc does not, then it is fundamentally broken from a performance
perspective. A beginning programmer can do that in a couple of
minutes. Fix upstream and complain to them if it does not inline.

You seem to have an alternative platform: you (and others who have
such platforms) are welcome to try and find out, file bugs (if need
be) with Microsoft, etc.

> ___
> 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] avfilter, swresample, swscale: use fabs, fabsf instead of FFABS

2015-10-15 Thread Hendrik Leppkes
On Thu, Oct 15, 2015 at 12:34 PM, Ganesh Ajjanagadde  wrote:
> On Wed, Oct 14, 2015 at 6:50 AM, Hendrik Leppkes  wrote:
>> On Wed, Oct 14, 2015 at 12:37 PM, Ganesh Ajjanagadde  
>> wrote:
>>> On Wed, Oct 14, 2015 at 5:01 AM, Matt Oliver  wrote:
 On 14 October 2015 at 09:46, Ganesh Ajjanagadde  wrote:

> On Tue, Oct 13, 2015 at 9:12 AM, Ganesh Ajjanagadde 
> wrote:
> > On Tue, Oct 13, 2015 at 4:02 AM, Clément Bœsch  wrote:
> >> On Tue, Oct 13, 2015 at 09:25:03AM +0200, Paul B Mahol wrote:
> >> [...]
> >>> What about fmax/FFMAX?
> >>
> >> Feel free to try that out (it looks OT regarding the patch), but fmax()
> >> looks glibc specific
>
> Seems they are actually ISO:
> http://en.cppreference.com/w/c/numeric/math/fmax
>
> Can someone check availability on all of our platforms of interest
> (e.g Microsoft)?
>

 fmax and fmin are only available on msvc using 2013 or newer. Currently the
 only msvc version without fmax/fmin that FFmpeg supports is 2012 which uses
 the C99 to C89 converter.
>>>
>>> And does that converter handle fmin, fmax, fmaxf, etc?
>>> Does it need patches?
>>> Bottom line: are they safe to use at the moment?
>>>
>>
>> No, they are not.
>>
>> One thing I don't understand - why are we bothering with something
>> that at best comes out as "same speed" from tests performed? (low
>> number of runs are irrelevant as they are not statistically
>> significant).
>
> Because if you actually bothered to run my random numbers benchmark
> instead of posting with no basis claiming "statistical
> insignificance", or for that matter matter bothered to actually check
> the libc link, or even looked at Clement's asm test - you would
> finally understand.
>
> Also, what needs to be done to get fmax, fmin, etc into the converter?
>

The converter doesn't provide any functions, just alters the syntax if
needed. Functions not available cannot be fixed that way, sorry.

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


Re: [FFmpeg-devel] [PATCH] avfilter, swresample, swscale: use fabs, fabsf instead of FFABS

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 6:57 AM, Hendrik Leppkes  wrote:
> On Thu, Oct 15, 2015 at 12:53 PM, Ganesh Ajjanagadde  wrote:
>> On Thu, Oct 15, 2015 at 6:50 AM, Hendrik Leppkes  wrote:
>>> On Thu, Oct 15, 2015 at 12:41 PM, Ganesh Ajjanagadde  
>>> wrote:
 On Thu, Oct 15, 2015 at 6:37 AM, Hendrik Leppkes  
 wrote:
> On Thu, Oct 15, 2015 at 12:34 PM, Ganesh Ajjanagadde  
> wrote:
>> On Wed, Oct 14, 2015 at 6:50 AM, Hendrik Leppkes  
>> wrote:
>>> On Wed, Oct 14, 2015 at 12:37 PM, Ganesh Ajjanagadde  
>>> wrote:
 On Wed, Oct 14, 2015 at 5:01 AM, Matt Oliver  
 wrote:
> On 14 October 2015 at 09:46, Ganesh Ajjanagadde  
> wrote:
>
>> On Tue, Oct 13, 2015 at 9:12 AM, Ganesh Ajjanagadde 
>> 
>> wrote:
>> > On Tue, Oct 13, 2015 at 4:02 AM, Clément Bœsch  wrote:
>> >> On Tue, Oct 13, 2015 at 09:25:03AM +0200, Paul B Mahol wrote:
>> >> [...]
>> >>> What about fmax/FFMAX?
>> >>
>> >> Feel free to try that out (it looks OT regarding the patch), but 
>> >> fmax()
>> >> looks glibc specific
>>
>> Seems they are actually ISO:
>> http://en.cppreference.com/w/c/numeric/math/fmax
>>
>> Can someone check availability on all of our platforms of interest
>> (e.g Microsoft)?
>>
>
> fmax and fmin are only available on msvc using 2013 or newer. 
> Currently the
> only msvc version without fmax/fmin that FFmpeg supports is 2012 
> which uses
> the C99 to C89 converter.

 And does that converter handle fmin, fmax, fmaxf, etc?
 Does it need patches?
 Bottom line: are they safe to use at the moment?

>>>
>>> No, they are not.
>>>
>>> One thing I don't understand - why are we bothering with something
>>> that at best comes out as "same speed" from tests performed? (low
>>> number of runs are irrelevant as they are not statistically
>>> significant).
>>
>> Because if you actually bothered to run my random numbers benchmark
>> instead of posting with no basis claiming "statistical
>> insignificance", or for that matter matter bothered to actually check
>> the libc link, or even looked at Clement's asm test - you would
>> finally understand.
>>
>> Also, what needs to be done to get fmax, fmin, etc into the converter?
>>
>
> The converter doesn't provide any functions, just alters the syntax if
> needed. Functions not available cannot be fixed that way, sorry.

 Thanks for clarifying. I am still confused: how do we have llabs then?
 Per MSDN, this was not present in MSVC 2012, and was added in MSVC
 2013 (looks like a similar case to fabs, fabsf).

>>>
>>> Docs appear to be wrong in that particular case. It happens sometimes
>>> that functions are available but didn't get added to the docs.
>>
>> But with respect to fmin, fmax, etc - they were not available in 2012,
>> and the docs are right? Are you sure, and have you tested?
>>
>
> Yes those are definitely not available.

Thanks for the check. So you mentioned we can't add fmin/fmax with the
c99-89 converter. I noticed we have a libavutil/libm.h: couldn't a
"portable" fmin/fmax etc go there?

> ___
> 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] ffmpeg_dxva2: set AVFrame.data[0] to the surface pointer as well

2015-10-15 Thread Hendrik Leppkes
On Thu, Oct 15, 2015 at 1:29 PM, Hendrik Leppkes  wrote:
> Some decoders specifically test if data[0] is set to check if a frame is
> valid. This allows these checks to pass and decoding to continue.
> ---
>  ffmpeg_dxva2.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/ffmpeg_dxva2.c b/ffmpeg_dxva2.c
> index 905bf89..8641a0d 100644
> --- a/ffmpeg_dxva2.c
> +++ b/ffmpeg_dxva2.c
> @@ -248,6 +248,7 @@ static int dxva2_get_buffer(AVCodecContext *s, AVFrame 
> *frame, int flags)
>  ctx->surface_infos[i].used = 1;
>  ctx->surface_infos[i].age  = ctx->surface_age++;
>
> +frame->data[0] =
>  frame->data[3] = (uint8_t *)surface;
>
>  return 0;
> --
> 2.5.3.windows.1
>

Disregard this patch, apparently data[0] not being set is considered
perfectly fine for HWAccel decoding and usage in a check would be a
bug.
Another patch to fix such bugs incoming.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Ganesh Ajjanagadde
It has been demonstrated that using libc provided floating point
functions is beneficial, in the context of fabs() vs FFABS.

Unfortunately, MSVC 2012 (and earlier) lack the ISO C99 fmax, fmaxf,
fmin, fminf functions. This patch adds them, thus making their usage in
FFmpeg safe.

Signed-off-by: Ganesh Ajjanagadde 
---
 configure|  9 +
 libavutil/libm.h | 28 
 2 files changed, 37 insertions(+)

diff --git a/configure b/configure
index 52a65a4..571d4f2 100755
--- a/configure
+++ b/configure
@@ -1766,6 +1766,10 @@ MATH_FUNCS="
 exp2
 exp2f
 expf
+fmax
+fmaxf
+fmin
+fminf
 isinf
 isnan
 ldexpf
@@ -5278,6 +5282,11 @@ disabled crystalhd || check_lib 
libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersi
 
 atan2f_args=2
 copysign_args=2
+fmax_args=2
+fmaxf_args=2
+fmin_args=2
+fminf_args=2
+fmin_args=2
 ldexpf_args=2
 powf_args=2
 
diff --git a/libavutil/libm.h b/libavutil/libm.h
index 6c17b28..a4a2cc0 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -82,6 +82,34 @@ static av_always_inline float cbrtf(float x)
 #define exp2f(x) ((float)exp2(x))
 #endif /* HAVE_EXP2F */
 
+#if !HAVE_FMAX
+static av_always_inline av_const double fmax(double x, double y)
+{
+return (x >= y) ? x : y;
+}
+#endif /* HAVE_FMAX */
+
+#if !HAVE_FMAXF
+static av_always_inline av_const float fmaxf(float x, float y)
+{
+return (x >= y) ? x : y;
+}
+#endif /* HAVE_FMAXF */
+
+#if !HAVE_FMIN
+static av_always_inline av_const double fmin(double x, double y)
+{
+return (x <= y) ? x : y;
+}
+#endif /* HAVE_FMIN */
+
+#if !HAVE_FMINF
+static av_always_inline av_const float fminf(float x, float y)
+{
+return (x <= y) ? x : y;
+}
+#endif /* HAVE_FMINF */
+
 #if !HAVE_ISINF
 static av_always_inline av_const int isinf(float x)
 {
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH] vp9: use AVFrame.buf[0] to check if a frame is valid

2015-10-15 Thread Ronald S. Bultje
Hi,

On Thu, Oct 15, 2015 at 8:02 AM, Hendrik Leppkes 
wrote:

> AVFrame.data[0] is not guaranteed to be set with a HWAccel
> ---
>  libavcodec/vp9.c | 46 +++---
>  1 file changed, 23 insertions(+), 23 deletions(-)


Obscure. But OK. Is this documented in the AVFrame API?

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


Re: [FFmpeg-devel] [PATCH] Stream specifier enhancement

2015-10-15 Thread Bodecs Bela

Dear Marton Balint,

thank you for your feedback. See my comments below.

2015.10.14. 1:20 keltezéssel, Marton Balint írta:


On Tue, 13 Oct 2015, Bodecs Bela wrote:


Dear Marton Balint,

2015.10.12. 23:07 keltezéssel, Marton Balint írta:


On Mon, 12 Oct 2015, Bodecs Bela wrote:


Dear All,

currently stream specifiers may contain stream index, stream type,
stream id, program id, metadata key/value es usable config settings.
But you can not combine them. In some case, mainly working with
multiprogram mpeg-ts containers as input, this feature would be handy.
This patch makes it possible to combine them.
Examples: p:601:a  will select all audio streams of program 601,
a:m:language:hun will select all audio streams marked by its metadata
as hun language,
p:604:v:0  will select first video stream of program 604,
a:m:language:hun:0 will select 1st audio streams with hun language.
p:403:s:0 will select the first avaiable sub_title tream of program 
403,

and p:403:s:m:language:hun:0  will select the first hungarian language
sub_title stream of program 403.  To select first hungarian language
audio stream a:m:language:hun:0
The order of sub-specifiers (program/type/metadata/usable_config) is
arbitrary. So, you may also write v:p:604:0 to select first video 
stream

of program 604

Please consider to put this enhancement into the official ffmpeg code.


I like the idea, but are you sure just concating the specifiers is a 
good approach?


For example, what will the following mean?

m:language:u

All usable streams with language metadata or streams where the 
language metadata is 'm'?



Thank you for you like my idea.
The current stream specifier syntax is very robust, easy to parse and 
easy to use. I would not introduce any new
syntax for applying multiple criteria in the stream specifier 
expressions. On the other hand, there are only few people,
who really needs this multiple criteria feature. My enhancement does 
not alter the current behaviour in any way.


Are you sure? What if somebody matched a semicolon, or a string which 
contained a semicolon in a metadata value? E.g.: m:timecode:00:00:00:00


So most of the users will not notice anything. But those who really 
need it, they will appreciate it.
So, I think, by making possible to concatenate  specifiers inside 
stream specifier expressions is a natural way to

extend the current syntax.

Regarding your example: m:language:u
This expression is right in the current applicable syntax, without 
any enhancement. It means "all streams where the language metadata is u"
To select "streams where the language metadata is 'm'? " you should 
write  m:language:m


With my enhancement you can achive to select "All usable streams with 
language metadata" as you wrote:
(more precisely I think you mean: all usable stream where there 
exists language metadata independently its value)


u:m:language  or m:language::u


Sorry, I wasn't clear because I mistyped my question, I wanted to ask 
for a stream with language metadata 'u'.


I was referring to the problematic nature of the optional parameters 
that can/may be interpreted as a different specifier.


How do you specify a usable stream with language metadata?

m:language:u or m:language::u
You may use "u:m:language"   (because the order of specifiers is 
arbitrary) And the user need not to specify the optional parameter.


Apparently in this case the user has to specify the optional parameter 
as well for the metadata (double semicolon) because otherwise it will 
not work. So the parameter is not so optional anymore.


But I think you misundestand  the situation. The string "m:language:u" 
will work as now, nothing has changed in this field.


This will also bite you if you want to extend an existing specifier 
with an optional parameter later, the specifier which used to work 
suddenly will not.
I do not understand this. My patch only gives an opportunity to use 
multiple specifiers in the same expression, it is not mandatory to use 
it. The patch does not affect any existing command line in any way
I also accept your concern about the future, but double semicilon always 
will works for optional parameters. But may I ask: would it be better to 
introduce a "special character" for separating specifiers in the same 
expression?
I accept it if you suggest one. I only need the functionality to be able 
to give more criteria to select a stream as opposed to current 
oppurtunities. I am not stuck to my suggestion.
Anyway, You may see my enhancement as you get many optional parameters 
for the existing type, metadata and program_id specifiers. :)


In my first version I added this feature to program_id specifier only, 
but then I concluded that it can be used universaly.
If you want, I can restrict the usage of this new opportunitiy only for 
those cases, where additional specifiers are used after program_id 
specifier. So, it will be optional extra specifiers of program_id 
speficiers, only.





Regards,
Marton

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

2015-10-15 Thread Paul B Mahol
On 10/15/15, Nicolas George  wrote:
> Le quartidi 24 vendemiaire, an CCXXIV, Paul B Mahol a ecrit :
>> But not framerate.
>
> Yes, framerate. Please, could you make a little bit of effort so that this
> can be a two-sided discussion?
>
> The following command produces a 40-FPS Matroska file, and the next one
> transforms it into a 25-FPS file:
>
> ffmpeg -lavfi testsrc=r=40:d=10 /tmp/in40.mkv
> ffmpeg -i /tmp/in40.mkv -vf setpts='N*40' /tmp/out25.mkv
>
> Therefore, as far as I am concerned, this setfps filter is only useful
> because you did not correctly understand what the setpts filter can do. If
> I
> am wrong, please elaborate. NOT JUST ONE SHORT SENTENCE, thank you.

This filter sets outlink->frame_rate. Does any of your solutions do that?

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


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

2015-10-15 Thread Nicolas George
Le quartidi 24 vendémiaire, an CCXXIV, Paul B Mahol a écrit :
> IMHO, it is far easier to use this filter than some complicated setpts
> expression.

True, but shortcuts in the setpts filter would be a better solution for
that: having a bunch of filters that do slightly different things with the
PTS is very bad for users because they have a hard time figuring which one
is suited for their needs.

(Also, the thing that this setfps filter does is evil, so it should not be
encouraged.)

Regards,

-- 
  Nicolas George


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


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

2015-10-15 Thread Nicolas George
Le quartidi 24 vendémiaire, an CCXXIV, Paul B Mahol a écrit :
> But not framerate.

Yes, framerate. Please, could you make a little bit of effort so that this
can be a two-sided discussion?

The following command produces a 40-FPS Matroska file, and the next one
transforms it into a 25-FPS file:

ffmpeg -lavfi testsrc=r=40:d=10 /tmp/in40.mkv
ffmpeg -i /tmp/in40.mkv -vf setpts='N*40' /tmp/out25.mkv

Therefore, as far as I am concerned, this setfps filter is only useful
because you did not correctly understand what the setpts filter can do. If I
am wrong, please elaborate. NOT JUST ONE SHORT SENTENCE, thank you.

Regards,

-- 
  Nicolas George


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


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

2015-10-15 Thread Nicolas George
Le quartidi 24 vendémiaire, an CCXXIV, Paul B Mahol a écrit :
> This filter sets outlink->frame_rate. Does any of your solutions do that?

Oh, THAT's what you were talking about!

Do you realize that this field is purely informational? Having a dedicated
filter to set it seems like utter overkill. IMHO, it should be an option of
setpts. The time base as well, for what it's worth.

Regards,

-- 
  Nicolas George


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


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

2015-10-15 Thread Paul B Mahol
On 10/15/15, Nicolas George  wrote:
> Le quartidi 24 vendemiaire, an CCXXIV, Paul B Mahol a ecrit :
>> Timebase and stream framerate are same.
>
> Not at all. For Matroska, timebase is usually 1/1000; for MPEG-[PT]S,
> timebase is 1/9; timebase can also be set using settb.

But not framerate.

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


Re: [FFmpeg-devel] [PATCH] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 9:10 AM, Ganesh Ajjanagadde  wrote:
> On Thu, Oct 15, 2015 at 8:31 AM, Clément Bœsch  wrote:
>> On Thu, Oct 15, 2015 at 08:18:02AM -0400, Ganesh Ajjanagadde wrote:
>>> It has been demonstrated that using libc provided floating point
>>> functions is beneficial, in the context of fabs() vs FFABS.
>>>
>>> Unfortunately, MSVC 2012 (and earlier) lack the ISO C99 fmax, fmaxf,
>>> fmin, fminf functions. This patch adds them, thus making their usage in
>>> FFmpeg safe.
>>>
>>
>> Do we have any use of fmax/fmin? The functions don't exist to make
>> FFMAX-like faster, it actually is more complex:
>>
>>These functions return the maximum of x and y.
>>
>>If one argument is a NaN, the other argument is returned.
>>
>>If both arguments are NaN, a NaN is returned.
>>
>> Which means it's likely slower but will do more. Not that I mind, but in this
>> case, if we happen to use them, you will want to fix your local 
>> implementation
>> to match this behaviour.
>
> 2 comments:
> 1. There is a tradeoff: the gain from possible better optimization of
>>=, versus the nan handling.
> 2. NaN handling is not being done currently (by FFMAX and the like) -
> so I don't know and can't comment whether we want it. You are right
> that if we change to a fmax, we should make it consistent everywhere
> on all platforms . Anyone else has comments on this?

If we don't care about NaN, Inf behavior, we should strongly consider
enabling of (on GCC):
-ffinite-math-only
Allow optimizations for floating-point arithmetic that assume that
arguments and results are not NaNs or +-Infs.

This option should never be turned on by any -O option since it can
result in incorrect output for programs which depend on an exact
implementation of IEEE or ISO rules/specifications.

The default is -fno-finite-math-only.

As stated above, -O3 does not automatically enable it.

Thinking about it, if we actually care about NaN's/Infs etc I will
drop this patch. If we don't, we can enable -ffinite-math-only, then I
am pretty sure a good libc will no-op the isnan checks in fmin, fmax,
etc.

>
>>
>> [...]
>>
>> --
>> Clément B.
>>
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] lavu/intmath.h: Move x86 only msvc/icl functions to x86 specific header.

2015-10-15 Thread Matt Oliver
Some of the existing msvc/icl optimised versions for ctz and log2 use
intrinsics that are only usable on x86 systems. This patch moves them from
intmath.h to x86/intmath.h. This is technically where such functions should
go but this will also fix any issues with trying to use msvc to compile arm
code.


0002-lavu-intmath.h-Move-x86-only-msvc-icl-functions-to-x.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] lavu/intmath.h: Add msvc/icl ctzll optimisations.

2015-10-15 Thread Matt Oliver
This patch just adds the msvc and icl equivalent ctzll optimisations to
correspond with the recently added gcc variant


0001-lavu-intmath.h-Add-msvc-icl-ctzll-optimisations.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] QSV dynamically linked on linux

2015-10-15 Thread Julien Fond
Hi all,

I'm using QuickSync and FFmpeg on linux.
It works well for encoding and decoding when I build it with
--enable-static.

But when I build it with --enable-shared, it hangs.
So my question is: is it supposed to work when dynamically linked?

Thanks in advance,
Julien
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter/af_flanger: free frame on ENOMEM

2015-10-15 Thread Kyle Swanson
Signed-off-by: Kyle Swanson 
---
 libavfilter/af_flanger.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_flanger.c b/libavfilter/af_flanger.c
index 39d4e7b..f8ec830 100644
--- a/libavfilter/af_flanger.c
+++ b/libavfilter/af_flanger.c
@@ -149,8 +149,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 out_frame = frame;
 } else {
 out_frame = ff_get_audio_buffer(inlink, frame->nb_samples);
-if (!out_frame)
+if (!out_frame) {
+av_frame_free();
 return AVERROR(ENOMEM);
+}
 av_frame_copy_props(out_frame, frame);
 }
 
-- 
1.8.4

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


Re: [FFmpeg-devel] [PATCH] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 10:18 AM, Hendrik Leppkes  wrote:
> On Thu, Oct 15, 2015 at 4:04 PM, Derek Buitenhuis
>  wrote:
>> On 10/15/2015 1:18 PM, Ganesh Ajjanagadde wrote:
>>> It has been demonstrated that using libc provided floating point
>>> functions is beneficial, in the context of fabs() vs FFABS.
>>>
>>> Unfortunately, MSVC 2012 (and earlier) lack the ISO C99 fmax, fmaxf,
>>> fmin, fminf functions. This patch adds them, thus making their usage in
>>> FFmpeg safe.
>>
>> We previously had at least fmin emulation in libm.h, but it
>> caused problems on some systems and was removed.
>>
>> Carl and Michael should remember.
>
> See 4436a8f44dedc83767b3d9da9beb85d1fae2ca30

Thanks for the reference, patch dropped.
-ffinite-math (and some other floating point optimizations) look
interesting and could be useful in libavfilter. I will look at this a
little more carefully.

Of course, we should never enable associative optimizations - that
would be bad from an accuracy standpoint.

> ___
> 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] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 11:12 AM, Ganesh Ajjanagadde  wrote:
> On Thu, Oct 15, 2015 at 10:18 AM, Hendrik Leppkes  wrote:
>> On Thu, Oct 15, 2015 at 4:04 PM, Derek Buitenhuis
>>  wrote:
>>> On 10/15/2015 1:18 PM, Ganesh Ajjanagadde wrote:
 It has been demonstrated that using libc provided floating point
 functions is beneficial, in the context of fabs() vs FFABS.

 Unfortunately, MSVC 2012 (and earlier) lack the ISO C99 fmax, fmaxf,
 fmin, fminf functions. This patch adds them, thus making their usage in
 FFmpeg safe.
>>>
>>> We previously had at least fmin emulation in libm.h, but it
>>> caused problems on some systems and was removed.
>>>
>>> Carl and Michael should remember.
>>
>> See 4436a8f44dedc83767b3d9da9beb85d1fae2ca30
>
> Thanks for the reference, patch dropped.
> -ffinite-math (and some other floating point optimizations) look
> interesting and could be useful in libavfilter. I will look at this a
> little more carefully.
>
> Of course, we should never enable associative optimizations - that
> would be bad from an accuracy standpoint.

Did some digging - I don't think any of these are a good idea. For
instance, avfilter can deal with essentially untrusted audio. I also
assume that there exists an audio format whose samples are inherently
floating point and not the standard 8/16 bit pcm etc. In such a
scenario, we want a filter to do something that makes more
mathematical sense. Any of these optimizations cause one or the other
mathematical issue to happen.

In fact, getting fmin or fmax to work might be useful from a
non-performance standpoint, just to make the result make more sense
when NaN is signalled. For instance, consider the -volumedetect
filter. A single NaN (e.g in the input file, or after another filter
in a filtergraph) could clobber the peak detection. How to get them to
work while not breaking stuff as noticed in commit
4436a8f44dedc83767b3d9da9beb85d1fae2ca30 is a trickier question. Any
ideas?

>
>> ___
>> 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] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Carl Eugen Hoyos
Ganesh Ajjanagadde  mit.edu> writes:

> > Ganesh Ajjanagadde  gmail.com> writes:
> >
> >> It has been demonstrated that using libc provided floating point
> >> functions is beneficial, in the context of fabs() vs FFABS.
> >
> > Please provide actual numbers for this patch.
> 
> For a change, why don't you post numbers for where FFMAX is faster.

I don't claim it is faster.

I am just saying that if commits are made that 
potentially break some uncommon platforms, a 
reproducible explanation is given.

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Derek Buitenhuis
On 10/15/2015 1:18 PM, Ganesh Ajjanagadde wrote:
> It has been demonstrated that using libc provided floating point
> functions is beneficial, in the context of fabs() vs FFABS.
> 
> Unfortunately, MSVC 2012 (and earlier) lack the ISO C99 fmax, fmaxf,
> fmin, fminf functions. This patch adds them, thus making their usage in
> FFmpeg safe.

We previously had at least fmin emulation in libm.h, but it 
caused problems on some systems and was removed.

Carl and Michael should remember.

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


Re: [FFmpeg-devel] [PATCH] winrt: multithreading support

2015-10-15 Thread Matt Oliver
On 15 October 2015 at 07:35, Michael Niedermayer 
wrote:

> On Thu, Oct 15, 2015 at 02:46:21AM +0800, Wang Bin wrote:
> >
>
> >  compat/w32pthreads.h |5 +
> >  configure|7 +++
> >  libavutil/cpu.c  |8 +++-
> >  3 files changed, 19 insertions(+), 1 deletion(-)
> > 252925c34c8d2b6f09ce0fd40c2923494b005a7a
> 0001-winrt-multithreading-support.patch
> > From bdf361eaaa0696e25680e5403ff7516869068587 Mon Sep 17 00:00:00 2001
> > From: wang-bin 
> > Date: Tue, 29 Sep 2015 18:11:03 +0800
> > Subject: [PATCH] winrt: multithreading support
> >
> > _beginthreadex is for desktop only. CreateThread is available for
> windows store apps on windows (and phone) 8.1 and later.
> http://msdn.microsoft.com/en-us/library/ms682453%28VS.85%29.aspx
> > ---
> >  compat/w32pthreads.h | 5 +
> >  configure| 7 +++
> >  libavutil/cpu.c  | 8 +++-
> >  3 files changed, 19 insertions(+), 1 deletion(-)
>
> works (build+fate) with the 2 mingw versions i have here
>
>
LGTM, applied.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Hendrik Leppkes
On Thu, Oct 15, 2015 at 4:04 PM, Derek Buitenhuis
 wrote:
> On 10/15/2015 1:18 PM, Ganesh Ajjanagadde wrote:
>> It has been demonstrated that using libc provided floating point
>> functions is beneficial, in the context of fabs() vs FFABS.
>>
>> Unfortunately, MSVC 2012 (and earlier) lack the ISO C99 fmax, fmaxf,
>> fmin, fminf functions. This patch adds them, thus making their usage in
>> FFmpeg safe.
>
> We previously had at least fmin emulation in libm.h, but it
> caused problems on some systems and was removed.
>
> Carl and Michael should remember.

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


Re: [FFmpeg-devel] [PATCH] mips: disable all features in configure if no cpu is matched

2015-10-15 Thread Nedeljko Babic
>>
>> On the other hand, if cpu option is used with some cpu that is not supported 
>> in
>>  the list, configuration will break since “-march” is set to that cpu value.
>
>Are you sure? What happen if you pass --cpu=mips32r2? Then -march will
>be set to mips32r2 which is valid :-)

Yes, you are correct.

I didn't consider setting arch in cpu :)

Taking this in to consideration, this patch looks good to me.

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


Re: [FFmpeg-devel] [PATCH] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Clément Bœsch
On Thu, Oct 15, 2015 at 09:10:00AM -0400, Ganesh Ajjanagadde wrote:
> On Thu, Oct 15, 2015 at 8:31 AM, Clément Bœsch  wrote:
> > On Thu, Oct 15, 2015 at 08:18:02AM -0400, Ganesh Ajjanagadde wrote:
> >> It has been demonstrated that using libc provided floating point
> >> functions is beneficial, in the context of fabs() vs FFABS.
> >>
> >> Unfortunately, MSVC 2012 (and earlier) lack the ISO C99 fmax, fmaxf,
> >> fmin, fminf functions. This patch adds them, thus making their usage in
> >> FFmpeg safe.
> >>
> >
> > Do we have any use of fmax/fmin? The functions don't exist to make
> > FFMAX-like faster, it actually is more complex:
> >
> >These functions return the maximum of x and y.
> >
> >If one argument is a NaN, the other argument is returned.
> >
> >If both arguments are NaN, a NaN is returned.
> >
> > Which means it's likely slower but will do more. Not that I mind, but in 
> > this
> > case, if we happen to use them, you will want to fix your local 
> > implementation
> > to match this behaviour.
> 
> 2 comments:

> 1. There is a tradeoff: the gain from possible better optimization of
> >=, versus the nan handling.

FFMIN() and FFMAX() are translated to a single instruction on x86 with
floats: minsd/maxsd. I doubt you can do better.

> 2. NaN handling is not being done currently (by FFMAX and the like) -
> so I don't know and can't comment whether we want it.

If you name the function the same as the system, yes you want to match the
behaviour exactly. Because otherwise, as soon as someone assumes a certain
standard behaviour, there will be nasty surprises on random systems.

[...]

-- 
Clément B.


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


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

2015-10-15 Thread Nicholas Robbins
> On Thursday, October 15, 2015 7:18 AM, Paul B Mahol  wrote:

> > On 10/15/15, Nicolas George  wrote:
>>  Le quartidi 24 vendemiaire, an CCXXIV, Paul B Mahol a ecrit :
>>>  IMHO, it is far easier to use this filter than some complicated setpts
>>>  expression.
>> 
>>  True, but shortcuts in the setpts filter would be a better solution for
>>  that: having a bunch of filters that do slightly different things with the
>>  PTS is very bad for users because they have a hard time figuring which one
>>  is suited for their needs.
>> 
>>  (Also, the thing that this setfps filter does is evil, so it should not be
>>  encouraged.)
> 

> It should duplicate assumefps from avs/vs.

How is -vf setfps=24000/1001 different from putting -r 24000/1001 on the input 
file?

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


Re: [FFmpeg-devel] [PATCH] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 8:20 AM, Carl Eugen Hoyos  wrote:
> Ganesh Ajjanagadde  gmail.com> writes:
>
>> It has been demonstrated that using libc provided floating point
>> functions is beneficial, in the context of fabs() vs FFABS.
>
> Please provide actual numbers for this patch.

For a change, why don't you post numbers for where FFMAX is faster.

>
> Carl Eugen
>
> ___
> 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] configure, avutil/libm: add fmax, fmaxf, fmin, fminf support

2015-10-15 Thread Ronald S. Bultje
Hi,

On Thu, Oct 15, 2015 at 9:10 AM, Ganesh Ajjanagadde 
wrote:

> On Thu, Oct 15, 2015 at 8:31 AM, Clément Bœsch  wrote:
> > On Thu, Oct 15, 2015 at 08:18:02AM -0400, Ganesh Ajjanagadde wrote:
> >> It has been demonstrated that using libc provided floating point
> >> functions is beneficial, in the context of fabs() vs FFABS.
> >>
> >> Unfortunately, MSVC 2012 (and earlier) lack the ISO C99 fmax, fmaxf,
> >> fmin, fminf functions. This patch adds them, thus making their usage in
> >> FFmpeg safe.
> >>
> >
> > Do we have any use of fmax/fmin? The functions don't exist to make
> > FFMAX-like faster, it actually is more complex:
> >
> >These functions return the maximum of x and y.
> >
> >If one argument is a NaN, the other argument is returned.
> >
> >If both arguments are NaN, a NaN is returned.
> >
> > Which means it's likely slower but will do more. Not that I mind, but in
> this
> > case, if we happen to use them, you will want to fix your local
> implementation
> > to match this behaviour.
>
> 2 comments:
> 1. There is a tradeoff: the gain from possible better optimization of
> >=, versus the nan handling.
> 2. NaN handling is not being done currently (by FFMAX and the like) -
> so I don't know and can't comment whether we want it. You are right
> that if we change to a fmax, we should make it consistent everywhere
> on all platforms . Anyone else has comments on this?


If we provide compat functions for maxf() etc., they should behave
identically to the standard-defined maxf(). Note that this may not be more
complex, bool operations on NaN always return false, you can (ab)use that
to keep checks simple. Write (unit) tests if you're not sure.

Whether we switch from FFMAX to maxf() is a separate question that should
be answered by whether maxf() is actually equally fast / faster or not.
That there's corner case behavioural differences is understood and doesn't
have to be part of this discussion IMO.

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


Re: [FFmpeg-devel] [PATCH] avfilter, swresample, swscale: use fabs, fabsf instead of FFABS

2015-10-15 Thread Ganesh Ajjanagadde
On Wed, Oct 14, 2015 at 6:54 AM, Carl Eugen Hoyos  wrote:
> Hendrik Leppkes  gmail.com> writes:
>
>> One thing I don't understand - why are we bothering
>> with something that at best comes out as "same speed"
>> from tests performed? (low number of runs are
>> irrelevant as they are not statistically significant).
>
> Since the patches apparently save a function call,
> the question is imo: Why is this not measurable?
> Shouldn't a function call always have a clear impact?

Unless I am completely off with asm (entirely possible, it is not my
area of interest) - there is no "call" for either and both are being
inlined. The difference is that fabs() and FFABS are being optimized
differently.

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


[FFmpeg-devel] [PATCH] avutil/wchar_filename: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
Current code is fine, this just adds robustness.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/wchar_filename.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/wchar_filename.h b/libavutil/wchar_filename.h
index c553c46..2ade321 100644
--- a/libavutil/wchar_filename.h
+++ b/libavutil/wchar_filename.h
@@ -23,6 +23,7 @@
 #include 
 #include "mem.h"
 
+av_warn_unused_result
 static inline int utf8towchar(const char *filename_utf8, wchar_t **filename_w)
 {
 int num_chars;
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH] avutil/parseutils: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 8:06 PM, James Almer  wrote:
> On 10/15/2015 8:52 PM, Ganesh Ajjanagadde wrote:
>> This triggers a few warnings that will need to be fixed - not that bad,
>> the current code is mostly fine.
>>
>
> I think i asked you before, but in any case i'll do it again. Please,
> send patchsets contained in a single thread. You're making things
> hard to track and organize on people's inboxes.
> See https://kernel.org/pub/software/scm/git/docs/git-send-email.html
> --thread, --chain-reply-to and --in-reply-to options.

I find the organization part hard to understand: the pattern
av_warn_unused_result is easily grep-able and all mail clients I know
of have some kind of label/folder option.

Nevertheless, I will try to do this for the next commits. It is
actually easier for me to simply attach all of them to a single email.
Is that also fine?

>
> Thanks.
> ___
> 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] avutil/parseutils: add av_warn_unused_result

2015-10-15 Thread Michael Niedermayer
On Thu, Oct 15, 2015 at 08:15:20PM -0400, Ganesh Ajjanagadde wrote:
> On Thu, Oct 15, 2015 at 8:06 PM, James Almer  wrote:
> > On 10/15/2015 8:52 PM, Ganesh Ajjanagadde wrote:
> >> This triggers a few warnings that will need to be fixed - not that bad,
> >> the current code is mostly fine.
> >>
> >
> > I think i asked you before, but in any case i'll do it again. Please,
> > send patchsets contained in a single thread. You're making things
> > hard to track and organize on people's inboxes.
> > See https://kernel.org/pub/software/scm/git/docs/git-send-email.html
> > --thread, --chain-reply-to and --in-reply-to options.
> 
> I find the organization part hard to understand: the pattern
> av_warn_unused_result is easily grep-able and all mail clients I know
> of have some kind of label/folder option.
> 
> Nevertheless, I will try to do this for the next commits. It is

> actually easier for me to simply attach all of them to a single email.
> Is that also fine?

I dont know about others but
I keep track of which patches i still want to look at by keeping the
mails marked as unread in my MUA.
If there are multiple patches in a single mail i cannot keep track of
them using that method

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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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


Re: [FFmpeg-devel] [PATCH 1/2] lavu/intmath.h: Add msvc/icl ctzll optimisations.

2015-10-15 Thread Matt Oliver
On 16 October 2015 at 09:46, James Almer  wrote:

> On 10/15/2015 7:25 PM, Matt Oliver wrote:
> > ICC defines __GNUC__ but ICL does not! ICC (being the linux variant)
> > supports all the same functions as gcc so theres no need in this case for
> > special handling. However ICL defines _MSC_VER so this is correct.
>
> Ah, good to know then.
>
> >> >
> >>> > > +#define ff_ctzll ff_ctzll_c
> >>> > > +static av_always_inline av_const int ff_ctzll_c(long long v)
> >> >
> >> > nit: ff_ctzll_x86 for the inline version. And you need to check
> >> > HAVE_INLINE_ASM for it as
> >> > well.
> >> >
> > I didnt put the HAVE_INLINE_ASM check as at this point we know its ICL
> and
> > as ICL always has inline support so I assumed it was redundant. Given
> that
> > is there actually a need to check it?
>
> You can disable it during configure with --disable-inline-asm.
> But since it's apparently mainly meant for lavc/lavfi simd (judging by
> other
> lavu arch headers like intreadwrite.h that don't bother checking it) you
> can
> leave it as is.
>
>
Updated patch attached.


0001-lavu-intmath.h-Add-msvc-icl-ctzll-optimisations.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fix b frame n_quant_offset

2015-10-15 Thread Agatha Hu

在 2015/10/9 17:38, Agatha Hu 写道:

---
  libavcodec/nvenc.c | 6 ++
  1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 18bcd96..0e6ef43 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -742,8 +742,6 @@ static av_cold int nvenc_encode_init(AVCodecContext
*avctx)
  switch (avctx->codec->id) {
  case AV_CODEC_ID_H264:
  ctx->encode_config.encodeCodecConfig.h264Config.idrPeriod
= avctx->gop_size;
- ctx->encode_config.encodeCodecConfig.h264Config.hierarchicalPFrames = 1;
- ctx->encode_config.encodeCodecConfig.h264Config.hierarchicalBFrames = 1;
  break;
  case AV_CODEC_ID_H265:
  ctx->encode_config.encodeCodecConfig.hevcConfig.idrPeriod
= avctx->gop_size;
@@ -843,9 +841,9 @@ static av_cold int nvenc_encode_init(AVCodecContext
*avctx)

  if(avctx->i_quant_factor != 0.0 && avctx->b_quant_factor !=
0.0) {
  ctx->encode_config.rcParams.initialRCQP.qpIntra =
qp_inter_p * fabs(avctx->i_quant_factor);
-ctx->encode_config.rcParams.initialRCQP.qpIntra +=
qp_inter_p * avctx->i_quant_offset;
+ctx->encode_config.rcParams.initialRCQP.qpIntra +=
avctx->i_quant_offset;
  ctx->encode_config.rcParams.initialRCQP.qpInterB =
qp_inter_p * fabs(avctx->b_quant_factor);
-ctx->encode_config.rcParams.initialRCQP.qpInterB +=
qp_inter_p * avctx->b_quant_offset;
+ctx->encode_config.rcParams.initialRCQP.qpInterB +=
avctx->b_quant_offset;
  } else {
  ctx->encode_config.rcParams.initialRCQP.qpIntra = qp_inter_p;
  ctx->encode_config.rcParams.initialRCQP.qpInterB =
qp_inter_p;


Anyone takes a look at this patch? Thanks
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCHv2] avutil/buffer: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/buffer.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavutil/buffer.h b/libavutil/buffer.h
index b4399fd..e0dbc8a 100644
--- a/libavutil/buffer.h
+++ b/libavutil/buffer.h
@@ -26,6 +26,7 @@
 #define AVUTIL_BUFFER_H
 
 #include 
+#include "attributes.h"
 
 /**
  * @defgroup lavu_buffer AVBuffer
@@ -178,6 +179,7 @@ int av_buffer_get_ref_count(const AVBufferRef *buf);
  *written in its place. On failure, buf is left untouched.
  * @return 0 on success, a negative AVERROR on failure.
  */
+av_warn_unused_result
 int av_buffer_make_writable(AVBufferRef **buf);
 
 /**
@@ -195,6 +197,7 @@ int av_buffer_make_writable(AVBufferRef **buf);
  * reference to it (i.e. the one passed to this function). In all other cases
  * a new buffer is allocated and the data is copied.
  */
+av_warn_unused_result
 int av_buffer_realloc(AVBufferRef **buf, int size);
 
 /**
-- 
2.6.1

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


[FFmpeg-devel] [PATCH] avutil/pixdesc: add av_warn_unused_result to av_pix_fmt_get_chroma_sub_sample

2015-10-15 Thread Ganesh Ajjanagadde
This will trigger a bunch of warnings (rightfully so). This API has been
abused, see the Doxygen comment above for what to do if the error code
is not meant to be checked.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/pixdesc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h
index a6056fe..975fbf2 100644
--- a/libavutil/pixdesc.h
+++ b/libavutil/pixdesc.h
@@ -297,6 +297,7 @@ enum AVPixelFormat av_pix_fmt_desc_get_id(const 
AVPixFmtDescriptor *desc);
  *
  * @return 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format
  */
+av_warn_unused_result
 int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
  int *h_shift, int *v_shift);
 
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH] avutil/cast5: update Doxygen for av_castt_init with return information

2015-10-15 Thread Michael Niedermayer
On Thu, Oct 15, 2015 at 05:44:49PM -0400, Ganesh Ajjanagadde wrote:
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavutil/cast5.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavutil/cast5.h b/libavutil/cast5.h
> index e5cc8b1..68513e5 100644
> --- a/libavutil/cast5.h
> +++ b/libavutil/cast5.h
> @@ -48,6 +48,7 @@ struct AVCAST5 *av_cast5_alloc(void);
>* @param ctx an AVCAST5 context
>* @param key a key of 5,6,...16 bytes used for encryption/decryption
>* @param key_bits number of keybits: possible are 40,48,...,128
> +  * @return 0 on success, -1 if key_bits is not in the above list

", less than 0 on failure"

APIs should allow extensions, in the supported values, and the
information returned


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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


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


Re: [FFmpeg-devel] [PATCH 2/2] swresample/swresample_internal: add av_warn_unused_result

2015-10-15 Thread Michael Niedermayer
On Thu, Oct 15, 2015 at 09:32:18PM -0400, Ganesh Ajjanagadde wrote:
> This will trigger a few warnings that need to be fixed.
> 
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libswresample/swresample_internal.h | 4 
>  1 file changed, 4 insertions(+)

LGTM

thanks

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

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire


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


[FFmpeg-devel] [PATCH 08/11] avdevice/oss: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This does not trigger any warnings, but adds robustness.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavdevice/oss.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavdevice/oss.h b/libavdevice/oss.h
index 1f3f5e4..c5eab75 100644
--- a/libavdevice/oss.h
+++ b/libavdevice/oss.h
@@ -37,6 +37,7 @@ typedef struct OSSAudioData {
 int buffer_ptr;
 } OSSAudioData;
 
+av_warn_unused_result
 int ff_oss_audio_open(AVFormatContext *s1, int is_output,
   const char *audio_device);
 
-- 
2.6.1

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


[FFmpeg-devel] [PATCH 11/11] avdevice/decklink_dec: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This should not trigger any warnings, but adds robustness.
Untested.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavdevice/decklink_dec.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavdevice/decklink_dec.h b/libavdevice/decklink_dec.h
index 6bd9226..b19bdc6 100644
--- a/libavdevice/decklink_dec.h
+++ b/libavdevice/decklink_dec.h
@@ -23,6 +23,7 @@
 extern "C" {
 #endif
 
+av_warn_unused_result
 int ff_decklink_read_header(AVFormatContext *avctx);
 int ff_decklink_read_packet(AVFormatContext *avctx, AVPacket *pkt);
 int ff_decklink_read_close(AVFormatContext *avctx);
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH 2/2] swresample/swresample_internal: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 10:04 PM, Michael Niedermayer
 wrote:
> On Thu, Oct 15, 2015 at 09:32:18PM -0400, Ganesh Ajjanagadde wrote:
>> This will trigger a few warnings that need to be fixed.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libswresample/swresample_internal.h | 4 
>>  1 file changed, 4 insertions(+)
>
> LGTM
>
> thanks

pushed, thanks.

>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I do not agree with what you have to say, but I'll defend to the death your
> right to say it. -- Voltaire
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] version.sh: add note that ffversion.h is auto-generated

2015-10-15 Thread Ganesh Ajjanagadde
Signed-off-by: Ganesh Ajjanagadde 
---
 version.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/version.sh b/version.sh
index f9754eb..a9d7e39 100755
--- a/version.sh
+++ b/version.sh
@@ -54,6 +54,7 @@ GUARD=$(echo "$2" | sed 's/\//_/' | sed 's/\./_/' | tr 
'[:lower:]' '[:upper:]' |
 # Update version header only on revision changes to avoid spurious rebuilds
 if test "$NEW_REVISION" != "$OLD_REVISION"; then
 cat << EOF > "$2"
+/* Automatically generated by version.sh, do not manually edit! */
 #ifndef $GUARD
 #define $GUARD
 $NEW_REVISION
-- 
2.6.1

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


[FFmpeg-devel] [PATCH 1/2] swscale/swscale_internal: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This triggers a few warnings that need to be fixed.

Signed-off-by: Ganesh Ajjanagadde 
---
 libswscale/swscale_internal.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 27a40af..6e4d031 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -634,6 +634,7 @@ typedef struct SwsContext {
 //FIXME check init (where 0)
 
 SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c);
+av_warn_unused_result
 int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
  int fullRange, int brightness,
  int contrast, int saturation);
@@ -1017,6 +1018,7 @@ typedef struct VScalerContext
 int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int 
srcW, int lumY, int lumH, int chrY, int chrH, int relative);
 
 // Initialize scaler filter descriptor chain
+av_warn_unused_result
 int ff_init_filters(SwsContext *c);
 
 // Free all filter data
@@ -1031,23 +1033,29 @@ int ff_free_filters(SwsContext *c);
 int ff_rotate_slice(SwsSlice *s, int lum, int chr);
 
 /// initializes gamma conversion descriptor
+av_warn_unused_result
 int ff_init_gamma_convert(SwsFilterDescriptor *desc, SwsSlice * src, uint16_t 
*table);
 
 /// initializes lum pixel format conversion descriptor
+av_warn_unused_result
 int ff_init_desc_fmt_convert(SwsFilterDescriptor *desc, SwsSlice * src, 
SwsSlice *dst, uint32_t *pal);
 
 /// initializes lum horizontal scaling descriptor
+av_warn_unused_result
 int ff_init_desc_hscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice 
*dst, uint16_t *filter, int * filter_pos, int filter_size, int xInc);
 
 /// initializes chr pixel format conversion descriptor
+av_warn_unused_result
 int ff_init_desc_cfmt_convert(SwsFilterDescriptor *desc, SwsSlice * src, 
SwsSlice *dst, uint32_t *pal);
 
 /// initializes chr horizontal scaling descriptor
+av_warn_unused_result
 int ff_init_desc_chscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice 
*dst, uint16_t *filter, int * filter_pos, int filter_size, int xInc);
 
 int ff_init_desc_no_chr(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice 
*dst);
 
 /// initializes vertical scaling descriptors
+av_warn_unused_result
 int ff_init_vscale(SwsContext *c, SwsFilterDescriptor *desc, SwsSlice *src, 
SwsSlice *dst);
 
 /// setup vertical scaler functions
-- 
2.6.1

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


[FFmpeg-devel] [PATCH 2/2] swscale/swscale: add av_warn_unused_result to sws_init_context

2015-10-15 Thread Ganesh Ajjanagadde
This should not trigger any warnings; but adds robustness.

Signed-off-by: Ganesh Ajjanagadde 
---
 libswscale/swscale.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libswscale/swscale.h b/libswscale/swscale.h
index ff3f630..da9dd2e 100644
--- a/libswscale/swscale.h
+++ b/libswscale/swscale.h
@@ -150,6 +150,7 @@ struct SwsContext *sws_alloc_context(void);
  * @return zero or positive value on success, a negative value on
  * error
  */
+av_warn_unused_result
 int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, 
SwsFilter *dstFilter);
 
 /**
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH] avutil/opencl: add av_warn_unused_result

2015-10-15 Thread highgod0401

From: Ganesh Ajjanagadde
Date: 2015-10-16 08:08
To: ffmpeg-devel
CC: Ganesh Ajjanagadde
Subject: [FFmpeg-devel] [PATCH] avutil/opencl: add av_warn_unused_result
This will trigger a few warnings. My config does not compile the opencl
code, so this is untested.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/opencl.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/libavutil/opencl.h b/libavutil/opencl.h
index e423e55..6a5b0ab 100644
--- a/libavutil/opencl.h
+++ b/libavutil/opencl.h
@@ -81,6 +81,7 @@ typedef struct {
  *
  * @return  >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_get_device_list(AVOpenCLDeviceList **device_list);

 /**
@@ -108,6 +109,7 @@ void av_opencl_free_device_list(AVOpenCLDeviceList 
**device_list);
  * @return >=0 on success, a negative error code in case of failure
  * @see av_opencl_get_option()
  */
+av_warn_unused_result
 int av_opencl_set_option(const char *key, const char *val);

 /**
@@ -119,6 +121,7 @@ int av_opencl_set_option(const char *key, const char *val);
  * @return  >=0 on success, a negative error code in case of failure
  * @see av_opencl_set_option()
  */
+av_warn_unused_result
 int av_opencl_get_option(const char *key, uint8_t **out_val);

 /**
@@ -161,6 +164,7 @@ const char *av_opencl_errstr(cl_int status);
  * @param kernel_codekernel code to be compiled in the OpenCL runtime 
environment
  * @return  >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_register_kernel_code(const char *kernel_code);

 /**
@@ -170,6 +174,7 @@ int av_opencl_register_kernel_code(const char *kernel_code);
  *   application program, ignored if set to NULL
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_init(AVOpenCLExternalEnv *ext_opencl_env);

 /**
@@ -205,6 +210,7 @@ cl_command_queue av_opencl_get_command_queue(void);
  * @param host_ptr host pointer of the OpenCL buffer
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_buffer_create(cl_mem *cl_buf, size_t cl_buf_size, int flags, 
void *host_ptr);

 /**
@@ -215,6 +221,7 @@ int av_opencl_buffer_create(cl_mem *cl_buf, size_t 
cl_buf_size, int flags, void
  * @param buf_size  size in bytes of the source and destination buffers
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_buffer_write(cl_mem dst_cl_buf, uint8_t *src_buf, size_t 
buf_size);

 /**
@@ -225,6 +232,7 @@ int av_opencl_buffer_write(cl_mem dst_cl_buf, uint8_t 
*src_buf, size_t buf_size)
  * @param buf_size  size in bytes of the source and destination buffers
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_buffer_read(uint8_t *dst_buf, cl_mem src_cl_buf, size_t 
buf_size);

 /**
@@ -240,6 +248,7 @@ int av_opencl_buffer_read(uint8_t *dst_buf, cl_mem 
src_cl_buf, size_t buf_size);
  * @param src_plane_num  number of source image planes
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_buffer_write_image(cl_mem dst_cl_buf, size_t cl_buffer_size, int 
dst_cl_offset,
  uint8_t **src_data, int *plane_size, int 
plane_num);

@@ -253,6 +262,7 @@ int av_opencl_buffer_write_image(cl_mem dst_cl_buf, size_t 
cl_buffer_size, int d
  * @param src_cl_buf_sizesize in bytes of OpenCL buffer
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_buffer_read_image(uint8_t **dst_data, int *plane_size, int 
plane_num,
 cl_mem src_cl_buf, size_t cl_buffer_size);

-- 
2.6.1

Hi

Could I ask a question? Why should we add the av_warn_unused_result?

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


[FFmpeg-devel] [PATCH] avutil/crc: add av_warn_unused_result to av_crc_init

2015-10-15 Thread Ganesh Ajjanagadde
This triggers useful warnings in avcodec/mlp that need to be fixed.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/crc.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/crc.h b/libavutil/crc.h
index e86bf1d..75929b2 100644
--- a/libavutil/crc.h
+++ b/libavutil/crc.h
@@ -60,6 +60,7 @@ typedef enum {
  * @param ctx_size size of ctx in bytes
  * @return <0 on failure
  */
+av_warn_unused_result
 int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
 
 /**
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH] avutil/sha512: add av_warn_unused_result to av_sha512_init

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 7:37 PM, Ganesh Ajjanagadde
 wrote:
> This will trigger some useful warnings in avutil/hash that need to be fixed.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavutil/sha512.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libavutil/sha512.h b/libavutil/sha512.h
> index 7b08701..6aecf31 100644
> --- a/libavutil/sha512.h
> +++ b/libavutil/sha512.h
> @@ -49,6 +49,7 @@ struct AVSHA512 *av_sha512_alloc(void);
>   * @param bitsnumber of bits in digest (224, 256, 384 or 512 bits)
>   * @returnzero if initialization succeeded, -1 otherwise
>   */
> +av_warn_unused_result
>  int av_sha512_init(struct AVSHA512* context, int bits);
>
>  /**
> --
> 2.6.1
>

This is more controversial: on the one hand, users may want to check
the return code if they are not init-ing with a constant bits value
(e.g they obtain it dynamically), on the other hand the current usage
(within FFmpeg) is perfectly fine.

Until consensus emerges, I will not send more patches for these crypto stuff.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avutil/parseutils: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This triggers a few warnings that will need to be fixed - not that bad,
the current code is mostly fine.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/parseutils.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavutil/parseutils.h b/libavutil/parseutils.h
index e66d24b..46de518 100644
--- a/libavutil/parseutils.h
+++ b/libavutil/parseutils.h
@@ -46,6 +46,7 @@
  * @param[in] log_ctx parent logging context
  * @return >= 0 on success, a negative error code otherwise
  */
+av_warn_unused_result
 int av_parse_ratio(AVRational *q, const char *str, int max,
int log_offset, void *log_ctx);
 
@@ -63,6 +64,7 @@ int av_parse_ratio(AVRational *q, const char *str, int max,
  * width x height or a valid video size abbreviation.
  * @return >= 0 on success, a negative error code otherwise
  */
+av_warn_unused_result
 int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str);
 
 /**
@@ -74,6 +76,7 @@ int av_parse_video_size(int *width_ptr, int *height_ptr, 
const char *str);
  * rate_num / rate_den, a float number or a valid video rate abbreviation
  * @return >= 0 on success, a negative error code otherwise
  */
+av_warn_unused_result
 int av_parse_video_rate(AVRational *rate, const char *str);
 
 /**
@@ -95,6 +98,7 @@ int av_parse_video_rate(AVRational *rate, const char *str);
  * @return >= 0 in case of success, a negative value in case of
  * failure (for example if color_string cannot be parsed).
  */
+av_warn_unused_result
 int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen,
void *log_ctx);
 
@@ -143,6 +147,7 @@ const char *av_get_known_color_name(int color_idx, const 
uint8_t **rgb);
  * @return >= 0 in case of success, a negative value corresponding to an
  * AVERROR code otherwise
  */
+av_warn_unused_result
 int av_parse_time(int64_t *timeval, const char *timestr, int duration);
 
 /**
-- 
2.6.1

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


[FFmpeg-devel] [PATCH 2/2] swresample/swresample_internal: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This will trigger a few warnings that need to be fixed.

Signed-off-by: Ganesh Ajjanagadde 
---
 libswresample/swresample_internal.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/libswresample/swresample_internal.h 
b/libswresample/swresample_internal.h
index ce5eef4..bf0cec7 100644
--- a/libswresample/swresample_internal.h
+++ b/libswresample/swresample_internal.h
@@ -184,6 +184,7 @@ struct SwrContext {
 /* TODO: callbacks for ASM optimizations */
 };
 
+av_warn_unused_result
 int swri_realloc_audio(AudioData *a, int count);
 
 void swri_noise_shaping_int16 (SwrContext *s, AudioData *dsts, const AudioData 
*srcs, const AudioData *noises, int count);
@@ -191,12 +192,15 @@ void swri_noise_shaping_int32 (SwrContext *s, AudioData 
*dsts, const AudioData *
 void swri_noise_shaping_float (SwrContext *s, AudioData *dsts, const AudioData 
*srcs, const AudioData *noises, int count);
 void swri_noise_shaping_double(SwrContext *s, AudioData *dsts, const AudioData 
*srcs, const AudioData *noises, int count);
 
+av_warn_unused_result
 int swri_rematrix_init(SwrContext *s);
 void swri_rematrix_free(SwrContext *s);
 int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int 
mustcopy);
 int swri_rematrix_init_x86(struct SwrContext *s);
 
+av_warn_unused_result
 int swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum 
AVSampleFormat noise_fmt);
+av_warn_unused_result
 int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum 
AVSampleFormat in_fmt);
 
 void swri_audio_convert_init_aarch64(struct AudioConvert *ac,
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH 2/2] lavu/intmath.h: Move x86 only msvc/icl functions to x86 specific header.

2015-10-15 Thread Matt Oliver
On 16 October 2015 at 01:10, Matt Oliver  wrote:

> Some of the existing msvc/icl optimised versions for ctz and log2 use
> intrinsics that are only usable on x86 systems. This patch moves them from
> intmath.h to x86/intmath.h. This is technically where such functions should
> go but this will also fix any issues with trying to use msvc to compile arm
> code.
>

Minot tweaks as per James' suggestions in other thread


0002-lavu-intmath.h-Move-x86-only-msvc-icl-functions-to-x.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] swresample/swresample: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This will trigger a few warnings (e.g in avfilter) that need to be
fixed.

Signed-off-by: Ganesh Ajjanagadde 
---
 libswresample/swresample.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/libswresample/swresample.h b/libswresample/swresample.h
index 10eaebc..d21084f 100644
--- a/libswresample/swresample.h
+++ b/libswresample/swresample.h
@@ -220,6 +220,7 @@ struct SwrContext *swr_alloc(void);
  * @param[in,out]   s Swr context to initialize
  * @return AVERROR error code in case of failure.
  */
+av_warn_unused_result
 int swr_init(struct SwrContext *s);
 
 /**
@@ -307,6 +308,7 @@ void swr_close(struct SwrContext *s);
  *
  * @return number of samples output per channel, negative value on error
  */
+av_warn_unused_result
 int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
 const uint8_t **in , int in_count);
 
@@ -354,6 +356,7 @@ int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
  *@li compensation unsupported by resampler, or
  *@li swr_init() fails when called.
  */
+av_warn_unused_result
 int swr_set_compensation(struct SwrContext *s, int sample_delta, int 
compensation_distance);
 
 /**
@@ -364,6 +367,7 @@ int swr_set_compensation(struct SwrContext *s, int 
sample_delta, int compensatio
  *indexes, -1 for a muted channel)
  * @return >= 0 on success, or AVERROR error code in case of failure.
  */
+av_warn_unused_result
 int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
 
 /**
@@ -375,6 +379,7 @@ int swr_set_channel_mapping(struct SwrContext *s, const int 
*channel_map);
  * @param stride  offset between lines of the matrix
  * @return  >= 0 on success, or AVERROR error code in case of failure.
  */
+av_warn_unused_result
 int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
 
 /**
@@ -395,6 +400,7 @@ int swr_set_matrix(struct SwrContext *s, const double 
*matrix, int stride);
  *
  * @return >= 0 on success, or a negative AVERROR code on failure
  */
+av_warn_unused_result
 int swr_drop_output(struct SwrContext *s, int count);
 
 /**
@@ -408,6 +414,7 @@ int swr_drop_output(struct SwrContext *s, int count);
  *
  * @return >= 0 on success, or a negative AVERROR code on failure
  */
+av_warn_unused_result
 int swr_inject_silence(struct SwrContext *s, int count);
 
 /**
@@ -526,6 +533,7 @@ const char *swresample_license(void);
  * @return0 on success, AVERROR on failure or nonmatching
  *configuration.
  */
+av_warn_unused_result
 int swr_convert_frame(SwrContext *swr,
   AVFrame *output, const AVFrame *input);
 
@@ -543,6 +551,7 @@ int swr_convert_frame(SwrContext *swr,
  * @param input   input AVFrame
  * @return0 on success, AVERROR on failure.
  */
+av_warn_unused_result
 int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in);
 
 /**
-- 
2.6.1

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


[FFmpeg-devel] [PATCH 03/11] avdevice/sndio: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This does not trigger any warnings, but adds robustness.
Untested, as my configure does not compile this file.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavdevice/sndio.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavdevice/sndio.h b/libavdevice/sndio.h
index 54a5ec3..6571429 100644
--- a/libavdevice/sndio.h
+++ b/libavdevice/sndio.h
@@ -42,6 +42,7 @@ typedef struct SndioData {
 int sample_rate;
 } SndioData;
 
+av_warn_unused_result
 int ff_sndio_open(AVFormatContext *s1, int is_output, const char 
*audio_device);
 int ff_sndio_close(SndioData *s);
 
-- 
2.6.1

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


[FFmpeg-devel] [PATCH 02/11] avdevice/pulse_audio_common: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This does not trigger any warnings, but adds robustness.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavdevice/pulse_audio_common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavdevice/pulse_audio_common.h b/libavdevice/pulse_audio_common.h
index 02534f7..902795e 100644
--- a/libavdevice/pulse_audio_common.h
+++ b/libavdevice/pulse_audio_common.h
@@ -28,8 +28,10 @@
 
 pa_sample_format_t ff_codec_id_to_pulse_format(enum AVCodecID codec_id);
 
+av_warn_unused_result
 int ff_pulse_audio_get_devices(AVDeviceInfoList *devices, const char *server, 
int output);
 
+av_warn_unused_result
 int ff_pulse_audio_connect_context(pa_mainloop **pa_ml, pa_context **pa_ctx,
const char *server, const char 
*description);
 
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH] avutil/parseutils: add av_warn_unused_result

2015-10-15 Thread James Almer
On 10/15/2015 8:52 PM, Ganesh Ajjanagadde wrote:
> This triggers a few warnings that will need to be fixed - not that bad,
> the current code is mostly fine.
> 

I think i asked you before, but in any case i'll do it again. Please,
send patchsets contained in a single thread. You're making things
hard to track and organize on people's inboxes.
See https://kernel.org/pub/software/scm/git/docs/git-send-email.html
--thread, --chain-reply-to and --in-reply-to options.

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


[FFmpeg-devel] usage of AV_GLUE?

2015-10-15 Thread Ganesh Ajjanagadde
Hi all,

Examining libavutil/macros, there is AV_GLUE/AV_JOIN (why are there
two?) defined for preprocessor token pasting. However, it is not being
used anywhere, instead people have use "##". There are a number of
options regarding this:
1. Start using them, and convert the ## usage to AV_GLUE/AV_JOIN.
2. Don't bother at all.
3. Deprecate and remove them at some point.

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


Re: [FFmpeg-devel] [PATCH] avutil/parseutils: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 8:06 PM, James Almer  wrote:
> On 10/15/2015 8:52 PM, Ganesh Ajjanagadde wrote:
>> This triggers a few warnings that will need to be fixed - not that bad,
>> the current code is mostly fine.
>>
>
> I think i asked you before, but in any case i'll do it again. Please,
> send patchsets contained in a single thread. You're making things
> hard to track and organize on people's inboxes.
> See https://kernel.org/pub/software/scm/git/docs/git-send-email.html
> --thread, --chain-reply-to and --in-reply-to options.

Would greatly appreciate a command/command sequence: I am on master
(which is ahead of origin/master) and contains only the avutil warning
stuff (many commits). How do I get a proper chain of emails that you
would like?

>
> Thanks.
> ___
> 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] avutil/crc: add av_warn_unused_result to av_crc_init

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 9:24 PM, Michael Niedermayer
 wrote:
> On Thu, Oct 15, 2015 at 07:32:45PM -0400, Ganesh Ajjanagadde wrote:
>> This triggers useful warnings in avcodec/mlp that need to be fixed.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavutil/crc.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/libavutil/crc.h b/libavutil/crc.h
>> index e86bf1d..75929b2 100644
>> --- a/libavutil/crc.h
>> +++ b/libavutil/crc.h
>> @@ -60,6 +60,7 @@ typedef enum {
>>   * @param ctx_size size of ctx in bytes
>>   * @return <0 on failure
>>   */
>> +av_warn_unused_result
>>  int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
>
> this can only fail currently due to invalid/unsupported arguments
> being used
> a user application which uses only known to be good arguments
> does not need to check the return value

Yes, I forgot to add this to the "controversial list" - which contains
all the crypto stuff as well. Consider it dropped. Apologies.

>
>
> [...]
> --
> 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.
>
> ___
> 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] avutil/parseutils: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 10:22 PM, Ganesh Ajjanagadde  wrote:
> On Thu, Oct 15, 2015 at 10:16 PM, James Almer  wrote:
>> On 10/15/2015 10:23 PM, Ganesh Ajjanagadde wrote:
>>> On Thu, Oct 15, 2015 at 8:06 PM, James Almer  wrote:
 On 10/15/2015 8:52 PM, Ganesh Ajjanagadde wrote:
> This triggers a few warnings that will need to be fixed - not that bad,
> the current code is mostly fine.
>

 I think i asked you before, but in any case i'll do it again. Please,
 send patchsets contained in a single thread. You're making things
 hard to track and organize on people's inboxes.
 See https://kernel.org/pub/software/scm/git/docs/git-send-email.html
 --thread, --chain-reply-to and --in-reply-to options.
>>>
>>> Would greatly appreciate a command/command sequence: I am on master
>>> (which is ahead of origin/master) and contains only the avutil warning
>>> stuff (many commits). How do I get a proper chain of emails that you
>>> would like?
>>>

 Thanks.
>>
>> When you send several mails with a single git send-email command, it
>> should by default send every email after the first as a reply to the
>> first, effectively making a single "thread".
>
> Sorry, but gmail smtp/send-email does not let me do this - I have
> tried multiple patches in a single git send-email, and it closes the
> connection.

The engineers at Google must have fixed something - I tried it just
now in the manner you described for the avdevice patches.

>
>>
>> When you send one email at a time, you'll have to use --in-reply-to
>> as part of the git send-email command, using the message ID of the email
>> you want as parent as argument.
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 04/11] avdevice/alsa: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This does not trigger any warnings, but adds robustness.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavdevice/alsa.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavdevice/alsa.h b/libavdevice/alsa.h
index f8b7449..cd41d96 100644
--- a/libavdevice/alsa.h
+++ b/libavdevice/alsa.h
@@ -74,6 +74,7 @@ typedef struct AlsaData {
  *
  * @return 0 if OK, AVERROR_xxx on error
  */
+av_warn_unused_result
 int ff_alsa_open(AVFormatContext *s, snd_pcm_stream_t mode,
  unsigned int *sample_rate,
  int channels, enum AVCodecID *codec_id);
@@ -95,10 +96,13 @@ int ff_alsa_close(AVFormatContext *s1);
  *
  * @return 0 if OK, AVERROR_xxx on error
  */
+av_warn_unused_result
 int ff_alsa_xrun_recover(AVFormatContext *s1, int err);
 
+av_warn_unused_result
 int ff_alsa_extend_reorder_buf(AlsaData *s, int size);
 
+av_warn_unused_result
 int ff_alsa_get_device_list(AVDeviceInfoList *device_list, snd_pcm_stream_t 
stream_type);
 
 #endif /* AVDEVICE_ALSA_H */
-- 
2.6.1

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


[FFmpeg-devel] [PATCH 05/11] avdevice/decklink_common: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This should not trigger any warnings, but adds robustness.
Untested.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavdevice/decklink_common.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h
index 3bc30f0..eb13a1b 100644
--- a/libavdevice/decklink_common.h
+++ b/libavdevice/decklink_common.h
@@ -96,8 +96,12 @@ typedef uint32_t buffercount_type;
 
 
 HRESULT ff_decklink_get_display_name(IDeckLink *This, const char 
**displayName);
+av_warn_unused_result
 int ff_decklink_set_format(AVFormatContext *avctx, int width, int height, int 
tb_num, int tb_den, decklink_direction_t direction = DIRECTION_OUT, int num = 
0);
+av_warn_unused_result
 int ff_decklink_set_format(AVFormatContext *avctx, decklink_direction_t 
direction, int num);
+av_warn_unused_result
 int ff_decklink_list_devices(AVFormatContext *avctx);
+av_warn_unused_result
 int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t 
direction = DIRECTION_OUT);
 
-- 
2.6.1

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


[FFmpeg-devel] [PATCH 07/11] avdevice/avdevice: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This triggers a bunch of warnings that need to be fixed.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavdevice/avdevice.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h
index 6b0446c..23611e6 100644
--- a/libavdevice/avdevice.h
+++ b/libavdevice/avdevice.h
@@ -302,6 +302,7 @@ enum AVDevToAppMessageType {
  * @return >= 0 on success, negative on error.
  * AVERROR(ENOSYS) when device doesn't implement handler of the 
message.
  */
+av_warn_unused_result
 int avdevice_app_to_dev_control_message(struct AVFormatContext *s,
 enum AVAppToDevMessageType type,
 void *data, size_t data_size);
@@ -316,6 +317,7 @@ int avdevice_app_to_dev_control_message(struct 
AVFormatContext *s,
  * @return >= 0 on success, negative on error.
  * AVERROR(ENOSYS) when application doesn't implement handler of the 
message.
  */
+av_warn_unused_result
 int avdevice_dev_to_app_control_message(struct AVFormatContext *s,
 enum AVDevToAppMessageType type,
 void *data, size_t data_size);
@@ -434,6 +436,7 @@ extern const AVOption av_device_capabilities[];
  *
  * @return >= 0 on success, negative otherwise.
  */
+av_warn_unused_result
 int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, 
AVFormatContext *s,
  AVDictionary **device_options);
 
@@ -475,6 +478,7 @@ typedef struct AVDeviceInfoList {
  * @param[out] device_list list of autodetected devices.
  * @return count of autodetected devices, negative on error.
  */
+av_warn_unused_result
 int avdevice_list_devices(struct AVFormatContext *s, AVDeviceInfoList 
**device_list);
 
 /**
@@ -501,8 +505,10 @@ void avdevice_free_list_devices(AVDeviceInfoList 
**device_list);
  * @return count of autodetected devices, negative on error.
  * @note device argument takes precedence over device_name when both are set.
  */
+av_warn_unused_result
 int avdevice_list_input_sources(struct AVInputFormat *device, const char 
*device_name,
 AVDictionary *device_options, AVDeviceInfoList 
**device_list);
+av_warn_unused_result
 int avdevice_list_output_sinks(struct AVOutputFormat *device, const char 
*device_name,
AVDictionary *device_options, AVDeviceInfoList 
**device_list);
 
-- 
2.6.1

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


[FFmpeg-devel] [PATCH 06/11] avdevice/decklink_enc: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
Should not trigger any warnings, but adds robustness.
Untested.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavdevice/decklink_enc.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavdevice/decklink_enc.h b/libavdevice/decklink_enc.h
index 6086947..462e031 100644
--- a/libavdevice/decklink_enc.h
+++ b/libavdevice/decklink_enc.h
@@ -23,7 +23,9 @@
 extern "C" {
 #endif
 
+av_warn_unused_result
 int ff_decklink_write_header(AVFormatContext *avctx);
+av_warn_unused_result
 int ff_decklink_write_packet(AVFormatContext *avctx, AVPacket *pkt);
 int ff_decklink_write_trailer(AVFormatContext *avctx);
 
-- 
2.6.1

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


Re: [FFmpeg-devel] usage of AV_GLUE?

2015-10-15 Thread Ronald S. Bultje
Hi,

On Thu, Oct 15, 2015 at 8:37 PM, Ganesh Ajjanagadde 
wrote:

> Hi all,
>
> Examining libavutil/macros, there is AV_GLUE/AV_JOIN (why are there
> two?) defined for preprocessor token pasting. However, it is not being
> used anywhere, instead people have use "##". There are a number of
> options regarding this:
> 1. Start using them, and convert the ## usage to AV_GLUE/AV_JOIN.
> 2. Don't bother at all.
> 3. Deprecate and remove them at some point.
>

 ../libavcodec/flacdsp_lpc_template.c:#define FUNC(n) AV_JOIN(n ## _,
SAMPLE_SIZE)
../libavcodec/flacdsp_template.c:#   define FSUF   AV_JOIN(SAMPLE_SIZE, p)
../libavcodec/flacdsp_template.c:#define FUNC(n) AV_JOIN(n ## _, FSUF)
../libavcodec/h264_mb_template.c:#   define FUNC(n) AV_JOIN(n ## _simple_,
BITS)

You have to understand _why_ we use this. The problem is that in some cases
(sometimes in a compiler-dependent way, other times more generally), you
need to expand preprocessor tokens before concatenating them. Older
versions of MSVC were bad at this, but you can see gcc suffers from it also
if you look for uses of cat() in
libavcodec/x86/vp9dsp_init_16bpp_template.c. If you change cat into just
##, it stops working.

And yes, cat, should probably be AV_JOIN, I forgot about AV_JOIN.

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


[FFmpeg-devel] [PATCH] avfilter/avfilter: Error out if audio parameters change instead of failing an assert

2015-10-15 Thread Michael Niedermayer
From: Michael Niedermayer 

Filters which support such changes should be excluded from these checks

Fixes Ticket4884

Signed-off-by: Michael Niedermayer 
---
 libavfilter/avfilter.c |   23 +++
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 51926bf..8b1b7d2 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1147,10 +1147,22 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
 av_assert1(frame->height   == link->h);
 }
 } else {
-av_assert1(frame->format== link->format);
-av_assert1(av_frame_get_channels(frame) == link->channels);
-av_assert1(frame->channel_layout== link->channel_layout);
-av_assert1(frame->sample_rate   == link->sample_rate);
+if (frame->format != link->format) {
+av_log(link->dst, AV_LOG_ERROR, "Format change is not 
supported\n");
+goto error;
+}
+if (av_frame_get_channels(frame) != link->channels) {
+av_log(link->dst, AV_LOG_ERROR, "Channel count change is not 
supported\n");
+goto error;
+}
+if (frame->channel_layout != link->channel_layout) {
+av_log(link->dst, AV_LOG_ERROR, "Channel layout change is not 
supported\n");
+goto error;
+}
+if (frame->sample_rate != link->sample_rate) {
+av_log(link->dst, AV_LOG_ERROR, "Sample rate change is not 
supported\n");
+goto error;
+}
 }
 
 /* Go directly to actual filtering if possible */
@@ -1163,6 +1175,9 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
 } else {
 return ff_filter_frame_framed(link, frame);
 }
+error:
+av_frame_free();
+return AVERROR_PATCHWELCOME;
 }
 
 const AVClass *avfilter_get_class(void)
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH] avutil/buffer: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 6:22 PM, Ganesh Ajjanagadde
 wrote:
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavutil/buffer.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libavutil/buffer.h b/libavutil/buffer.h
> index b4399fd..6f03677 100644
> --- a/libavutil/buffer.h
> +++ b/libavutil/buffer.h
> @@ -178,6 +178,7 @@ int av_buffer_get_ref_count(const AVBufferRef *buf);
>   *written in its place. On failure, buf is left untouched.
>   * @return 0 on success, a negative AVERROR on failure.
>   */
> +av_warn_unused_result
>  int av_buffer_make_writable(AVBufferRef **buf);
>
>  /**
> @@ -195,6 +196,7 @@ int av_buffer_make_writable(AVBufferRef **buf);
>   * reference to it (i.e. the one passed to this function). In all other cases
>   * a new buffer is allocated and the data is copied.
>   */
> +av_warn_unused_result
>  int av_buffer_realloc(AVBufferRef **buf, int size);
>
>  /**
> --
> 2.6.1
>

forgot to add the attributes header, patchv2 coming.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avutil/audio_fifo: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This one should not trigger any warnings, but will be useful for future
robustness.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/audio_fifo.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/audio_fifo.h b/libavutil/audio_fifo.h
index d93be2a..24f91da 100644
--- a/libavutil/audio_fifo.h
+++ b/libavutil/audio_fifo.h
@@ -73,6 +73,7 @@ AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat 
sample_fmt, int channels,
  * @param nb_samples  new allocation size, in samples
  * @return0 if OK, or negative AVERROR code on failure
  */
+av_warn_unused_result
 int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
 
 /**
-- 
2.6.1

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


[FFmpeg-devel] [PATCH] avutil/sha512: add av_warn_unused_result to av_sha512_init

2015-10-15 Thread Ganesh Ajjanagadde
This will trigger some useful warnings in avutil/hash that need to be fixed.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/sha512.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/sha512.h b/libavutil/sha512.h
index 7b08701..6aecf31 100644
--- a/libavutil/sha512.h
+++ b/libavutil/sha512.h
@@ -49,6 +49,7 @@ struct AVSHA512 *av_sha512_alloc(void);
  * @param bitsnumber of bits in digest (224, 256, 384 or 512 bits)
  * @returnzero if initialization succeeded, -1 otherwise
  */
+av_warn_unused_result
 int av_sha512_init(struct AVSHA512* context, int bits);
 
 /**
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH] avutil/imgutils: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 8:52 PM, Ganesh Ajjanagadde
 wrote:
> This will trigger a few warnings, mainly in swscale.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavutil/imgutils.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
> index 23282a3..164d0ad 100644
> --- a/libavutil/imgutils.h
> +++ b/libavutil/imgutils.h
> @@ -65,6 +65,7 @@ int av_image_get_linesize(enum AVPixelFormat pix_fmt, int 
> width, int plane);
>   * @param linesizes array to be filled with the linesize for each plane
>   * @return >= 0 in case of success, a negative error code otherwise
>   */
> +av_warn_unused_result
>  int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, 
> int width);
>
>  /**
> @@ -78,6 +79,7 @@ int av_image_fill_linesizes(int linesizes[4], enum 
> AVPixelFormat pix_fmt, int wi
>   * @return the size in bytes required for the image buffer, a negative
>   * error code in case of failure
>   */
> +av_warn_unused_result
>  int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int 
> height,
> uint8_t *ptr, const int linesizes[4]);
>
> @@ -91,6 +93,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum 
> AVPixelFormat pix_fmt, int hei
>   * @return the size in bytes required for the image buffer, a negative
>   * error code in case of failure
>   */
> +av_warn_unused_result
>  int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
> int w, int h, enum AVPixelFormat pix_fmt, int align);
>
> --
> 2.6.1
>

please ignore - I am going to put them all in a single thread.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avutil/crc: add av_warn_unused_result to av_crc_init

2015-10-15 Thread Michael Niedermayer
On Thu, Oct 15, 2015 at 07:32:45PM -0400, Ganesh Ajjanagadde wrote:
> This triggers useful warnings in avcodec/mlp that need to be fixed.
> 
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavutil/crc.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavutil/crc.h b/libavutil/crc.h
> index e86bf1d..75929b2 100644
> --- a/libavutil/crc.h
> +++ b/libavutil/crc.h
> @@ -60,6 +60,7 @@ typedef enum {
>   * @param ctx_size size of ctx in bytes
>   * @return <0 on failure
>   */
> +av_warn_unused_result
>  int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);

this can only fail currently due to invalid/unsupported arguments
being used
a user application which uses only known to be good arguments
does not need to check the return value


[...]
-- 
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


[FFmpeg-devel] [PATCH] avutil/frame: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This is going to trigger a lot of warnings all over the place that need
fixing. Main culprits are in avfilter, when one tries to copy a frame
without checking whether src and dest formats actually are compatible.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/frame.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavutil/frame.h b/libavutil/frame.h
index 9c6061a..5dfac64 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -575,6 +575,7 @@ void av_frame_free(AVFrame **frame);
  *
  * @return 0 on success, a negative AVERROR on error
  */
+av_warn_unused_result
 int av_frame_ref(AVFrame *dst, const AVFrame *src);
 
 /**
@@ -613,6 +614,7 @@ void av_frame_move_ref(AVFrame *dst, AVFrame *src);
  *
  * @return 0 on success, a negative AVERROR on error.
  */
+av_warn_unused_result
 int av_frame_get_buffer(AVFrame *frame, int align);
 
 /**
@@ -640,6 +642,7 @@ int av_frame_is_writable(AVFrame *frame);
  * @see av_frame_is_writable(), av_buffer_is_writable(),
  * av_buffer_make_writable()
  */
+av_warn_unused_result
 int av_frame_make_writable(AVFrame *frame);
 
 /**
@@ -653,6 +656,7 @@ int av_frame_make_writable(AVFrame *frame);
  *
  * @return >= 0 on success, a negative AVERROR on error.
  */
+av_warn_unused_result
 int av_frame_copy(AVFrame *dst, const AVFrame *src);
 
 /**
@@ -663,6 +667,7 @@ int av_frame_copy(AVFrame *dst, const AVFrame *src);
  * aspect ratio (for video), but not width/height or channel layout.
  * Side data is also copied.
  */
+av_warn_unused_result
 int av_frame_copy_props(AVFrame *dst, const AVFrame *src);
 
 /**
-- 
2.6.1

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


[FFmpeg-devel] [PATCH] avutil/opencl: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This will trigger a few warnings. My config does not compile the opencl
code, so this is untested.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/opencl.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/libavutil/opencl.h b/libavutil/opencl.h
index e423e55..6a5b0ab 100644
--- a/libavutil/opencl.h
+++ b/libavutil/opencl.h
@@ -81,6 +81,7 @@ typedef struct {
  *
  * @return  >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_get_device_list(AVOpenCLDeviceList **device_list);
 
 /**
@@ -108,6 +109,7 @@ void av_opencl_free_device_list(AVOpenCLDeviceList 
**device_list);
  * @return >=0 on success, a negative error code in case of failure
  * @see av_opencl_get_option()
  */
+av_warn_unused_result
 int av_opencl_set_option(const char *key, const char *val);
 
 /**
@@ -119,6 +121,7 @@ int av_opencl_set_option(const char *key, const char *val);
  * @return  >=0 on success, a negative error code in case of failure
  * @see av_opencl_set_option()
  */
+av_warn_unused_result
 int av_opencl_get_option(const char *key, uint8_t **out_val);
 
 /**
@@ -161,6 +164,7 @@ const char *av_opencl_errstr(cl_int status);
  * @param kernel_codekernel code to be compiled in the OpenCL runtime 
environment
  * @return  >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_register_kernel_code(const char *kernel_code);
 
 /**
@@ -170,6 +174,7 @@ int av_opencl_register_kernel_code(const char *kernel_code);
  *   application program, ignored if set to NULL
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_init(AVOpenCLExternalEnv *ext_opencl_env);
 
 /**
@@ -205,6 +210,7 @@ cl_command_queue av_opencl_get_command_queue(void);
  * @param host_ptr host pointer of the OpenCL buffer
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_buffer_create(cl_mem *cl_buf, size_t cl_buf_size, int flags, 
void *host_ptr);
 
 /**
@@ -215,6 +221,7 @@ int av_opencl_buffer_create(cl_mem *cl_buf, size_t 
cl_buf_size, int flags, void
  * @param buf_size  size in bytes of the source and destination buffers
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_buffer_write(cl_mem dst_cl_buf, uint8_t *src_buf, size_t 
buf_size);
 
 /**
@@ -225,6 +232,7 @@ int av_opencl_buffer_write(cl_mem dst_cl_buf, uint8_t 
*src_buf, size_t buf_size)
  * @param buf_size  size in bytes of the source and destination buffers
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_buffer_read(uint8_t *dst_buf, cl_mem src_cl_buf, size_t 
buf_size);
 
 /**
@@ -240,6 +248,7 @@ int av_opencl_buffer_read(uint8_t *dst_buf, cl_mem 
src_cl_buf, size_t buf_size);
  * @param src_plane_num  number of source image planes
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_buffer_write_image(cl_mem dst_cl_buf, size_t cl_buffer_size, int 
dst_cl_offset,
  uint8_t **src_data, int *plane_size, int 
plane_num);
 
@@ -253,6 +262,7 @@ int av_opencl_buffer_write_image(cl_mem dst_cl_buf, size_t 
cl_buffer_size, int d
  * @param src_cl_buf_sizesize in bytes of OpenCL buffer
  * @return >=0 on success, a negative error code in case of failure
  */
+av_warn_unused_result
 int av_opencl_buffer_read_image(uint8_t **dst_data, int *plane_size, int 
plane_num,
 cl_mem src_cl_buf, size_t cl_buffer_size);
 
-- 
2.6.1

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


[FFmpeg-devel] [PATCH] avutil/imgutils: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This will trigger a few warnings, mainly in swscale.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/imgutils.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
index 23282a3..164d0ad 100644
--- a/libavutil/imgutils.h
+++ b/libavutil/imgutils.h
@@ -65,6 +65,7 @@ int av_image_get_linesize(enum AVPixelFormat pix_fmt, int 
width, int plane);
  * @param linesizes array to be filled with the linesize for each plane
  * @return >= 0 in case of success, a negative error code otherwise
  */
+av_warn_unused_result
 int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int 
width);
 
 /**
@@ -78,6 +79,7 @@ int av_image_fill_linesizes(int linesizes[4], enum 
AVPixelFormat pix_fmt, int wi
  * @return the size in bytes required for the image buffer, a negative
  * error code in case of failure
  */
+av_warn_unused_result
 int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int 
height,
uint8_t *ptr, const int linesizes[4]);
 
@@ -91,6 +93,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum 
AVPixelFormat pix_fmt, int hei
  * @return the size in bytes required for the image buffer, a negative
  * error code in case of failure
  */
+av_warn_unused_result
 int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
int w, int h, enum AVPixelFormat pix_fmt, int align);
 
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH] avutil/parseutils: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 10:16 PM, James Almer  wrote:
> On 10/15/2015 10:23 PM, Ganesh Ajjanagadde wrote:
>> On Thu, Oct 15, 2015 at 8:06 PM, James Almer  wrote:
>>> On 10/15/2015 8:52 PM, Ganesh Ajjanagadde wrote:
 This triggers a few warnings that will need to be fixed - not that bad,
 the current code is mostly fine.

>>>
>>> I think i asked you before, but in any case i'll do it again. Please,
>>> send patchsets contained in a single thread. You're making things
>>> hard to track and organize on people's inboxes.
>>> See https://kernel.org/pub/software/scm/git/docs/git-send-email.html
>>> --thread, --chain-reply-to and --in-reply-to options.
>>
>> Would greatly appreciate a command/command sequence: I am on master
>> (which is ahead of origin/master) and contains only the avutil warning
>> stuff (many commits). How do I get a proper chain of emails that you
>> would like?
>>
>>>
>>> Thanks.
>
> When you send several mails with a single git send-email command, it
> should by default send every email after the first as a reply to the
> first, effectively making a single "thread".

Sorry, but gmail smtp/send-email does not let me do this - I have
tried multiple patches in a single git send-email, and it closes the
connection.

>
> When you send one email at a time, you'll have to use --in-reply-to
> as part of the git send-email command, using the message ID of the email
> you want as parent as argument.
> ___
> 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] avutil/parseutils: add av_warn_unused_result

2015-10-15 Thread James Almer
On 10/15/2015 10:23 PM, Ganesh Ajjanagadde wrote:
> On Thu, Oct 15, 2015 at 8:06 PM, James Almer  wrote:
>> On 10/15/2015 8:52 PM, Ganesh Ajjanagadde wrote:
>>> This triggers a few warnings that will need to be fixed - not that bad,
>>> the current code is mostly fine.
>>>
>>
>> I think i asked you before, but in any case i'll do it again. Please,
>> send patchsets contained in a single thread. You're making things
>> hard to track and organize on people's inboxes.
>> See https://kernel.org/pub/software/scm/git/docs/git-send-email.html
>> --thread, --chain-reply-to and --in-reply-to options.
> 
> Would greatly appreciate a command/command sequence: I am on master
> (which is ahead of origin/master) and contains only the avutil warning
> stuff (many commits). How do I get a proper chain of emails that you
> would like?
> 
>>
>> Thanks.

When you send several mails with a single git send-email command, it
should by default send every email after the first as a reply to the
first, effectively making a single "thread".

When you send one email at a time, you'll have to use --in-reply-to
as part of the git send-email command, using the message ID of the email
you want as parent as argument.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 01/11] avdevice/internal: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This does not trigger any warnings but adds robustness.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavdevice/internal.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavdevice/internal.h b/libavdevice/internal.h
index 3cd1b06..e222cf2 100644
--- a/libavdevice/internal.h
+++ b/libavdevice/internal.h
@@ -21,6 +21,7 @@
 
 #include "libavformat/avformat.h"
 
+av_warn_unused_result
 int ff_alloc_input_device_context(struct AVFormatContext **avctx, struct 
AVInputFormat *iformat,
   const char *format);
 
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH] avutil/cast5: update Doxygen for av_castt_init with return information

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 10:08 PM, Michael Niedermayer
 wrote:
> On Thu, Oct 15, 2015 at 05:44:49PM -0400, Ganesh Ajjanagadde wrote:
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavutil/cast5.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/libavutil/cast5.h b/libavutil/cast5.h
>> index e5cc8b1..68513e5 100644
>> --- a/libavutil/cast5.h
>> +++ b/libavutil/cast5.h
>> @@ -48,6 +48,7 @@ struct AVCAST5 *av_cast5_alloc(void);
>>* @param ctx an AVCAST5 context
>>* @param key a key of 5,6,...16 bytes used for encryption/decryption
>>* @param key_bits number of keybits: possible are 40,48,...,128
>> +  * @return 0 on success, -1 if key_bits is not in the above list
>
> ", less than 0 on failure"
>
> APIs should allow extensions, in the supported values, and the
> information returned

Good point - I saw your change of -1 to AVERROR code for crc_init. If
you are interested, a lot of the crypto stuff (md5, sha, ripemd, etc)
returns -1 in libavutil.
Changed, and pushed.

>
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> If a bugfix only changes things apparently unrelated to the bug with no
> further explanation, that is a good sign that the bugfix is wrong.
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 09/11] avdevice/fbdev_common: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This does not trigger any warnings, but adds robustness.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavdevice/fbdev_common.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavdevice/fbdev_common.h b/libavdevice/fbdev_common.h
index 7b81a8d..f19371d 100644
--- a/libavdevice/fbdev_common.h
+++ b/libavdevice/fbdev_common.h
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include "libavutil/pixfmt.h"
+#include "libavutil/attributes.h"
 
 struct AVDeviceInfoList;
 
@@ -33,6 +34,7 @@ enum AVPixelFormat ff_get_pixfmt_from_fb_varinfo(struct 
fb_var_screeninfo *varin
 
 const char* ff_fbdev_default_device(void);
 
+av_warn_unused_result
 int ff_fbdev_get_device_list(struct AVDeviceInfoList *device_list);
 
 #endif /* AVDEVICE_FBDEV_COMMON_H */
-- 
2.6.1

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


[FFmpeg-devel] [PATCH 10/11] avdevice/dshow_capture: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This does not trigger any warnings, but adds robustness.
Untested.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavdevice/dshow_capture.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavdevice/dshow_capture.h b/libavdevice/dshow_capture.h
index b17da10..7f5192b 100644
--- a/libavdevice/dshow_capture.h
+++ b/libavdevice/dshow_capture.h
@@ -40,6 +40,7 @@
 #define EC_DEVICE_LOST 0x1f
 #endif
 
+av_warn_unused_result
 long ff_copy_dshow_media_type(AM_MEDIA_TYPE *dst, const AM_MEDIA_TYPE *src);
 void ff_print_VIDEO_STREAM_CONFIG_CAPS(const VIDEO_STREAM_CONFIG_CAPS *caps);
 void ff_print_AUDIO_STREAM_CONFIG_CAPS(const AUDIO_STREAM_CONFIG_CAPS *caps);
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH][RFC] avutil/time: add av_warn_unused_result to av_usleep

2015-10-15 Thread Hendrik Leppkes
On Thu, Oct 15, 2015 at 11:59 PM, Ganesh Ajjanagadde
 wrote:
> av_usleep can fail. Forcing users to check the error code here may be
> somewhat controversial.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavutil/time.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libavutil/time.h b/libavutil/time.h
> index dc169b0..f55167b 100644
> --- a/libavutil/time.h
> +++ b/libavutil/time.h
> @@ -51,6 +51,7 @@ int av_gettime_relative_is_monotonic(void);
>   * @param  usec Number of microseconds to sleep.
>   * @return zero on success or (negative) error code.
>   */
> +av_warn_unused_result
>  int av_usleep(unsigned usec);
>
>  #endif /* AVUTIL_TIME_H */
> --
> 2.6.1

Checking if your sleep failed is kinda silly. What do you want to do, try again?
Its just a sleep afterall.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avutil/cast5: update Doxygen for av_castt_init with return information

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 5:44 PM, Ganesh Ajjanagadde
 wrote:
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavutil/cast5.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libavutil/cast5.h b/libavutil/cast5.h
> index e5cc8b1..68513e5 100644
> --- a/libavutil/cast5.h
> +++ b/libavutil/cast5.h
> @@ -48,6 +48,7 @@ struct AVCAST5 *av_cast5_alloc(void);
>* @param ctx an AVCAST5 context
>* @param key a key of 5,6,...16 bytes used for encryption/decryption
>* @param key_bits number of keybits: possible are 40,48,...,128
> +  * @return 0 on success, -1 if key_bits is not in the above list
>   */
>  int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits);
>
> --
> 2.6.1
>

commit message: castt -> cast5.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH][RFC] avutil/time: add av_warn_unused_result to av_usleep

2015-10-15 Thread Ganesh Ajjanagadde
On Thu, Oct 15, 2015 at 6:01 PM, Hendrik Leppkes  wrote:
> On Thu, Oct 15, 2015 at 11:59 PM, Ganesh Ajjanagadde
>  wrote:
>> av_usleep can fail. Forcing users to check the error code here may be
>> somewhat controversial.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavutil/time.h | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/libavutil/time.h b/libavutil/time.h
>> index dc169b0..f55167b 100644
>> --- a/libavutil/time.h
>> +++ b/libavutil/time.h
>> @@ -51,6 +51,7 @@ int av_gettime_relative_is_monotonic(void);
>>   * @param  usec Number of microseconds to sleep.
>>   * @return zero on success or (negative) error code.
>>   */
>> +av_warn_unused_result
>>  int av_usleep(unsigned usec);
>>
>>  #endif /* AVUTIL_TIME_H */
>> --
>> 2.6.1
>
> Checking if your sleep failed is kinda silly. What do you want to do, try 
> again?
> Its just a sleep afterall.

Yes, this was why I marked this as an RFC. Patch dropped. Thanks.

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


[FFmpeg-devel] [PATCH] avutil/samplefmt: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/samplefmt.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/samplefmt.h b/libavutil/samplefmt.h
index 6a8a031..246147f 100644
--- a/libavutil/samplefmt.h
+++ b/libavutil/samplefmt.h
@@ -222,6 +222,7 @@ int av_samples_fill_arrays(uint8_t **audio_data, int 
*linesize,
  * @see av_samples_fill_arrays()
  * @see av_samples_alloc_array_and_samples()
  */
+av_warn_unused_result
 int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
  int nb_samples, enum AVSampleFormat sample_fmt, int 
align);
 
@@ -234,6 +235,7 @@ int av_samples_alloc(uint8_t **audio_data, int *linesize, 
int nb_channels,
  *
  * @see av_samples_alloc()
  */
+av_warn_unused_result
 int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, 
int nb_channels,
int nb_samples, enum AVSampleFormat 
sample_fmt, int align);
 
-- 
2.6.1

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


[FFmpeg-devel] [PATCH] avutil/mem: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
This adds av_warn_unused_result to functions whose return codes need to
be checked.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/mem.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavutil/mem.h b/libavutil/mem.h
index 2a1e36d..285697c 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -144,6 +144,7 @@ void *av_realloc_f(void *ptr, size_t nelem, size_t elsize);
  *  The situation is undefined according to POSIX and may crash with
  *  some libc implementations.
  */
+av_warn_unused_result
 int av_reallocp(void *ptr, size_t size);
 
 /**
@@ -304,6 +305,7 @@ void av_dynarray_add(void *tab_ptr, int *nb_ptr, void 
*elem);
  * @return >=0 on success, negative otherwise.
  * @see av_dynarray_add(), av_dynarray2_add()
  */
+av_warn_unused_result
 int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem);
 
 /**
@@ -334,6 +336,7 @@ void *av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t 
elem_size,
  * Multiply two size_t values checking for overflow.
  * @return  0 if success, AVERROR(EINVAL) if overflow.
  */
+av_warn_unused_result
 static inline int av_size_mult(size_t a, size_t b, size_t *r)
 {
 size_t t = a * b;
-- 
2.6.1

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


[FFmpeg-devel] [PATCH] avutil/cast5: update Doxygen for av_castt_init with return information

2015-10-15 Thread Ganesh Ajjanagadde
Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/cast5.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/cast5.h b/libavutil/cast5.h
index e5cc8b1..68513e5 100644
--- a/libavutil/cast5.h
+++ b/libavutil/cast5.h
@@ -48,6 +48,7 @@ struct AVCAST5 *av_cast5_alloc(void);
   * @param ctx an AVCAST5 context
   * @param key a key of 5,6,...16 bytes used for encryption/decryption
   * @param key_bits number of keybits: possible are 40,48,...,128
+  * @return 0 on success, -1 if key_bits is not in the above list
  */
 int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits);
 
-- 
2.6.1

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


[FFmpeg-devel] [PATCH] libavformat/Makefile: remove unnecessary object file from wtv demuxer

2015-10-15 Thread Hendrik Leppkes
The wtv demuxer doesn't reference any functionality from asfdec_f
---
 libavformat/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index c58cfb4..b8eb30b 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -471,7 +471,7 @@ OBJS-$(CONFIG_WEBVTT_DEMUXER)+= webvttdec.o 
subtitles.o
 OBJS-$(CONFIG_WEBVTT_MUXER)  += webvttenc.o
 OBJS-$(CONFIG_WSAUD_DEMUXER) += westwood_aud.o
 OBJS-$(CONFIG_WSVQA_DEMUXER) += westwood_vqa.o
-OBJS-$(CONFIG_WTV_DEMUXER)   += wtvdec.o wtv_common.o asfdec_f.o 
asf.o asfcrypt.o \
+OBJS-$(CONFIG_WTV_DEMUXER)   += wtvdec.o wtv_common.o asf.o 
asfcrypt.o \
 avlanguage.o mpegts.o isom.o
 OBJS-$(CONFIG_WTV_MUXER) += wtvenc.o wtv_common.o \
 mpegtsenc.o asf.o
-- 
2.5.3.windows.1

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


[FFmpeg-devel] [PATCH] avutil/opt: add av_warn_unused_result

2015-10-15 Thread Ganesh Ajjanagadde
Some warnings do get triggered that will need to be fixed.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavutil/opt.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/opt.h b/libavutil/opt.h
index 753434d..5abe963 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -414,6 +414,7 @@ void av_opt_set_defaults2(void *s, int mask, int flags);
  * the error code issued by av_opt_set() if a key/value pair
  * cannot be set
  */
+av_warn_unused_result
 int av_set_options_string(void *ctx, const char *opts,
   const char *key_val_sep, const char *pairs_sep);
 
@@ -444,6 +445,7 @@ int av_set_options_string(void *ctx, const char *opts,
  * Separators must use characters distinct from option names and from each
  * other.
  */
+av_warn_unused_result
 int av_opt_set_from_string(void *ctx, const char *opts,
const char *const *shorthand,
const char *key_val_sep, const char *pairs_sep);
-- 
2.6.1

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


  1   2   >