[FFmpeg-devel] [PATCH] vf_colorspace: Add support for jedec p22 primaries

2017-06-07 Thread Vittorio Giovara
Signed-off-by: Vittorio Giovara 
---
Refreshing an old patch from last November...

After this, vf_colorspace supports *all* the primaries recognized
by libavutil.
Vittorio

 doc/filters.texi| 3 +++
 libavfilter/vf_colorspace.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/doc/filters.texi b/doc/filters.texi
index 65eef89d07..ba9247d29e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -5606,6 +5606,9 @@ SMPTE-432
 @item bt2020
 BT.2020
 
+@item jedec-p22
+JEDEC P22 phosphors
+
 @end table
 
 @anchor{range}
diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index b0bc4d9a3b..d1e9a1c609 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -296,6 +296,7 @@ static const struct ColorPrimaries 
color_primaries[AVCOL_PRI_NB] = {
 [AVCOL_PRI_SMPTE432]  = { WP_D65, 0.680, 0.320, 0.265, 0.690, 0.150, 0.060 
},
 [AVCOL_PRI_FILM]  = { WP_C,   0.681, 0.319, 0.243, 0.692, 0.145, 0.049 
},
 [AVCOL_PRI_BT2020]= { WP_D65, 0.708, 0.292, 0.170, 0.797, 0.131, 0.046 
},
+[AVCOL_PRI_JEDEC_P22] = { WP_D65, 0.630, 0.340, 0.295, 0.605, 0.155, 0.077 
},
 };
 
 static const struct ColorPrimaries *get_color_primaries(enum AVColorPrimaries 
prm)
@@ -1112,6 +1113,7 @@ static const AVOption colorspace_options[] = {
 ENUM("smpte431", AVCOL_PRI_SMPTE431,   "prm"),
 ENUM("smpte432", AVCOL_PRI_SMPTE432,   "prm"),
 ENUM("bt2020",   AVCOL_PRI_BT2020, "prm"),
+ENUM("jedec-p22",AVCOL_PRI_JEDEC_P22,  "prm"),
 
 { "trc","Output transfer characteristics",
   OFFSET(user_trc),   AV_OPT_TYPE_INT, { .i64 = AVCOL_TRC_UNSPECIFIED },
-- 
2.12.0

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


Re: [FFmpeg-devel] [PATCH] vf_colorspace: Add support for smpte248 color primaries

2017-06-07 Thread Vittorio Giovara
On Wed, Jun 7, 2017 at 7:36 PM, Kieran O Leary  wrote:
> Hi,
>
> Should the vf colorspace documentation be updated with this new addition?

Oh right, I forgot sorry.
Do you want to do the honors since I forgot also about gbr?
-- 
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V2] lavc/golomb: Fix UE golomb overwrite issue.

2017-06-07 Thread Jun Zhao


On 2017/6/7 11:17, Jun Zhao wrote:
> 
> 
> On 2017/6/7 9:22, Michael Niedermayer wrote:
>> On Mon, Jun 05, 2017 at 08:43:35AM +0800, Jun Zhao wrote:
>>> V2: Add Add set_ue_golomb_long() to support 32bits UE golomb and update the 
>>> unit test.
>>
>>>  golomb.h   |   20 +++-
>>>  put_bits.h |   35 +++
>>>  tests/golomb.c |   19 +++
>>>  3 files changed, 73 insertions(+), 1 deletion(-)
>>> 491565dd491fc4ebd1717069d9c7655bfe0bd08a  
>>> 0001-lavc-golomb-Fix-UE-golomb-overwrite-issue.patch
>>> From 6fe36e4e2a41f70e2a41c5eba90b5143b4eeba7b Mon Sep 17 00:00:00 2001
>>> From: Jun Zhao 
>>> Date: Fri, 2 Jun 2017 15:05:49 +0800
>>> Subject: [PATCH V2] lavc/golomb: Fix UE golomb overwrite issue.
>>>
>>> put_bits just support write up to 31 bits, when write 32 bit in
>>> put_bits, it's will overwrite the bit buffer, because the default
>>> assert level is 0, the av_assert2(n <= 31 && value < (1U << n))
>>> in put_bits can not be trigger runtime. Add set_ue_golomb_long()
>>> to support 32bits UE golomb.
>>>
>>> Signed-off-by: Jun Zhao 
>>> ---
>>>  libavcodec/golomb.h   | 20 +++-
>>>  libavcodec/put_bits.h | 35 +++
>>>  libavcodec/tests/golomb.c | 19 +++
>>>  3 files changed, 73 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
>>> index 0833aff468..47ab884282 100644
>>> --- a/libavcodec/golomb.h
>>> +++ b/libavcodec/golomb.h
>>> @@ -458,7 +458,7 @@ static inline int get_te(GetBitContext *s, int r, char 
>>> *file, const char *func,
>>>  #endif /* TRACE */
>>>  
>>>  /**
>>> - * write unsigned exp golomb code.
>>> + * write unsigned exp golomb code. 2^16-2 at most.
>>>   */
>>>  static inline void set_ue_golomb(PutBitContext *pb, int i)
>>>  {
>>> @@ -473,6 +473,24 @@ static inline void set_ue_golomb(PutBitContext *pb, 
>>> int i)
>>>  }
>>>  
>>>  /**
>>> + * write unsigned exp golomb code. 2^32-2 at most.
>>> + */
>>> +static inline void set_ue_golomb_long(PutBitContext *pb, uint32_t i)
>>> +{
>>> +av_assert2(i <= (0x - 2));
>>> +
>>> +if (i < 256)
>>> +put_bits(pb, ff_ue_golomb_len[i], i + 1);
>>> +else {
>>
>> Please add {} for if else so its if { } else
>>
> 
> Ok, will add {} for if.
> 
>>> +int e = av_log2(i + 1);
>>> +if (e < 16)
>>> +put_bits(pb, 2 * e + 1, i + 1);
>>> +else
>>
>>> +put_bits64(pb, 2 * e + 1, i + 1);
>>
>> put_bits64 tests for <32 it tests for ==64 neither are possible
>> here. And this is a inline function so these impossible code pathes
>> might get duplicated many times
>>
>> [...]
> 
> I think av_assert2(i <= (0x - 2)) have cover this condition, and maybe
> av_assert0(i <= (0x - 2)) is a better choice for this assert.
> 

I make a mistake for this comment, will clean the code logic to use put_bit64 
when e >=16

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


[FFmpeg-devel] [PATCH V3] lavc/golomb: Fix UE golomb overwrite issue.

2017-06-07 Thread Jun Zhao
V3: Clean the code logic base on Michael's review.
V2: Add Add set_ue_golomb_long() to support 32bits UE golomb and update the 
unit test.
From 4de3e0c30af7bc1901562000eda018a6d6849292 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Fri, 2 Jun 2017 15:05:49 +0800
Subject: [PATCH V3] lavc/golomb: Fix UE golomb overwrite issue.

put_bits just support write up to 31 bits, when write 32 bit in
put_bits, it's will overwrite the bit buffer, because the default
assert level is 0, the av_assert2(n <= 31 && value < (1U << n))
in put_bits can not be trigger runtime. Add set_ue_golomb_long()
to support 32bits UE golomb.

Signed-off-by: Jun Zhao 
---
 libavcodec/golomb.h   | 17 -
 libavcodec/put_bits.h | 35 +++
 libavcodec/tests/golomb.c | 19 +++
 3 files changed, 70 insertions(+), 1 deletion(-)

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 0833aff468..cba4861b10 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -458,7 +458,7 @@ static inline int get_te(GetBitContext *s, int r, char 
*file, const char *func,
 #endif /* TRACE */
 
 /**
- * write unsigned exp golomb code.
+ * write unsigned exp golomb code. 2^16-2 at most.
  */
 static inline void set_ue_golomb(PutBitContext *pb, int i)
 {
@@ -473,6 +473,21 @@ static inline void set_ue_golomb(PutBitContext *pb, int i)
 }
 
 /**
+ * write unsigned exp golomb code. 2^32-2 at most.
+ */
+static inline void set_ue_golomb_long(PutBitContext *pb, uint32_t i)
+{
+av_assert2(i <= (0x - 2));
+
+if (i < 256)
+put_bits(pb, ff_ue_golomb_len[i], i + 1);
+else {
+int e = av_log2(i + 1);
+put_bits64(pb, 2 * e + 1, i + 1);
+}
+}
+
+/**
  * write truncated unsigned exp golomb code.
  */
 static inline void set_te_golomb(PutBitContext *pb, int i, int range)
diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index 68ed391195..06f0ebbeba 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -221,6 +221,41 @@ static void av_unused put_bits32(PutBitContext *s, 
uint32_t value)
 }
 
 /**
+ * Write up to 64 bits into a bitstream.
+ */
+static inline void put_bits64(PutBitContext *s, int n, uint64_t value)
+{
+av_assert2(n <= 64 && value < (1UL << n));
+
+if (n < 32)
+put_bits(s, n, value);
+else if (n == 32)
+put_bits32(s, value);
+else if (n < 64) {
+uint32_t lo = value & 0x;
+uint32_t hi = value >> 32;
+#ifdef BITSTREAM_WRITER_LE
+put_bits32(s, lo);
+put_bits(s, n - 32, hi);
+#else
+put_bits(s, n - 32, hi);
+put_bits32(s, lo);
+#endif
+} else {
+uint32_t lo = value & 0x;
+uint32_t hi = value >> 32;
+#ifdef BITSTREAM_WRITER_LE
+put_bits32(s, lo);
+put_bits32(s, hi);
+#else
+put_bits32(s, hi);
+put_bits32(s, lo);
+#endif
+
+}
+}
+
+/**
  * Return the pointer to the byte where the bitstream writer will put
  * the next bit.
  */
diff --git a/libavcodec/tests/golomb.c b/libavcodec/tests/golomb.c
index 965367b7be..85b8a9390b 100644
--- a/libavcodec/tests/golomb.c
+++ b/libavcodec/tests/golomb.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 
+#include "libavutil/internal.h"
 #include "libavutil/mem.h"
 
 #include "libavcodec/get_bits.h"
@@ -76,6 +77,24 @@ int main(void)
 }
 }
 
+#define EXTEND_L(i) ((i) << 4 | (i) & 15)
+init_put_bits(, temp, SIZE);
+for (i = 0; i < COUNT; i++)
+set_ue_golomb_long(, EXTEND_L(i));
+flush_put_bits();
+
+init_get_bits(, temp, 8 * SIZE);
+for (i = 0; i < COUNT; i++) {
+int j, s = show_bits_long(, 32);
+
+j = get_ue_golomb_long();
+if (j != EXTEND_L(i)) {
+fprintf(stderr, "get_ue_golomb_long: expected %d, got %d. "
+"bits: %8x\n", EXTEND_L(i), j, s);
+ret = 1;
+}
+}
+
 init_put_bits(, temp, SIZE);
 for (i = 0; i < COUNT; i++)
 set_se_golomb(, i - COUNT / 2);
-- 
2.11.0

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


Re: [FFmpeg-devel] [PATCH] vf_colorspace: Add support for smpte248 color primaries

2017-06-07 Thread Kieran O Leary
Hi,

Should the vf colorspace documentation be updated with this new addition?

Best,

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


Re: [FFmpeg-devel] [PATCH] MAINTAINERS: Add Manojkumar Bhosale for MIPS, remove myself.

2017-06-07 Thread Michael Niedermayer
On Wed, Jun 07, 2017 at 03:25:51PM +0200, Nedeljko Babic wrote:
> Manojkumar is taking over MIPS maintenance.
> 
> Signed-off-by: Nedeljko Babic 
> ---
>  MAINTAINERS | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied

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


Re: [FFmpeg-devel] [PATCH] vf_colorspace: Add support for smpte248 color primaries

2017-06-07 Thread Ronald S. Bultje
Hi,

On Wed, Jun 7, 2017 at 5:50 PM, Vittorio Giovara  wrote:

> +ENUM("smpte248", AVCOL_PRI_SMPTE428,   "prm"),


428 or 248?

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


Re: [FFmpeg-devel] [PATCH] libavformat/avio: fix retry_transfer_wrapper return value on error

2017-06-07 Thread Michael Niedermayer
On Mon, Jun 05, 2017 at 08:43:56PM +0200, Daniel Kucera wrote:
> Signed-off-by: Daniel Kucera 
> ---
>  libavformat/avio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

breaks fate-indeo3-2

--- ./tests/ref/fate/indeo3-2   2017-06-07 00:13:40.271727575 +0200
+++ tests/data/fate/indeo3-22017-06-08 01:00:03.832614524 +0200
@@ -4,102 +4,3 @@
 #dimensions 0: 320x188
 #sar 0: 0/1
 0,  0,  0,1,67680, 0x532a4c40
-0, 37, 37,1,67680, 0x63d2757a
-0, 38, 38,1,67680, 0xb1dcf7d3
-0, 39, 39,1,67680, 0x3225ee89
-0, 40, 40,1,67680, 0x9a102730
-0, 41, 41,1,67680, 0xf266888b
-0, 42, 42,1,67680, 0xd3b30d01
-0, 43, 43,1,67680, 0x7c647901
-0, 44, 44,1,67680, 0x0838e924
-0, 45, 45,1,67680, 0x2d470a56
-0, 46, 46,1,67680, 0x3eb99bda
-0, 47, 47,1,67680, 0x2b89e9f7
-0, 48, 48,1,67680, 0xcc006f93
-0, 49, 49,1,67680, 0x967b33e8
-0, 50, 50,1,67680, 0xcebbbfd3
-0, 51, 51,1,67680, 0x68365b83
-0, 52, 52,1,67680, 0xf1b0e536
-0, 53, 53,1,67680, 0x292ecc68
-0, 54, 54,1,67680, 0x83329d20
-0, 55, 55,1,67680, 0xe6ea8f5a
-0, 56, 56,1,67680, 0xcef27038
-0, 57, 57,1,67680, 0xa30445e4
-0, 58, 58,1,67680, 0x61aef9f5
-0, 59, 59,1,67680, 0x20abe80c
-0, 60, 60,1,67680, 0x7182a479
-0, 61, 61,1,67680, 0x56db4ec8
-0, 62, 62,1,67680, 0x08c1c3d4
-0, 63, 63,1,67680, 0x0d8879ed
-0, 64, 64,1,67680, 0x8e4eb9b9
-0, 65, 65,1,67680, 0x4629639e
-0, 66, 66,1,67680, 0x990bcd94
-0, 67, 67,1,67680, 0x2ae85671
-0, 68, 68,1,67680, 0xec296417
-0, 69, 69,1,67680, 0x41adf8da
-0, 70, 70,1,67680, 0xa035008f
-0, 71, 71,1,67680, 0xf8845e14
-0, 72, 72,1,67680, 0x802e52c4
-0, 73, 73,1,67680, 0xa2582b4a
-0, 74, 74,1,67680, 0x9ca567d7
-0, 75, 75,1,67680, 0x2ec69fac
-0, 76, 76,1,67680, 0x3a6d35ea
-0, 77, 77,1,67680, 0x9df7b7f6
-0, 78, 78,1,67680, 0x2d9dc502
-0, 79, 79,1,67680, 0x0ee16604
-0, 80, 80,1,67680, 0xb25d31a0
-0, 81, 81,1,67680, 0x52c04cb4
-0, 82, 82,1,67680, 0xd9ddec28
-0, 83, 83,1,67680, 0x1732f444
-0, 84, 84,1,67680, 0x19e01da5
-0, 85, 85,1,67680, 0x9af109df
-0, 86, 86,1,67680, 0xc59ba581
-0, 87, 87,1,67680, 0x8daaa58f
-0, 88, 88,1,67680, 0xd560a9ae
-0, 89, 89,1,67680, 0xe3fe77b4
-0, 90, 90,1,67680, 0x2a0e6c20
-0, 91, 91,1,67680, 0x9741f744
-0, 92, 92,1,67680, 0x8ec827dd
-0, 93, 93,1,67680, 0x7d90551f
-0, 94, 94,1,67680, 0x4d8f2665
-0, 95, 95,1,67680, 0x21e5a86e
-0, 96, 96,1,67680, 0x9ba3fe8f
-0, 97, 97,1,67680, 0xc84b7e41
-0, 98, 98,1,67680, 0x8da743e2
-0, 99, 99,1,67680, 0x49c4e00e
-0,100,100,1,67680, 0x90fc5dab
-0,101,101,1,67680, 0x9973a011
-0,102,102,1,67680, 0xfdd58648
-0,103,103,1,67680, 0xe181e329
-0,104,104,1,67680, 0xf60065c3
-0,105,105,1,67680, 0xde9bfc23
-0,106,106,1,67680, 0x37b9f867
-0,107,107,1,67680, 0x232ce0e9
-0,108,108,1,67680, 0x3fde091d
-0,109,109,1,67680, 0x3f00a465
-0,110,110,1,67680, 0x882b0042
-0,111,111,1,67680, 0x1bc3d626
-0,112,112,1,67680, 0xd15861a7
-0,113,113,1, 

[FFmpeg-devel] [PATCH] vf_colorspace: Add support for smpte248 color primaries

2017-06-07 Thread Vittorio Giovara
---
I don't have a sample for this, but I used the values found in mpv
(and I find the source very reliable about this).
Vittorio

 libavfilter/vf_colorspace.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 0b1bc81f99..91fa4461f5 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -57,6 +57,7 @@ enum Whitepoint {
 WP_D65,
 WP_C,
 WP_DCI,
+WP_E,
 WP_NB,
 };
 
@@ -281,6 +282,7 @@ static const struct WhitepointCoefficients 
whitepoint_coefficients[WP_NB] = {
 [WP_D65] = { 0.3127, 0.3290 },
 [WP_C]   = { 0.3100, 0.3160 },
 [WP_DCI] = { 0.3140, 0.3510 },
+[WP_E]   = { 1/3.0f, 1/3.0f },
 };
 
 static const struct ColorPrimaries color_primaries[AVCOL_PRI_NB] = {
@@ -289,6 +291,7 @@ static const struct ColorPrimaries 
color_primaries[AVCOL_PRI_NB] = {
 [AVCOL_PRI_BT470BG]   = { WP_D65, 0.640, 0.330, 0.290, 0.600, 0.150, 
0.060,},
 [AVCOL_PRI_SMPTE170M] = { WP_D65, 0.630, 0.340, 0.310, 0.595, 0.155, 0.070 
},
 [AVCOL_PRI_SMPTE240M] = { WP_D65, 0.630, 0.340, 0.310, 0.595, 0.155, 0.070 
},
+[AVCOL_PRI_SMPTE428]  = { WP_E,   0.735, 0.265, 0.274, 0.718, 0.167, 0.009 
},
 [AVCOL_PRI_SMPTE431]  = { WP_DCI, 0.680, 0.320, 0.265, 0.690, 0.150, 0.060 
},
 [AVCOL_PRI_SMPTE432]  = { WP_D65, 0.680, 0.320, 0.265, 0.690, 0.150, 0.060 
},
 [AVCOL_PRI_FILM]  = { WP_C,   0.681, 0.319, 0.243, 0.692, 0.145, 0.049 
},
@@ -1104,6 +1107,7 @@ static const AVOption colorspace_options[] = {
 ENUM("bt470bg",  AVCOL_PRI_BT470BG,"prm"),
 ENUM("smpte170m",AVCOL_PRI_SMPTE170M,  "prm"),
 ENUM("smpte240m",AVCOL_PRI_SMPTE240M,  "prm"),
+ENUM("smpte248", AVCOL_PRI_SMPTE428,   "prm"),
 ENUM("film", AVCOL_PRI_FILM,   "prm"),
 ENUM("smpte431", AVCOL_PRI_SMPTE431,   "prm"),
 ENUM("smpte432", AVCOL_PRI_SMPTE432,   "prm"),
@@ -1119,6 +1123,7 @@ static const AVOption colorspace_options[] = {
 ENUM("gamma28",  AVCOL_TRC_GAMMA28,  "trc"),
 ENUM("smpte170m",AVCOL_TRC_SMPTE170M,"trc"),
 ENUM("smpte240m",AVCOL_TRC_SMPTE240M,"trc"),
+ENUM("smpte428", AVCOL_TRC_SMPTE428, "trc"),
 ENUM("srgb", AVCOL_TRC_IEC61966_2_1, "trc"),
 ENUM("iec61966-2-1", AVCOL_TRC_IEC61966_2_1, "trc"),
 ENUM("xvycc",AVCOL_TRC_IEC61966_2_4, "trc"),
-- 
2.12.0

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


Re: [FFmpeg-devel] [PATCH] Add A53 Closed Captions to MPEG header if they are available.

2017-06-07 Thread John P Poet
On Tue, Jun 6, 2017 at 4:48 PM John P Poet  wrote:

> On Tue, Jun 6, 2017 at 4:40 PM Kieran Kunhya  wrote:
>
>> >
>> > The cc_count is only 5 bits, which mean that only 31 3-byte "closed
>> caption
>> > constructs" will fit in a "block".Testing this with 1080i60
>> material, I
>> > found that 2 or 3 blocks was often necessary to hold all of the CC data.
>> >
>> > I tried ignoring that limit of 31 "constructs" per block, and ended up
>> with
>> > corrupt captions.   By preserving the 2 or 3 separate blocks I observed
>> > from the original source, the captions are perfect.
>> >
>>
>> Odd, ATSC specifies specific bitrate requirements in this area. Are you
>> sure your insertion process isn't  bursting?
>>
>> Kieran
>>
>
> The source is SDI with embedded 708 captions.  I supposed there may be an
> issue there.  I have not tried this with any other source.
>
> John
>

From my SDI source, most frames have cc_count=20.  Then there can be two or
three frames without any CC packets, which are often followed by a single
frame with with two or three VBI lines of CC packets:  e.g. two or three
groups of cc_count=20 in a single frame.

When you asked if it is "bursting", I assume this is what you mean?  If so,
what would you suggest I do about it?

Thanks,

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


Re: [FFmpeg-devel] [PATCH v3] lavc: add mpeg2 decoder/hwaccel to mediacodec

2017-06-07 Thread Matthieu Bouron
On Tue, Jun 06, 2017 at 09:39:25AM -0700, Aman Gupta wrote:
> On Mon, Jun 5, 2017 at 1:22 PM, Aman Gupta  wrote:
> 
> > From: Aman Gupta 
> >
> > Android TV and FireOS hardware supports mpeg2 hardware decoding via
> > MediaCodec.
> >
> 
> I tested this patch on an NVIDIA SHIELD, FireTV gen1 and FireTV Stick gen2
> and they all worked as expected.
> 
> Let me know if you want me to make any other changes before it can be
> merged.

The patch looks good to me and I will push it in a few hours (10h~ or so).

I was not able to find a single device supporting mpeg2 decoding though
MediaCodec, so I wasn't able to test the decoding part on my side.

[...]

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


Re: [FFmpeg-devel] [PATCH] web - src/contact - added link to SuperUser forum

2017-06-07 Thread Gyan
On Sat, Jun 3, 2017 at 3:24 PM, Gyan  wrote:

> The support forum at
>
> http://ffmpeg.gusari.org/index.php
>
> which is linked to at
>
> http://www.ffmpeg.org/contact.html#Forums
>
> now sports a banner announcing its likely closure. The banner redirects
> visitors to Stack Exchange which already receives most ffmpeg support
> queries.
>
> The patch below adds a link to SuperUser - the SE forum where FFmpeg CLI
> queries are on-topic. It doesn't remove the link to the deprecated forum,
> which can be done when that site closes down.
>
> Thanks,
> Gyan
>

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


Re: [FFmpeg-devel] [PATCH] lavf: consider codec framerate for framerate detection

2017-06-07 Thread Marton Balint


On Wed, 7 Jun 2017, wm4 wrote:


On Wed, 31 May 2017 18:26:01 +0200
wm4  wrote:


Fixes detection of some TV sample as 24.5 FPS. With the patch applied,
it's detected as 25 FPS.

This is enabled for mpegts only.
---
 libavformat/internal.h |  5 +
 libavformat/mpegts.c   |  2 ++
 libavformat/utils.c| 10 ++
 3 files changed, 17 insertions(+)

diff --git a/libavformat/internal.h b/libavformat/internal.h
index c856945ce9..d136c79bdd 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -145,6 +145,11 @@ struct AVFormatInternal {
  * ID3v2 tag useful for MP3 demuxing
  */
 AVDictionary *id3v2_meta;
+
+/*
+ * Prefer the codec framerate for avg_frame_rate computation.
+ */
+int prefer_codec_framerate;


Does this approach have any benefit over signalling this feature as a 
demuxer flag?


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


[FFmpeg-devel] MIPS maintainer change

2017-06-07 Thread Nedeljko Babic
Hello,

I am removing myself from MAINTAINERS list as MIPS maintainer.
Manojkumar Bhosale agreed to maintain MIPS related code, so I am adding him to 
the list.

Thanks,
Nedeljko 

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


[FFmpeg-devel] [PATCH] MAINTAINERS: Add Manojkumar Bhosale for MIPS, remove myself.

2017-06-07 Thread Nedeljko Babic
Manojkumar is taking over MIPS maintenance.

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

diff --git a/MAINTAINERS b/MAINTAINERS
index 32408e6..60aae12 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -514,7 +514,7 @@ Operating systems / CPU architectures
 =
 
 Alpha   Falk Hueffner
-MIPSNedeljko Babic
+MIPSManojkumar Bhosale
 Mac OS X / PowerPC  Romain Dolbeau, Guillaume Poirier
 Amiga / PowerPC Colin Ward
 Windows MinGW   Alex Beregszaszi, Ramiro Polla
-- 
2.7.1

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


Re: [FFmpeg-devel] [PATCH] lavf: consider codec framerate for framerate detection

2017-06-07 Thread wm4
On Wed, 31 May 2017 18:26:01 +0200
wm4  wrote:

> Fixes detection of some TV sample as 24.5 FPS. With the patch applied,
> it's detected as 25 FPS.
> 
> This is enabled for mpegts only.
> ---
>  libavformat/internal.h |  5 +
>  libavformat/mpegts.c   |  2 ++
>  libavformat/utils.c| 10 ++
>  3 files changed, 17 insertions(+)
> 
> diff --git a/libavformat/internal.h b/libavformat/internal.h
> index c856945ce9..d136c79bdd 100644
> --- a/libavformat/internal.h
> +++ b/libavformat/internal.h
> @@ -145,6 +145,11 @@ struct AVFormatInternal {
>   * ID3v2 tag useful for MP3 demuxing
>   */
>  AVDictionary *id3v2_meta;
> +
> +/*
> + * Prefer the codec framerate for avg_frame_rate computation.
> + */
> +int prefer_codec_framerate;
>  };
>  
>  struct AVStreamInternal {
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index 3eff1522bd..4d2f5c6802 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -2616,6 +2616,8 @@ static int mpegts_read_header(AVFormatContext *s)
>  int len;
>  int64_t pos, probesize = s->probesize;
>  
> +s->internal->prefer_codec_framerate = 1;
> +
>  if (ffio_ensure_seekback(pb, probesize) < 0)
>  av_log(s, AV_LOG_WARNING, "Failed to allocate buffers for 
> seekback\n");
>  
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index fbd8b58ac2..b50ca2f7ac 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -3903,6 +3903,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  st->info->codec_info_duration) {
>  int best_fps  = 0;
>  double best_error = 0.01;
> +AVRational codec_frame_rate = avctx->framerate;
>  
>  if (st->info->codec_info_duration>= INT64_MAX / 
> st->time_base.num / 2||
>  st->info->codec_info_duration_fields >= INT64_MAX / 
> st->time_base.den ||
> @@ -3923,6 +3924,15 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  best_error = error;
>  best_fps   = std_fps.num;
>  }
> +
> +if (ic->internal->prefer_codec_framerate && 
> codec_frame_rate.num > 0 && codec_frame_rate.den > 0) {
> +error   = fabs(av_q2d(codec_frame_rate) /
> +   av_q2d(std_fps) - 1);
> +if (error < best_error) {
> +best_error = error;
> +best_fps   = std_fps.num;
> +}
> +}
>  }
>  if (best_fps)
>  av_reduce(>avg_frame_rate.num, 
> >avg_frame_rate.den,

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


Re: [FFmpeg-devel] [PATCH] libavfilter/scale: Populate ow/oh when using 0 as w/h

2017-06-07 Thread Kevin Mark
I also have to wonder if it would be advantageous to add the cast on
the right side as well. That way the var_values variables will have
the proper truncated values on future evaluations. Open to comments on
that.

On Wed, Jun 7, 2017 at 3:45 AM, Kevin Mark  wrote:
> -eval_w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
> +eval_w = var_values[VAR_OUT_W] = var_values[VAR_OW] = (int) res == 0 ? 
> inlink->w : res;

to perhaps:
+eval_w = var_values[VAR_OUT_W] = var_values[VAR_OW] = (int) res
== 0 ? inlink->w : (int) res;

Without that extra cast I assume the values in eval_w and
var_values[VAR_OUT_W], var_values[VAR_OW] could be different. I doubt
most users expect that those values could ever be non-integers which
has implications for how you're writing your expression.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavfilter/scale: Populate ow/oh when using 0 as w/h

2017-06-07 Thread Kevin Mark
The input width and height is known at parse time so there's no
reason ow/oh should not be usable when using 0 as the width or
height expression.

Previously in "scale=0:ow" ow would be set to "0" which works,
conveniently, as "scale=0:0" is perfectly valid input but this breaks
down when you do something like "scale=0:ow/4" which one could
reasonably expect to work as well, but does not as ow is 0 not the
real value.

This change handles the 0 case for w/h immediately so the ow/oh
variables work as expected. Consequently, the rest of the code does
not need to handle 0 input. w/h will always be > 0 or < 0.

Signed-off-by: Kevin Mark 
---
 libavfilter/scale.c | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/libavfilter/scale.c b/libavfilter/scale.c
index 03745ddcb8..a6c32e3978 100644
--- a/libavfilter/scale.c
+++ b/libavfilter/scale.c
@@ -158,19 +158,19 @@ int ff_scale_eval_dimensions(void *log_ctx,
 av_expr_parse_and_eval(, (expr = w_expr),
names, var_values,
NULL, NULL, NULL, NULL, NULL, 0, log_ctx);
-eval_w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
+eval_w = var_values[VAR_OUT_W] = var_values[VAR_OW] = (int) res == 0 ? 
inlink->w : res;
 
 if ((ret = av_expr_parse_and_eval(, (expr = h_expr),
   names, var_values,
   NULL, NULL, NULL, NULL, NULL, 0, 
log_ctx)) < 0)
 goto fail;
-eval_h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;
+eval_h = var_values[VAR_OUT_H] = var_values[VAR_OH] = (int) res == 0 ? 
inlink->h : res;
 /* evaluate again the width, as it may depend on the output height */
 if ((ret = av_expr_parse_and_eval(, (expr = w_expr),
   names, var_values,
   NULL, NULL, NULL, NULL, NULL, 0, 
log_ctx)) < 0)
 goto fail;
-eval_w = res;
+eval_w = (int) res == 0 ? inlink->w : res;
 
 w = eval_w;
 h = eval_h;
@@ -186,13 +186,10 @@ int ff_scale_eval_dimensions(void *log_ctx,
 factor_h = -h;
 }
 
-if (w < 0 && h < 0)
-eval_w = eval_h = 0;
-
-if (!(w = eval_w))
+if (w < 0 && h < 0) {
 w = inlink->w;
-if (!(h = eval_h))
 h = inlink->h;
+}
 
 /* Make sure that the result is divisible by the factor we determined
  * earlier. If no factor was set, it is nothing will happen as the default
-- 
2.13.0

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


Re: [FFmpeg-devel] [PATCH] libavfilter/scale: Populate ow/oh when using 0 as w/h

2017-06-07 Thread Kevin Mark
Unfortunately I have to withdraw this patch. I'll be submitting an
updated one shortly. The below lines allow through values that are 0
when casted/truncated to an integer but are not zero as doubles (like
-0.1).

On Wed, Jun 7, 2017 at 2:11 AM, Kevin Mark  wrote:
> -eval_w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
> +eval_w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res == 0.0 ? 
> inlink->w : res;
>
>  if ((ret = av_expr_parse_and_eval(, (expr = h_expr),
>names, var_values,
>NULL, NULL, NULL, NULL, NULL, 0, 
> log_ctx)) < 0)
>  goto fail;
> -eval_h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;
> +eval_h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res == 0.0 ? 
> inlink->h : res;
>  /* evaluate again the width, as it may depend on the output height */
>  if ((ret = av_expr_parse_and_eval(, (expr = w_expr),
>names, var_values,
>NULL, NULL, NULL, NULL, NULL, 0, 
> log_ctx)) < 0)
>  goto fail;
> -eval_w = res;
> +eval_w = res == 0.0 ? inlink->w : res;
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavfilter/scale: Populate ow/oh when using 0 as w/h

2017-06-07 Thread Kevin Mark
The input width and height is known at parse time so there's no
reason ow/oh should not be usable when using 0 as the width or
height expression.

Previously in "scale=0:ow" ow would be set to "0" which works,
conveniently, as "scale=0:0" is perfectly valid input but this breaks
down when you do something like "scale=0:ow/4" which one could
reasonably expect to work as well, but does not as ow is 0 not the
real value.

This change handles the 0 case for w/h immediately so the ow/oh
variables work as expected. Consequently, the rest of the code does
not need to handle 0 input. w/h will always be > 0 or < 0.

Signed-off-by: Kevin Mark 
---
 libavfilter/scale.c | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/libavfilter/scale.c b/libavfilter/scale.c
index 03745ddcb8..cc2bea5caf 100644
--- a/libavfilter/scale.c
+++ b/libavfilter/scale.c
@@ -158,19 +158,19 @@ int ff_scale_eval_dimensions(void *log_ctx,
 av_expr_parse_and_eval(, (expr = w_expr),
names, var_values,
NULL, NULL, NULL, NULL, NULL, 0, log_ctx);
-eval_w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res;
+eval_w = var_values[VAR_OUT_W] = var_values[VAR_OW] = res == 0.0 ? 
inlink->w : res;
 
 if ((ret = av_expr_parse_and_eval(, (expr = h_expr),
   names, var_values,
   NULL, NULL, NULL, NULL, NULL, 0, 
log_ctx)) < 0)
 goto fail;
-eval_h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res;
+eval_h = var_values[VAR_OUT_H] = var_values[VAR_OH] = res == 0.0 ? 
inlink->h : res;
 /* evaluate again the width, as it may depend on the output height */
 if ((ret = av_expr_parse_and_eval(, (expr = w_expr),
   names, var_values,
   NULL, NULL, NULL, NULL, NULL, 0, 
log_ctx)) < 0)
 goto fail;
-eval_w = res;
+eval_w = res == 0.0 ? inlink->w : res;
 
 w = eval_w;
 h = eval_h;
@@ -186,13 +186,10 @@ int ff_scale_eval_dimensions(void *log_ctx,
 factor_h = -h;
 }
 
-if (w < 0 && h < 0)
-eval_w = eval_h = 0;
-
-if (!(w = eval_w))
+if (w < 0 && h < 0) {
 w = inlink->w;
-if (!(h = eval_h))
 h = inlink->h;
+}
 
 /* Make sure that the result is divisible by the factor we determined
  * earlier. If no factor was set, it is nothing will happen as the default
-- 
2.13.0

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