[FFmpeg-cvslog] avformat/hlsenc: set EXT-X-TARGETDURATION use lrint(EXTINF)

2017-12-21 Thread Karthick J
ffmpeg | branch: master | Karthick J  | Fri Dec 22 
07:43:54 2017 +0800| [93a0e478768e9bafc44b8956b94c27fe8e3486f3] | committer: 
Steven Liu

avformat/hlsenc: set EXT-X-TARGETDURATION use lrint(EXTINF)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93a0e478768e9bafc44b8956b94c27fe8e3486f3
---

 libavformat/hlsenc.c  | 2 +-
 libavformat/hlsplaylist.h | 5 -
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 29fc1d4122..0095ca4339 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1235,7 +1235,7 @@ static int hls_window(AVFormatContext *s, int last, 
VariantStream *vs)
 
 for (en = vs->segments; en; en = en->next) {
 if (target_duration <= en->duration)
-target_duration = hls_get_int_from_double(en->duration);
+target_duration = lrint(en->duration);
 }
 
 vs->discontinuity_set = 0;
diff --git a/libavformat/hlsplaylist.h b/libavformat/hlsplaylist.h
index 48d71b7c77..fe19f34368 100644
--- a/libavformat/hlsplaylist.h
+++ b/libavformat/hlsplaylist.h
@@ -36,11 +36,6 @@ typedef enum {
 PLAYLIST_TYPE_NB,
 } PlaylistType;
 
-static inline int hls_get_int_from_double(double val)
-{
-return (int)((val - (int)val) >= 0.001) ? (int)(val + 1) : (int)val;
-}
-
 void ff_hls_write_playlist_version(AVIOContext *out, int version);
 void ff_hls_write_stream_info(AVStream *st, AVIOContext *out,
   int bandwidth, char *filename);

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


[FFmpeg-cvslog] avformat/dashenc: avformat/dashenc: Fix the EXT-X-TARGETDURATION as per the hls specification

2017-12-21 Thread Karthick J
ffmpeg | branch: master | Karthick J  | Fri Dec 22 
07:44:51 2017 +0800| [e3b2c8502b33c180e0f053ac2ef32ee782224c2e] | committer: 
Steven Liu

avformat/dashenc: avformat/dashenc: Fix the EXT-X-TARGETDURATION as per the hls 
specification

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e3b2c8502b33c180e0f053ac2ef32ee782224c2e
---

 libavformat/dashenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 5687530f2d..5368a2334c 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -358,7 +358,7 @@ static void output_segment_list(OutputStream *os, 
AVIOContext *out, DASHContext
 Segment *seg = os->segments[i];
 double duration = (double) seg->duration / timescale;
 if (target_duration <= duration)
-target_duration = hls_get_int_from_double(duration);
+target_duration = lrint(duration);
 }
 
 ff_hls_write_playlist_header(out_hls, 6, -1, target_duration,

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


[FFmpeg-cvslog] avfilter/vf_framerate: factorize get_scene_score

2017-12-21 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sun Dec 10 00:00:52 
2017 +0100| [be15304ee610252636120f5e09fad4b015b34a31] | committer: Marton 
Balint

avfilter/vf_framerate: factorize get_scene_score

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=be15304ee610252636120f5e09fad4b015b34a31
---

 libavfilter/vf_framerate.c | 78 ++
 1 file changed, 31 insertions(+), 47 deletions(-)

diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c
index f931a6f512..1cad2305ad 100644
--- a/libavfilter/vf_framerate.c
+++ b/libavfilter/vf_framerate.c
@@ -133,41 +133,35 @@ static av_always_inline int64_t sad_8x8_16(const uint16_t 
*src1, ptrdiff_t strid
 return sum;
 }
 
-static double get_scene_score16(AVFilterContext *ctx, AVFrame *crnt, AVFrame 
*next)
+static int64_t scene_sad16(FrameRateContext *s, const uint16_t *p1, int 
p1_linesize, const uint16_t* p2, int p2_linesize, int height)
 {
-FrameRateContext *s = ctx->priv;
-double ret = 0;
-
-ff_dlog(ctx, "get_scene_score16()\n");
+int64_t sad;
+int x, y;
+for (sad = y = 0; y < height; y += 8) {
+for (x = 0; x < p1_linesize; x += 8) {
+sad += sad_8x8_16(p1 + y * p1_linesize + x,
+  p1_linesize,
+  p2 + y * p2_linesize + x,
+  p2_linesize);
+}
+}
+return sad;
+}
 
-if (crnt &&
-crnt->height == next->height &&
-crnt->width  == next->width) {
-int x, y;
-int64_t sad;
-double mafd, diff;
-const uint16_t *p1 = (const uint16_t *)crnt->data[0];
-const uint16_t *p2 = (const uint16_t *)next->data[0];
-const int p1_linesize = crnt->linesize[0] / 2;
-const int p2_linesize = next->linesize[0] / 2;
-
-ff_dlog(ctx, "get_scene_score16() process\n");
-
-for (sad = y = 0; y < crnt->height; y += 8) {
-for (x = 0; x < p1_linesize; x += 8) {
-sad += sad_8x8_16(p1 + y * p1_linesize + x,
-  p1_linesize,
-  p2 + y * p2_linesize + x,
-  p2_linesize);
-}
+static int64_t scene_sad8(FrameRateContext *s, uint8_t *p1, int p1_linesize, 
uint8_t* p2, int p2_linesize, int height)
+{
+int64_t sad;
+int x, y;
+for (sad = y = 0; y < height; y += 8) {
+for (x = 0; x < p1_linesize; x += 8) {
+sad += s->sad(p1 + y * p1_linesize + x,
+  p1_linesize,
+  p2 + y * p2_linesize + x,
+  p2_linesize);
 }
-mafd = sad / (crnt->height * crnt->width * 3);
-diff = fabs(mafd - s->prev_mafd);
-ret  = av_clipf(FFMIN(mafd, diff), 0, 100.0);
-s->prev_mafd = mafd;
 }
-ff_dlog(ctx, "get_scene_score16() result is:%f\n", ret);
-return ret;
+emms_c();
+return sad;
 }
 
 static double get_scene_score(AVFilterContext *ctx, AVFrame *crnt, AVFrame 
*next)
@@ -180,31 +174,21 @@ static double get_scene_score(AVFilterContext *ctx, 
AVFrame *crnt, AVFrame *next
 if (crnt &&
 crnt->height == next->height &&
 crnt->width  == next->width) {
-int x, y;
 int64_t sad;
 double mafd, diff;
-uint8_t *p1 = crnt->data[0];
-uint8_t *p2 = next->data[0];
-const int p1_linesize = crnt->linesize[0];
-const int p2_linesize = next->linesize[0];
 
 ff_dlog(ctx, "get_scene_score() process\n");
+if (s->bitdepth == 8)
+sad = scene_sad8(s, crnt->data[0], crnt->linesize[0], 
next->data[0], next->linesize[0], crnt->height);
+else
+sad = scene_sad16(s, (const uint16_t*)crnt->data[0], 
crnt->linesize[0] >> 1, (const uint16_t*)next->data[0], next->linesize[0] >> 1, 
crnt->height);
 
-for (sad = y = 0; y < crnt->height; y += 8) {
-for (x = 0; x < p1_linesize; x += 8) {
-sad += s->sad(p1 + y * p1_linesize + x,
-  p1_linesize,
-  p2 + y * p2_linesize + x,
-  p2_linesize);
-}
-}
-emms_c();
 mafd = sad / (crnt->height * crnt->width * 3);
 diff = fabs(mafd - s->prev_mafd);
 ret  = av_clipf(FFMIN(mafd, diff), 0, 100.0);
 s->prev_mafd = mafd;
 }
-ff_dlog(ctx, "get_scene_score() result is:%f\n", ret);
+ff_dlog(ctx, "get_scene_score() result is:%f\n", ret);
 return ret;
 }
 
@@ -327,7 +311,7 @@ static int blend_frames(AVFilterContext *ctx, float 
interpolate,
 double interpolate_scene_score = 0;
 
 if ((s->flags & FRAMERATE_FLAG_SCD) && copy_src2) {
-interpolate_scene_score = s->bitdepth == 8 ? get_scene_score(ctx, 
copy_src1, copy_src2) : get_scene_score16(ctx, copy_src1, copy_src2);

[FFmpeg-cvslog] avfilter/vf_framerate: fix scene change detection score

2017-12-21 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sun Dec 10 00:29:12 
2017 +0100| [e1113a83ccb6bb30e3ad865956fe9eed0d650394] | committer: Marton 
Balint

avfilter/vf_framerate: fix scene change detection score

- normalize score to [0..100] instead of [0..85]
- change the default score to 8.2 to roughly keep existing behaviour
- take into account bit depth
- do not truncate to integer

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e1113a83ccb6bb30e3ad865956fe9eed0d650394
---

 doc/filters.texi   | 2 +-
 libavfilter/vf_framerate.c | 4 ++--
 tests/ref/fate/filter-framerate-12bit-down | 2 +-
 tests/ref/fate/filter-framerate-12bit-up   | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 6a6d5a334e..45515966e8 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -9121,7 +9121,7 @@ Specify the level at which a scene change is detected as 
a value between
 0 and 100 to indicate a new scene; a low value reflects a low
 probability for the current frame to introduce a new scene, while a higher
 value means the current frame is more likely to be one.
-The default is @code{7}.
+The default is @code{8.2}.
 
 @item flags
 Specify flags influencing the filter process.
diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c
index 1cad2305ad..dd106f8e5b 100644
--- a/libavfilter/vf_framerate.c
+++ b/libavfilter/vf_framerate.c
@@ -88,7 +88,7 @@ static const AVOption framerate_options[] = {
 
 {"interp_start","point to start linear interpolation",
OFFSET(interp_start),AV_OPT_TYPE_INT,  {.i64=15}, 0,
   255, V|F },
 {"interp_end",  "point to end linear interpolation",  
OFFSET(interp_end),  AV_OPT_TYPE_INT,  {.i64=240},0,
   255, V|F },
-{"scene",   "scene change level", 
OFFSET(scene_score), AV_OPT_TYPE_DOUBLE,   {.dbl=7.0},0,
   INT_MAX, V|F },
+{"scene",   "scene change level", 
OFFSET(scene_score), AV_OPT_TYPE_DOUBLE,   {.dbl=8.2},0,
   INT_MAX, V|F },
 
 {"flags",   "set flags",  
OFFSET(flags),   AV_OPT_TYPE_FLAGS,{.i64=1},  0,
   INT_MAX, V|F, "flags" },
 {"scene_change_detect", "enable scene change detection",  0,   
AV_OPT_TYPE_CONST,{.i64=FRAMERATE_FLAG_SCD}, INT_MIN, 
INT_MAX, V|F, "flags" },
@@ -183,7 +183,7 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame 
*crnt, AVFrame *next
 else
 sad = scene_sad16(s, (const uint16_t*)crnt->data[0], 
crnt->linesize[0] >> 1, (const uint16_t*)next->data[0], next->linesize[0] >> 1, 
crnt->height);
 
-mafd = sad / (crnt->height * crnt->width * 3);
+mafd = (double)sad * 100.0 / (crnt->height * crnt->width) / (1 << 
s->bitdepth);
 diff = fabs(mafd - s->prev_mafd);
 ret  = av_clipf(FFMIN(mafd, diff), 0, 100.0);
 s->prev_mafd = mafd;
diff --git a/tests/ref/fate/filter-framerate-12bit-down 
b/tests/ref/fate/filter-framerate-12bit-down
index 7a5a7b8e14..0a9aea0ce1 100644
--- a/tests/ref/fate/filter-framerate-12bit-down
+++ b/tests/ref/fate/filter-framerate-12bit-down
@@ -4,7 +4,7 @@
 #dimensions 0: 320x240
 #sar 0: 1/1
 0,  0,  0,1,   307200, 0xb49cf016
-0,  1,  1,1,   307200, 0xfe025c7f
+0,  1,  1,1,   307200, 0xc3be6971
 0,  2,  2,1,   307200, 0x4d458da1
 0,  3,  3,1,   307200, 0x35d4d8ea
 0,  4,  4,1,   307200, 0x88f88697
diff --git a/tests/ref/fate/filter-framerate-12bit-up 
b/tests/ref/fate/filter-framerate-12bit-up
index 8f57e6d066..8f5f95b275 100644
--- a/tests/ref/fate/filter-framerate-12bit-up
+++ b/tests/ref/fate/filter-framerate-12bit-up
@@ -4,7 +4,7 @@
 #dimensions 0: 320x240
 #sar 0: 1/1
 0,  0,  0,1,   307200, 0xb49cf016
-0,  1,  1,1,   307200, 0xc74259b4
+0,  1,  1,1,   307200, 0x59cb92c7
 0,  2,  2,1,   307200, 0xe4ca172c
 0,  3,  3,1,   307200, 0x5378b13c
 0,  4,  4,1,   307200, 0x2a7d4840

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


[FFmpeg-cvslog] fate: add 12 bit framerate filter tests

2017-12-21 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sun Dec 10 00:07:17 
2017 +0100| [d6a8e46f9788810392555d891fc2f0db342a6a44] | committer: Marton 
Balint

fate: add 12 bit framerate filter tests

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d6a8e46f9788810392555d891fc2f0db342a6a44
---

 tests/fate/filter-video.mak|  4 ++
 tests/ref/fate/filter-framerate-12bit-down | 55 +
 tests/ref/fate/filter-framerate-12bit-up   | 64 ++
 3 files changed, 123 insertions(+)

diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index c19f301ff8..39442f6717 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -113,6 +113,10 @@ FATE_FILTER-$(call ALLYES, FRAMERATE_FILTER 
TESTSRC2_FILTER) += fate-filter-fram
 fate-filter-framerate-up: CMD = framecrc -lavfi 
testsrc2=r=2:d=10,framerate=fps=10 -t 1
 fate-filter-framerate-down: CMD = framecrc -lavfi 
testsrc2=r=2:d=10,framerate=fps=1 -t 1
 
+FATE_FILTER-$(call ALLYES, FRAMERATE_FILTER TESTSRC2_FILTER FORMAT_FILTER) += 
fate-filter-framerate-12bit-up fate-filter-framerate-12bit-down
+fate-filter-framerate-12bit-up: CMD = framecrc -lavfi 
testsrc2=r=50:d=1,format=pix_fmts=yuv422p12,framerate=fps=60 -t 1
+fate-filter-framerate-12bit-down: CMD = framecrc -lavfi 
testsrc2=r=60:d=1,format=pix_fmts=yuv422p12,framerate=fps=50 -t 1
+
 FATE_FILTER_VSYNTH-$(CONFIG_BOXBLUR_FILTER) += fate-filter-boxblur
 fate-filter-boxblur: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf boxblur=2:1
 
diff --git a/tests/ref/fate/filter-framerate-12bit-down 
b/tests/ref/fate/filter-framerate-12bit-down
new file mode 100644
index 00..7a5a7b8e14
--- /dev/null
+++ b/tests/ref/fate/filter-framerate-12bit-down
@@ -0,0 +1,55 @@
+#tb 0: 1/50
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 320x240
+#sar 0: 1/1
+0,  0,  0,1,   307200, 0xb49cf016
+0,  1,  1,1,   307200, 0xfe025c7f
+0,  2,  2,1,   307200, 0x4d458da1
+0,  3,  3,1,   307200, 0x35d4d8ea
+0,  4,  4,1,   307200, 0x88f88697
+0,  5,  5,1,   307200, 0xaf71e7fc
+0,  6,  6,1,   307200, 0x1290a487
+0,  7,  7,1,   307200, 0xaf0cf5ee
+0,  8,  8,1,   307200, 0x9fe73a9b
+0,  9,  9,1,   307200, 0xb7965b77
+0, 10, 10,1,   307200, 0x9f84df5d
+0, 11, 11,1,   307200, 0xf60b8c87
+0, 12, 12,1,   307200, 0xe2eac3a7
+0, 13, 13,1,   307200, 0xefbbc67a
+0, 14, 14,1,   307200, 0xb293001a
+0, 15, 15,1,   307200, 0xab2162fc
+0, 16, 16,1,   307200, 0xdc90848a
+0, 17, 17,1,   307200, 0x29f79f4b
+0, 18, 18,1,   307200, 0x62aee029
+0, 19, 19,1,   307200, 0xcb6de0e9
+0, 20, 20,1,   307200, 0xf2b12fe5
+0, 21, 21,1,   307200, 0x1de67e13
+0, 22, 22,1,   307200, 0xfc1f7774
+0, 23, 23,1,   307200, 0x707fe832
+0, 24, 24,1,   307200, 0xe2dc0742
+0, 25, 25,1,   307200, 0x4693ab03
+0, 26, 26,1,   307200, 0x7295ef7a
+0, 27, 27,1,   307200, 0xf442a5df
+0, 28, 28,1,   307200, 0x3019dbbc
+0, 29, 29,1,   307200, 0xd82a394d
+0, 30, 30,1,   307200, 0x8a512668
+0, 31, 31,1,   307200, 0x69e7b43e
+0, 32, 32,1,   307200, 0x6c5343ca
+0, 33, 33,1,   307200, 0x8aac4531
+0, 34, 34,1,   307200, 0x4b7f5b63
+0, 35, 35,1,   307200, 0x4e24d659
+0, 36, 36,1,   307200, 0x7a25b546
+0, 37, 37,1,   307200, 0x9b7e8e8f
+0, 38, 38,1,   307200, 0x94ec9d3d
+0, 39, 39,1,   307200, 0x856ea560
+0, 40, 40,1,   307200, 0xb6505ff0
+0, 41, 41,1,   307200, 0x12562a42
+0, 42, 42,1,   307200, 0x3335e451
+0, 43, 43,1,   307200, 0x7f0374c9
+0, 44, 44,1,   307200, 0x487e798a
+0, 45, 45,1,   307200, 0x4fda2634
+0, 46, 46,1,   307200, 0x5b48d624
+0, 47, 47,1,   307200, 0xa9505af8
+0, 48, 48,1,   307200, 0xce7248b5
+0, 49, 49,1,   307200, 0x8fbc1bec
diff --git a/tests/ref/fate/filter-framerate-12bit-up 
b/tests/ref/fate/filter-framerate-12bit-up
new file mode 100644

[FFmpeg-cvslog] avfilter/vf_framerate: add threaded blending operations

2017-12-21 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sat Dec  9 22:46:27 
2017 +0100| [1eb926dc02684e0d4036b1edd2cba6b809451301] | committer: Marton 
Balint

avfilter/vf_framerate: add threaded blending operations

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1eb926dc02684e0d4036b1edd2cba6b809451301
---

 libavfilter/vf_framerate.c | 202 -
 1 file changed, 125 insertions(+), 77 deletions(-)

diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c
index dc8b05f40f..d505c5a8a4 100644
--- a/libavfilter/vf_framerate.c
+++ b/libavfilter/vf_framerate.c
@@ -210,6 +210,117 @@ static double get_scene_score(AVFilterContext *ctx, 
AVFrame *crnt, AVFrame *next
 return ret;
 }
 
+typedef struct ThreadData {
+AVFrame *copy_src1, *copy_src2;
+uint16_t src1_factor, src2_factor;
+} ThreadData;
+
+static int filter_slice8(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
+{
+FrameRateContext *s = ctx->priv;
+ThreadData *td = arg;
+uint16_t src1_factor = td->src1_factor;
+uint16_t src2_factor = td->src2_factor;
+int plane, line, pixel;
+
+for (plane = 0; plane < 4 && td->copy_src1->data[plane] && 
td->copy_src2->data[plane]; plane++) {
+int cpy_line_width = s->line_size[plane];
+uint8_t *cpy_src1_data = td->copy_src1->data[plane];
+int cpy_src1_line_size = td->copy_src1->linesize[plane];
+uint8_t *cpy_src2_data = td->copy_src2->data[plane];
+int cpy_src2_line_size = td->copy_src2->linesize[plane];
+int cpy_src_h = (plane > 0 && plane < 3) ? (td->copy_src1->height >> 
s->vsub) : (td->copy_src1->height);
+uint8_t *cpy_dst_data = s->work->data[plane];
+int cpy_dst_line_size = s->work->linesize[plane];
+const int start = (cpy_src_h *  job   ) / nb_jobs;
+const int end   = (cpy_src_h * (job+1)) / nb_jobs;
+cpy_src1_data += start * cpy_src1_line_size;
+cpy_src2_data += start * cpy_src2_line_size;
+cpy_dst_data += start * cpy_dst_line_size;
+
+if (plane <1 || plane >2) {
+// luma or alpha
+for (line = start; line < end; line++) {
+for (pixel = 0; pixel < cpy_line_width; pixel++) {
+// integer version of (src1 * src1_factor) + (src2 + 
src2_factor) + 0.5
+// 0.5 is for rounding
+// 128 is the integer representation of 0.5 << 8
+cpy_dst_data[pixel] = ((cpy_src1_data[pixel] * 
src1_factor) + (cpy_src2_data[pixel] * src2_factor) + 128) >> 8;
+}
+cpy_src1_data += cpy_src1_line_size;
+cpy_src2_data += cpy_src2_line_size;
+cpy_dst_data += cpy_dst_line_size;
+}
+} else {
+// chroma
+for (line = start; line < end; line++) {
+for (pixel = 0; pixel < cpy_line_width; pixel++) {
+// as above
+// because U and V are based around 128 we have to 
subtract 128 from the components.
+// 32896 is the integer representation of 128.5 << 8
+cpy_dst_data[pixel] = (((cpy_src1_data[pixel] - 128) * 
src1_factor) + ((cpy_src2_data[pixel] - 128) * src2_factor) + 32896) >> 8;
+}
+cpy_src1_data += cpy_src1_line_size;
+cpy_src2_data += cpy_src2_line_size;
+cpy_dst_data += cpy_dst_line_size;
+}
+}
+}
+
+return 0;
+}
+
+static int filter_slice16(AVFilterContext *ctx, void *arg, int job, int 
nb_jobs)
+{
+FrameRateContext *s = ctx->priv;
+ThreadData *td = arg;
+uint16_t src1_factor = td->src1_factor;
+uint16_t src2_factor = td->src2_factor;
+const int half = s->max / 2;
+const int uv = (s->max + 1) * half;
+const int shift = s->bitdepth;
+int plane, line, pixel;
+
+for (plane = 0; plane < 4 && td->copy_src1->data[plane] && 
td->copy_src2->data[plane]; plane++) {
+int cpy_line_width = s->line_size[plane];
+const uint16_t *cpy_src1_data = (const uint16_t 
*)td->copy_src1->data[plane];
+int cpy_src1_line_size = td->copy_src1->linesize[plane] / 2;
+const uint16_t *cpy_src2_data = (const uint16_t 
*)td->copy_src2->data[plane];
+int cpy_src2_line_size = td->copy_src2->linesize[plane] / 2;
+int cpy_src_h = (plane > 0 && plane < 3) ? (td->copy_src1->height >> 
s->vsub) : (td->copy_src1->height);
+uint16_t *cpy_dst_data = (uint16_t *)s->work->data[plane];
+int cpy_dst_line_size = s->work->linesize[plane] / 2;
+const int start = (cpy_src_h *  job   ) / nb_jobs;
+const int end   = (cpy_src_h * (job+1)) / nb_jobs;
+cpy_src1_data += start * cpy_src1_line_size;
+cpy_src2_data += start * cpy_src2_line_size;
+cpy_dst_data += start * cpy_dst_line_size;
+
+

[FFmpeg-cvslog] avfilter/vf_framerate: fix scene score with negative linesize

2017-12-21 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sun Dec 10 19:01:03 
2017 +0100| [e403e4bdbea08af0c4a068eb560b577d1b64cf7a] | committer: Marton 
Balint

avfilter/vf_framerate: fix scene score with negative linesize

Also, do not overread input if linesize > width, or linesize is not divisible
by 8, and use the proper rounded width/height for MAFD calculation.

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e403e4bdbea08af0c4a068eb560b577d1b64cf7a
---

 libavfilter/vf_framerate.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c
index a6cb5bd212..1336ea0469 100644
--- a/libavfilter/vf_framerate.c
+++ b/libavfilter/vf_framerate.c
@@ -136,12 +136,12 @@ static av_always_inline int64_t sad_8x8_16(const uint16_t 
*src1, ptrdiff_t strid
 return sum;
 }
 
-static int64_t scene_sad16(FrameRateContext *s, const uint16_t *p1, int 
p1_linesize, const uint16_t* p2, int p2_linesize, int height)
+static int64_t scene_sad16(FrameRateContext *s, const uint16_t *p1, int 
p1_linesize, const uint16_t* p2, int p2_linesize, const int width, const int 
height)
 {
 int64_t sad;
 int x, y;
-for (sad = y = 0; y < height; y += 8) {
-for (x = 0; x < p1_linesize; x += 8) {
+for (sad = y = 0; y < height - 7; y += 8) {
+for (x = 0; x < width - 7; x += 8) {
 sad += sad_8x8_16(p1 + y * p1_linesize + x,
   p1_linesize,
   p2 + y * p2_linesize + x,
@@ -151,12 +151,12 @@ static int64_t scene_sad16(FrameRateContext *s, const 
uint16_t *p1, int p1_lines
 return sad;
 }
 
-static int64_t scene_sad8(FrameRateContext *s, uint8_t *p1, int p1_linesize, 
uint8_t* p2, int p2_linesize, int height)
+static int64_t scene_sad8(FrameRateContext *s, uint8_t *p1, int p1_linesize, 
uint8_t* p2, int p2_linesize, const int width, const int height)
 {
 int64_t sad;
 int x, y;
-for (sad = y = 0; y < height; y += 8) {
-for (x = 0; x < p1_linesize; x += 8) {
+for (sad = y = 0; y < height - 7; y += 8) {
+for (x = 0; x < width - 7; x += 8) {
 sad += s->sad(p1 + y * p1_linesize + x,
   p1_linesize,
   p2 + y * p2_linesize + x,
@@ -181,11 +181,11 @@ static double get_scene_score(AVFilterContext *ctx, 
AVFrame *crnt, AVFrame *next
 
 ff_dlog(ctx, "get_scene_score() process\n");
 if (s->bitdepth == 8)
-sad = scene_sad8(s, crnt->data[0], crnt->linesize[0], 
next->data[0], next->linesize[0], crnt->height);
+sad = scene_sad8(s, crnt->data[0], crnt->linesize[0], 
next->data[0], next->linesize[0], crnt->width, crnt->height);
 else
-sad = scene_sad16(s, (const uint16_t*)crnt->data[0], 
crnt->linesize[0] >> 1, (const uint16_t*)next->data[0], next->linesize[0] >> 1, 
crnt->height);
+sad = scene_sad16(s, (const uint16_t*)crnt->data[0], 
crnt->linesize[0] / 2, (const uint16_t*)next->data[0], next->linesize[0] / 2, 
crnt->width, crnt->height);
 
-mafd = (double)sad * 100.0 / (crnt->height * crnt->width) / (1 << 
s->bitdepth);
+mafd = (double)sad * 100.0 / FFMAX(1, (crnt->height & ~7) * 
(crnt->width & ~7)) / (1 << s->bitdepth);
 diff = fabs(mafd - s->prev_mafd);
 ret  = av_clipf(FFMIN(mafd, diff), 0, 100.0);
 s->prev_mafd = mafd;

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


[FFmpeg-cvslog] avfilter/vf_framerate: do not calculate scene change score multiple times for the same frame

2017-12-21 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sun Dec 10 03:18:49 
2017 +0100| [c6a65ed67088fd61017f14691b5fcecd133d9eeb] | committer: Marton 
Balint

avfilter/vf_framerate: do not calculate scene change score multiple times for 
the same frame

This speeds up the filter, and also fixes scene change detection score which is
reduced based on the difference of the current MAFD to the preivous MAFD.
Obviously if we compare two frames twice, the difference will be 0...

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c6a65ed67088fd61017f14691b5fcecd133d9eeb
---

 libavfilter/vf_framerate.c | 45 +++--
 1 file changed, 27 insertions(+), 18 deletions(-)

diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c
index dd106f8e5b..a6cb5bd212 100644
--- a/libavfilter/vf_framerate.c
+++ b/libavfilter/vf_framerate.c
@@ -71,6 +71,7 @@ typedef struct FrameRateContext {
 
 AVFrame *srce[N_SRCE];  ///< buffered source frames
 int64_t srce_pts_dest[N_SRCE];  ///< pts for source frames scaled to 
output timebase
+double srce_score[N_SRCE];  ///< scene change score compared to 
the next srce frame
 int64_t pts;///< pts of frame we are working on
 
 int max;
@@ -113,9 +114,11 @@ static void next_source(AVFilterContext *ctx)
 for (i = s->last; i > s->frst; i--) {
 ff_dlog(ctx, "next_source() copy %d to %d\n", i - 1, i);
 s->srce[i] = s->srce[i - 1];
+s->srce_score[i] = s->srce_score[i - 1];
 }
 ff_dlog(ctx, "next_source() make %d null\n", s->frst);
 s->srce[s->frst] = NULL;
+s->srce_score[s->frst] = -1.0;
 }
 
 static av_always_inline int64_t sad_8x8_16(const uint16_t *src1, ptrdiff_t 
stride1,
@@ -171,8 +174,7 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame 
*crnt, AVFrame *next
 
 ff_dlog(ctx, "get_scene_score()\n");
 
-if (crnt &&
-crnt->height == next->height &&
+if (crnt->height == next->height &&
 crnt->width  == next->width) {
 int64_t sad;
 double mafd, diff;
@@ -304,21 +306,26 @@ static int filter_slice16(AVFilterContext *ctx, void 
*arg, int job, int nb_jobs)
 }
 
 static int blend_frames(AVFilterContext *ctx, float interpolate,
-AVFrame *copy_src1, AVFrame *copy_src2)
+int src1, int src2)
 {
 FrameRateContext *s = ctx->priv;
 AVFilterLink *outlink = ctx->outputs[0];
 double interpolate_scene_score = 0;
 
-if ((s->flags & FRAMERATE_FLAG_SCD) && copy_src2) {
-interpolate_scene_score = get_scene_score(ctx, copy_src1, copy_src2);
+if ((s->flags & FRAMERATE_FLAG_SCD) && s->srce[src1] && s->srce[src2]) {
+int i1 = src1 < src2 ? src1 : src2;
+int i2 = src1 < src2 ? src2 : src1;
+if (i2 == i1 + 1 && s->srce_score[i1] >= 0.0)
+interpolate_scene_score = s->srce_score[i1];
+else
+interpolate_scene_score = s->srce_score[i1] = get_scene_score(ctx, 
s->srce[i1], s->srce[i2]);
 ff_dlog(ctx, "blend_frames() interpolate scene score:%f\n", 
interpolate_scene_score);
 }
 // decide if the shot-change detection allows us to blend two frames
-if (interpolate_scene_score < s->scene_score && copy_src2) {
+if (interpolate_scene_score < s->scene_score && s->srce[src2]) {
 ThreadData td;
-td.copy_src1 = copy_src1;
-td.copy_src2 = copy_src2;
+td.copy_src1 = s->srce[src1];
+td.copy_src2 = s->srce[src2];
 td.src2_factor = fabsf(interpolate) * (1 << (s->bitdepth - 8));
 td.src1_factor = s->max - td.src2_factor;
 
@@ -340,8 +347,8 @@ static int process_work_frame(AVFilterContext *ctx, int 
stop)
 {
 FrameRateContext *s = ctx->priv;
 int64_t work_next_pts;
-AVFrame *copy_src1;
 float interpolate;
+int src1, src2;
 
 ff_dlog(ctx, "process_work_frame()\n");
 
@@ -385,28 +392,26 @@ static int process_work_frame(AVFilterContext *ctx, int 
stop)
 // calculate interpolation
 interpolate = ((s->pts - s->srce_pts_dest[s->crnt]) * 256.0 / 
s->average_srce_pts_dest_delta);
 ff_dlog(ctx, "process_work_frame() interpolate:%f/256\n", interpolate);
-copy_src1 = s->srce[s->crnt];
+src1 = s->crnt;
 if (interpolate > s->interp_end) {
 ff_dlog(ctx, "process_work_frame() source is:NEXT\n");
-copy_src1 = s->srce[s->next];
+src1 = s->next;
 }
 if (s->srce[s->prev] && interpolate < -s->interp_end) {
 ff_dlog(ctx, "process_work_frame() source is:PREV\n");
-copy_src1 = s->srce[s->prev];
+src1 = s->prev;
 }
 
 // decide whether to blend two frames
 if ((interpolate >= s->interp_start && interpolate <= s->interp_end) || 
(interpolate <= -s->interp_start && interpolate >= -s->interp_end)) {
-AVFrame *copy_src2;
-
 if (interpolate > 0) {

[FFmpeg-cvslog] avfilter/vf_framerate: factorize blend_frames

2017-12-21 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sat Dec  9 23:00:57 
2017 +0100| [090b740680f91e0f2bf07423c36df7166740e8f6] | committer: Marton 
Balint

avfilter/vf_framerate: factorize blend_frames

Signed-off-by: Marton Balint 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=090b740680f91e0f2bf07423c36df7166740e8f6
---

 libavfilter/vf_framerate.c | 54 ++
 1 file changed, 7 insertions(+), 47 deletions(-)

diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c
index d505c5a8a4..f931a6f512 100644
--- a/libavfilter/vf_framerate.c
+++ b/libavfilter/vf_framerate.c
@@ -73,8 +73,6 @@ typedef struct FrameRateContext {
 int64_t srce_pts_dest[N_SRCE];  ///< pts for source frames scaled to 
output timebase
 int64_t pts;///< pts of frame we are working on
 
-int (*blend_frames)(AVFilterContext *ctx, float interpolate,
-AVFrame *copy_src1, AVFrame *copy_src2);
 int max;
 int bitdepth;
 AVFrame *work;
@@ -321,16 +319,16 @@ static int filter_slice16(AVFilterContext *ctx, void 
*arg, int job, int nb_jobs)
 return 0;
 }
 
-static int blend_frames16(AVFilterContext *ctx, float interpolate,
-  AVFrame *copy_src1, AVFrame *copy_src2)
+static int blend_frames(AVFilterContext *ctx, float interpolate,
+AVFrame *copy_src1, AVFrame *copy_src2)
 {
 FrameRateContext *s = ctx->priv;
 AVFilterLink *outlink = ctx->outputs[0];
 double interpolate_scene_score = 0;
 
 if ((s->flags & FRAMERATE_FLAG_SCD) && copy_src2) {
-interpolate_scene_score = get_scene_score16(ctx, copy_src1, copy_src2);
-ff_dlog(ctx, "blend_frames16() interpolate scene score:%f\n", 
interpolate_scene_score);
+interpolate_scene_score = s->bitdepth == 8 ? get_scene_score(ctx, 
copy_src1, copy_src2) : get_scene_score16(ctx, copy_src1, copy_src2);
+ff_dlog(ctx, "blend_frames() interpolate scene score:%f\n", 
interpolate_scene_score);
 }
 // decide if the shot-change detection allows us to blend two frames
 if (interpolate_scene_score < s->scene_score && copy_src2) {
@@ -347,42 +345,8 @@ static int blend_frames16(AVFilterContext *ctx, float 
interpolate,
 
 av_frame_copy_props(s->work, s->srce[s->crnt]);
 
-ff_dlog(ctx, "blend_frames16() INTERPOLATE to create work frame\n");
-ctx->internal->execute(ctx, filter_slice16, , NULL, 
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
-return 1;
-}
-return 0;
-}
-
-static int blend_frames8(AVFilterContext *ctx, float interpolate,
- AVFrame *copy_src1, AVFrame *copy_src2)
-{
-FrameRateContext *s = ctx->priv;
-AVFilterLink *outlink = ctx->outputs[0];
-double interpolate_scene_score = 0;
-
-if ((s->flags & FRAMERATE_FLAG_SCD) && copy_src2) {
-interpolate_scene_score = get_scene_score(ctx, copy_src1, copy_src2);
-ff_dlog(ctx, "blend_frames8() interpolate scene score:%f\n", 
interpolate_scene_score);
-}
-// decide if the shot-change detection allows us to blend two frames
-if (interpolate_scene_score < s->scene_score && copy_src2) {
-ThreadData td;
-td.copy_src1 = copy_src1;
-td.copy_src2 = copy_src2;
-td.src2_factor = fabsf(interpolate);
-td.src1_factor = 256 - td.src2_factor;
-
-// get work-space for output frame
-s->work = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-if (!s->work)
-return AVERROR(ENOMEM);
-
-av_frame_copy_props(s->work, s->srce[s->crnt]);
-
-ff_dlog(ctx, "blend_frames8() INTERPOLATE to create work frame\n");
-ctx->internal->execute(ctx, filter_slice8, , NULL, 
FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
-
+ff_dlog(ctx, "blend_frames() INTERPOLATE to create work frame\n");
+ctx->internal->execute(ctx, s->bitdepth == 8 ? filter_slice8 : 
filter_slice16, , NULL, FFMIN(outlink->h, ff_filter_get_nb_threads(ctx)));
 return 1;
 }
 return 0;
@@ -458,7 +422,7 @@ static int process_work_frame(AVFilterContext *ctx, int 
stop)
 ff_dlog(ctx, "process_work_frame() interpolate source is:PREV\n");
 copy_src2 = s->srce[s->prev];
 }
-if (s->blend_frames(ctx, interpolate, copy_src1, copy_src2))
+if (blend_frames(ctx, interpolate, copy_src1, copy_src2))
 goto copy_done;
 else
 ff_dlog(ctx, "process_work_frame() CUT - DON'T INTERPOLATE\n");
@@ -622,10 +586,6 @@ static int config_input(AVFilterLink *inlink)
 
 s->srce_time_base = inlink->time_base;
 
-if (s->bitdepth == 8)
-s->blend_frames = blend_frames8;
-else
-s->blend_frames = blend_frames16;
 s->max = 1 << (s->bitdepth);
 
 return 0;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org

[FFmpeg-cvslog] avcodec/mpeg4videodec: Add support for parsing and exporting video_range

2017-12-21 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Dec 10 15:01:43 2017 +0100| [4b2a186ef02c1fbe7f7cae30a2bdfff72bcc75f7] | 
committer: Michael Niedermayer

avcodec/mpeg4videodec: Add support for parsing and exporting video_range

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b2a186ef02c1fbe7f7cae30a2bdfff72bcc75f7
---

 libavcodec/mpeg4video.h|  3 +++
 libavcodec/mpeg4videodec.c | 33 +
 2 files changed, 36 insertions(+)

diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h
index 515b008ae4..0ba502d50b 100644
--- a/libavcodec/mpeg4video.h
+++ b/libavcodec/mpeg4video.h
@@ -43,6 +43,9 @@
 #define ACE_VO_TYPE 12
 #define ADV_SIMPLE_VO_TYPE  17
 
+#define VOT_VIDEO_ID 1
+#define VOT_STILL_TEXTURE_ID 2
+
 // aspect_ratio_info
 #define EXTENDED_PAR 15
 
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index cdd7077f01..e9cba25dd0 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -1754,6 +1754,37 @@ static int mpeg4_decode_profile_level(MpegEncContext *s, 
GetBitContext *gb)
 return 0;
 }
 
+static int mpeg4_decode_visual_object(MpegEncContext *s, GetBitContext *gb)
+{
+int visual_object_type;
+int is_visual_object_identifier = get_bits1(gb);
+
+if (is_visual_object_identifier) {
+skip_bits(gb, 4+3);
+}
+visual_object_type = get_bits(gb, 4);
+
+if (visual_object_type == VOT_VIDEO_ID ||
+visual_object_type == VOT_STILL_TEXTURE_ID) {
+int video_signal_type = get_bits1(gb);
+if (video_signal_type) {
+int video_format = get_bits(gb, 3);
+int video_range = get_bits1(gb);
+int color_description = get_bits1(gb);
+
+s->avctx->color_range = video_range ? AVCOL_RANGE_JPEG : 
AVCOL_RANGE_MPEG;
+
+if (color_description) {
+s->avctx->color_primaries = get_bits(gb, 8);
+s->avctx->color_trc   = get_bits(gb, 8);
+s->avctx->colorspace  = get_bits(gb, 8);
+}
+}
+}
+
+return 0;
+}
+
 static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
 {
 MpegEncContext *s = >m;
@@ -2684,6 +2715,8 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, 
GetBitContext *gb)
 mpeg4_decode_gop_header(s, gb);
 } else if (startcode == VOS_STARTCODE) {
 mpeg4_decode_profile_level(s, gb);
+} else if (startcode == VISUAL_OBJ_STARTCODE) {
+mpeg4_decode_visual_object(s, gb);
 } else if (startcode == VOP_STARTCODE) {
 break;
 }

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


[FFmpeg-cvslog] avcodec/jpeg2000dec: Allocate lengthinc and data_start arrays as needed

2017-12-21 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Dec 17 18:29:45 2017 +0100| [42274db1c623d2c0acd616cc0d3a0e5489e3bdb2] | 
committer: Michael Niedermayer

avcodec/jpeg2000dec: Allocate lengthinc and data_start arrays as needed

Decreases memory requirements
Fixes: OOM
Fixes: 4525/clusterfuzz-testcase-minimized-6400713073623040

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42274db1c623d2c0acd616cc0d3a0e5489e3bdb2
---

 libavcodec/jpeg2000.c| 3 ++-
 libavcodec/jpeg2000.h| 4 ++--
 libavcodec/jpeg2000dec.c | 9 +
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index 5f3965047f..e7f03bd0df 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -359,7 +359,6 @@ static int init_prec(Jpeg2000Band *band,
 
 cblk->lblock= 3;
 cblk->length= 0;
-memset(cblk->lengthinc, 0, sizeof(cblk->lengthinc));
 cblk->npasses   = 0;
 }
 
@@ -607,6 +606,8 @@ void ff_jpeg2000_cleanup(Jpeg2000Component *comp, 
Jpeg2000CodingStyle *codsty)
 Jpeg2000Cblk *cblk = >cblk[cblkno];
 av_freep(>data);
 av_freep(>passes);
+av_freep(>lengthinc);
+av_freep(>data_start);
 }
 av_freep(>cblk);
 }
diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h
index 752feae96b..c429ca5996 100644
--- a/libavcodec/jpeg2000.h
+++ b/libavcodec/jpeg2000.h
@@ -165,14 +165,14 @@ typedef struct Jpeg2000Cblk {
 uint8_t ninclpasses; // number coding of passes included in codestream
 uint8_t nonzerobits;
 uint16_t length;
-uint16_t lengthinc[JPEG2000_MAX_PASSES];
+uint16_t *lengthinc;
 uint8_t nb_lengthinc;
 uint8_t lblock;
 uint8_t *data;
 size_t data_allocated;
 int nb_terminations;
 int nb_terminationsinc;
-int data_start[JPEG2000_MAX_PASSES];
+int *data_start;
 Jpeg2000Pass *passes;
 int coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}}
 } Jpeg2000Cblk; // code block
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 0309b1f6fb..617273b36b 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -949,6 +949,7 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext 
*s, Jpeg2000Tile *tile,
 for (cblkno = 0; cblkno < nb_code_blocks; cblkno++) {
 Jpeg2000Cblk *cblk = prec->cblk + cblkno;
 int incl, newpasses, llen;
+void *tmp;
 
 if (cblk->npasses)
 incl = get_bits(s, 1);
@@ -988,6 +989,14 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext 
*s, Jpeg2000Tile *tile,
 
 cblk->nb_lengthinc = 0;
 cblk->nb_terminationsinc = 0;
+av_free(cblk->lengthinc);
+cblk->lengthinc  = av_mallocz_array(newpasses, 
sizeof(*cblk->lengthinc));
+if (!cblk->lengthinc)
+return AVERROR(ENOMEM);
+tmp = av_realloc_array(cblk->data_start, cblk->nb_terminations + 
newpasses + 1, sizeof(*cblk->data_start));
+if (!tmp)
+return AVERROR(ENOMEM);
+cblk->data_start = tmp;
 do {
 int newpasses1 = 0;
 

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


[FFmpeg-cvslog] avcodec/jpeg2000dec: Free lengthinc earlier

2017-12-21 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Dec 17 23:35:26 2017 +0100| [80344959f064c7ea10d023862e0f6b79835de9de] | 
committer: Michael Niedermayer

avcodec/jpeg2000dec: Free lengthinc earlier

Reduces memory needed

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=80344959f064c7ea10d023862e0f6b79835de9de
---

 libavcodec/jpeg2000dec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 617273b36b..8071dc3c84 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -1046,6 +1046,8 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext 
*s, Jpeg2000Tile *tile,
 nb_code_blocks = prec->nb_codeblocks_height * 
prec->nb_codeblocks_width;
 for (cblkno = 0; cblkno < nb_code_blocks; cblkno++) {
 Jpeg2000Cblk *cblk = prec->cblk + cblkno;
+if (!cblk->nb_terminationsinc && !cblk->lengthinc)
+continue;
 for (cwsno = 0; cwsno < cblk->nb_lengthinc; cwsno ++) {
 if (cblk->data_allocated < cblk->length + 
cblk->lengthinc[cwsno] + 4) {
 size_t new_size = FFMAX(2*cblk->data_allocated, 
cblk->length + cblk->lengthinc[cwsno] + 4);
@@ -1075,6 +1077,7 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext 
*s, Jpeg2000Tile *tile,
 cblk->data_start[cblk->nb_terminations] = cblk->length;
 }
 }
+av_freep(>lengthinc);
 }
 }
 return 0;

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


[FFmpeg-cvslog] rkmppdec: move AV_CODEC_CAP_AVOID_PROBING to the correct field

2017-12-21 Thread wm4
ffmpeg | branch: master | wm4  | Thu Dec 14 19:47:18 
2017 +0100| [1083859cb8c9d9b3bcee970dd33b71015a0a11bc] | committer: wm4

rkmppdec: move AV_CODEC_CAP_AVOID_PROBING to the correct field

AVCodec.caps_internal doesn't hold this field.

(Untested.)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1083859cb8c9d9b3bcee970dd33b71015a0a11bc
---

 libavcodec/rkmppdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c
index fa522ce2ed..c57a6ded38 100644
--- a/libavcodec/rkmppdec.c
+++ b/libavcodec/rkmppdec.c
@@ -588,8 +588,7 @@ static const AVCodecHWConfigInternal *rkmpp_hw_configs[] = {
 .receive_frame  = rkmpp_receive_frame, \
 .flush  = rkmpp_flush, \
 .priv_class = _##NAME##_dec_class, \
-.capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE, \
-.caps_internal  = AV_CODEC_CAP_AVOID_PROBING, \
+.capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING | 
AV_CODEC_CAP_HARDWARE, \
 .pix_fmts   = (const enum AVPixelFormat[]) { AV_PIX_FMT_DRM_PRIME, 
\
  AV_PIX_FMT_NONE}, \
 .hw_configs = rkmpp_hw_configs, \

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


[FFmpeg-cvslog] v4l_m2m: add missing AV_CODEC_CAP_DELAY flags

2017-12-21 Thread wm4
ffmpeg | branch: master | wm4  | Thu Dec 14 19:46:52 
2017 +0100| [55eebf2a11d28146658565948d6649311f20c0e1] | committer: wm4

v4l_m2m: add missing AV_CODEC_CAP_DELAY flags

This is pretty much a requirement for any codec that handles modern
codecs like h264, but it was missing. Potentially could lead to issues
like missing frames at the end of a stream.

Tested-by: Jorge Ramirez 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=55eebf2a11d28146658565948d6649311f20c0e1
---

 libavcodec/v4l2_m2m_dec.c | 2 +-
 libavcodec/v4l2_m2m_enc.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
index c4ea20ea83..8308613978 100644
--- a/libavcodec/v4l2_m2m_dec.c
+++ b/libavcodec/v4l2_m2m_dec.c
@@ -215,7 +215,7 @@ AVCodec ff_ ## NAME ## _v4l2m2m_decoder = { \
 .receive_frame  = v4l2_receive_frame,\
 .close  = ff_v4l2_m2m_codec_end,\
 .bsfs   = bsf_name, \
-.capabilities   = AV_CODEC_CAP_HARDWARE, \
+.capabilities   = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \
 .wrapper_name   = "v4l2m2m", \
 };
 
diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index f62ce7cdb5..7e88f4d2e6 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -335,7 +335,7 @@ AVCodec ff_ ## NAME ## _v4l2m2m_encoder = { \
 .send_frame = v4l2_send_frame,\
 .receive_packet = v4l2_receive_packet,\
 .close  = ff_v4l2_m2m_codec_end,\
-.capabilities   = AV_CODEC_CAP_HARDWARE, \
+.capabilities   = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \
 .wrapper_name   = "v4l2m2m", \
 };
 

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


[FFmpeg-cvslog] avfilter/af_biquads: add kHz width_type

2017-12-21 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Thu Dec 21 11:40:38 
2017 +0100| [c99ed89f89619a4f7c078fa5590ebf6532fdbcc0] | committer: Paul B Mahol

avfilter/af_biquads: add kHz width_type

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c99ed89f89619a4f7c078fa5590ebf6532fdbcc0
---

 doc/filters.texi | 16 
 libavfilter/af_biquads.c | 50 +++-
 2 files changed, 48 insertions(+), 18 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index fc912b6716..6a6d5a334e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -1127,6 +1127,8 @@ Q-Factor
 octave
 @item s
 slope
+@item k
+kHz
 @end table
 
 @item width, w
@@ -1884,6 +1886,8 @@ Q-Factor
 octave
 @item s
 slope
+@item k
+kHz
 @end table
 
 @item width, w
@@ -1933,6 +1937,8 @@ Q-Factor
 octave
 @item s
 slope
+@item k
+kHz
 @end table
 
 @item width, w
@@ -1989,6 +1995,8 @@ Q-Factor
 octave
 @item s
 slope
+@item k
+kHz
 @end table
 
 @item width, w
@@ -2642,6 +2650,8 @@ Q-Factor
 octave
 @item s
 slope
+@item k
+kHz
 @end table
 
 @item width, w
@@ -3079,6 +3089,8 @@ Q-Factor
 octave
 @item s
 slope
+@item k
+kHz
 @end table
 
 @item width, w
@@ -3385,6 +3397,8 @@ Q-Factor
 octave
 @item s
 slope
+@item k
+kHz
 @end table
 
 @item width, w
@@ -4294,6 +4308,8 @@ Q-Factor
 octave
 @item s
 slope
+@item k
+kHz
 @end table
 
 @item width, w
diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 3159bd6db0..c04d03f191 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -86,6 +86,8 @@ enum WidthType {
 OCTAVE,
 QFACTOR,
 SLOPE,
+KHERTZ,
+NB_WTYPE,
 };
 
 typedef struct ChanCache {
@@ -259,6 +261,9 @@ static int config_filter(AVFilterLink *outlink, int reset)
 case HERTZ:
 alpha = sin(w0) / (2 * s->frequency / s->width);
 break;
+case KHERTZ:
+alpha = sin(w0) / (2 * s->frequency / (s->width * 1000));
+break;
 case OCTAVE:
 alpha = sin(w0) * sinh(log(2.) / 2 * s->width * w0 / sin(w0));
 break;
@@ -516,6 +521,7 @@ static int process_command(AVFilterContext *ctx, const char 
*cmd, const char *ar
 case 'q': width_type = QFACTOR; break;
 case 'o': width_type = OCTAVE;  break;
 case 's': width_type = SLOPE;   break;
+case 'k': width_type = KHERTZ;  break;
 default:
 av_log(ctx, AV_LOG_ERROR, "Invalid width_type value: %c\n", 
width_type);
 return AVERROR(EINVAL);
@@ -608,12 +614,13 @@ AVFilter ff_af_##name_ = { \
 static const AVOption equalizer_options[] = {
 {"frequency", "set central frequency", OFFSET(frequency), 
AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 99, FLAGS},
 {"f", "set central frequency", OFFSET(frequency), 
AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 99, FLAGS},
-{"width_type", "set filter-width type", OFFSET(width_type), 
AV_OPT_TYPE_INT, {.i64=QFACTOR}, HERTZ, SLOPE, FLAGS, "width_type"},
-{"t",  "set filter-width type", OFFSET(width_type), 
AV_OPT_TYPE_INT, {.i64=QFACTOR}, HERTZ, SLOPE, FLAGS, "width_type"},
+{"width_type", "set filter-width type", OFFSET(width_type), 
AV_OPT_TYPE_INT, {.i64=QFACTOR}, HERTZ, NB_WTYPE-1, FLAGS, "width_type"},
+{"t",  "set filter-width type", OFFSET(width_type), 
AV_OPT_TYPE_INT, {.i64=QFACTOR}, HERTZ, NB_WTYPE-1, FLAGS, "width_type"},
 {"h", "Hz", 0, AV_OPT_TYPE_CONST, {.i64=HERTZ}, 0, 0, FLAGS, "width_type"},
 {"q", "Q-Factor", 0, AV_OPT_TYPE_CONST, {.i64=QFACTOR}, 0, 0, FLAGS, 
"width_type"},
 {"o", "octave", 0, AV_OPT_TYPE_CONST, {.i64=OCTAVE}, 0, 0, FLAGS, 
"width_type"},
 {"s", "slope", 0, AV_OPT_TYPE_CONST, {.i64=SLOPE}, 0, 0, FLAGS, 
"width_type"},
+{"k", "kHz", 0, AV_OPT_TYPE_CONST, {.i64=KHERTZ}, 0, 0, FLAGS, 
"width_type"},
 {"width", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 
0, 999, FLAGS},
 {"w", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 
0, 999, FLAGS},
 {"gain", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 
900, FLAGS},
@@ -629,12 +636,13 @@ DEFINE_BIQUAD_FILTER(equalizer, "Apply two-pole peaking 
equalization (EQ) filter
 static const AVOption bass_options[] = {
 {"frequency", "set central frequency", OFFSET(frequency), 
AV_OPT_TYPE_DOUBLE, {.dbl=100}, 0, 99, FLAGS},
 {"f", "set central frequency", OFFSET(frequency), 
AV_OPT_TYPE_DOUBLE, {.dbl=100}, 0, 99, FLAGS},
-{"width_type", "set filter-width type", OFFSET(width_type), 
AV_OPT_TYPE_INT, {.i64=QFACTOR}, HERTZ, SLOPE, FLAGS, "width_type"},
-{"t",  "set filter-width type", OFFSET(width_type), 
AV_OPT_TYPE_INT, {.i64=QFACTOR}, HERTZ, SLOPE, FLAGS, "width_type"},
+{"width_type", "set filter-width type", OFFSET(width_type), 
AV_OPT_TYPE_INT, {.i64=QFACTOR}, HERTZ, NB_WTYPE-1, FLAGS, "width_type"},
+{"t",  "set 

[FFmpeg-cvslog] avfilter/af_biquads: change defaults for biquad filter

2017-12-21 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Thu Dec 21 12:06:21 
2017 +0100| [5a6e753bc62f0773f44069a9a8e10e9c13326d6a] | committer: Paul B Mahol

avfilter/af_biquads: change defaults for biquad filter

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5a6e753bc62f0773f44069a9a8e10e9c13326d6a
---

 libavfilter/af_biquads.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index 72e1074303..1d72cd5751 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -784,11 +784,11 @@ DEFINE_BIQUAD_FILTER(allpass, "Apply a two-pole all-pass 
filter.");
 #if CONFIG_BIQUAD_FILTER
 static const AVOption biquad_options[] = {
 {"a0", NULL, OFFSET(a0), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
-{"a1", NULL, OFFSET(a1), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
-{"a2", NULL, OFFSET(a2), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
-{"b0", NULL, OFFSET(b0), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
-{"b1", NULL, OFFSET(b1), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
-{"b2", NULL, OFFSET(b2), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
+{"a1", NULL, OFFSET(a1), AV_OPT_TYPE_DOUBLE, {.dbl=0}, INT32_MIN, 
INT32_MAX, FLAGS},
+{"a2", NULL, OFFSET(a2), AV_OPT_TYPE_DOUBLE, {.dbl=0}, INT32_MIN, 
INT32_MAX, FLAGS},
+{"b0", NULL, OFFSET(b0), AV_OPT_TYPE_DOUBLE, {.dbl=0}, INT32_MIN, 
INT32_MAX, FLAGS},
+{"b1", NULL, OFFSET(b1), AV_OPT_TYPE_DOUBLE, {.dbl=0}, INT32_MIN, 
INT32_MAX, FLAGS},
+{"b2", NULL, OFFSET(b2), AV_OPT_TYPE_DOUBLE, {.dbl=0}, INT32_MIN, 
INT32_MAX, FLAGS},
 {"channels", "set channels to filter", OFFSET(channels), 
AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
 {"c","set channels to filter", OFFSET(channels), 
AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
 {NULL}

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


[FFmpeg-cvslog] avfilter/af_biquads: increase width range

2017-12-21 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Thu Dec 21 11:44:22 
2017 +0100| [7fc89f226fb645c9701c8998a047a243a29f24fa] | committer: Paul B Mahol

avfilter/af_biquads: increase width range

Signed-off-by: Paul B Mahol 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7fc89f226fb645c9701c8998a047a243a29f24fa
---

 libavfilter/af_biquads.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
index c04d03f191..72e1074303 100644
--- a/libavfilter/af_biquads.c
+++ b/libavfilter/af_biquads.c
@@ -621,8 +621,8 @@ static const AVOption equalizer_options[] = {
 {"o", "octave", 0, AV_OPT_TYPE_CONST, {.i64=OCTAVE}, 0, 0, FLAGS, 
"width_type"},
 {"s", "slope", 0, AV_OPT_TYPE_CONST, {.i64=SLOPE}, 0, 0, FLAGS, 
"width_type"},
 {"k", "kHz", 0, AV_OPT_TYPE_CONST, {.i64=KHERTZ}, 0, 0, FLAGS, 
"width_type"},
-{"width", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 
0, 999, FLAGS},
-{"w", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 
0, 999, FLAGS},
+{"width", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 
0, 9, FLAGS},
+{"w", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 
0, 9, FLAGS},
 {"gain", "set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 
900, FLAGS},
 {"g","set gain", OFFSET(gain), AV_OPT_TYPE_DOUBLE, {.dbl=0}, -900, 
900, FLAGS},
 {"channels", "set channels to filter", OFFSET(channels), 
AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
@@ -708,8 +708,8 @@ static const AVOption bandreject_options[] = {
 {"o", "octave", 0, AV_OPT_TYPE_CONST, {.i64=OCTAVE}, 0, 0, FLAGS, 
"width_type"},
 {"s", "slope", 0, AV_OPT_TYPE_CONST, {.i64=SLOPE}, 0, 0, FLAGS, 
"width_type"},
 {"k", "kHz", 0, AV_OPT_TYPE_CONST, {.i64=KHERTZ}, 0, 0, FLAGS, 
"width_type"},
-{"width", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 
0, 999, FLAGS},
-{"w", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 
0, 999, FLAGS},
+{"width", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 
0, 9, FLAGS},
+{"w", "set band-width", OFFSET(width), AV_OPT_TYPE_DOUBLE, {.dbl=0.5}, 
0, 9, FLAGS},
 {"channels", "set channels to filter", OFFSET(channels), 
AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
 {"c","set channels to filter", OFFSET(channels), 
AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
 {NULL}
@@ -783,12 +783,12 @@ DEFINE_BIQUAD_FILTER(allpass, "Apply a two-pole all-pass 
filter.");
 #endif  /* CONFIG_ALLPASS_FILTER */
 #if CONFIG_BIQUAD_FILTER
 static const AVOption biquad_options[] = {
-{"a0", NULL, OFFSET(a0), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT16_MIN, 
INT16_MAX, FLAGS},
-{"a1", NULL, OFFSET(a1), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT16_MIN, 
INT16_MAX, FLAGS},
-{"a2", NULL, OFFSET(a2), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT16_MIN, 
INT16_MAX, FLAGS},
-{"b0", NULL, OFFSET(b0), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT16_MIN, 
INT16_MAX, FLAGS},
-{"b1", NULL, OFFSET(b1), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT16_MIN, 
INT16_MAX, FLAGS},
-{"b2", NULL, OFFSET(b2), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT16_MIN, 
INT16_MAX, FLAGS},
+{"a0", NULL, OFFSET(a0), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
+{"a1", NULL, OFFSET(a1), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
+{"a2", NULL, OFFSET(a2), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
+{"b0", NULL, OFFSET(b0), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
+{"b1", NULL, OFFSET(b1), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
+{"b2", NULL, OFFSET(b2), AV_OPT_TYPE_DOUBLE, {.dbl=1}, INT32_MIN, 
INT32_MAX, FLAGS},
 {"channels", "set channels to filter", OFFSET(channels), 
AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
 {"c","set channels to filter", OFFSET(channels), 
AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=-1}, INT64_MIN, INT64_MAX, FLAGS},
 {NULL}

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