[FFmpeg-cvslog] avfilter: add readvitc filter

2016-04-16 Thread Tobias Rapp
ffmpeg | branch: master | Tobias Rapp  | Wed Apr  6 
16:25:53 2016 +0200| [2aad631a818cc49fc30da349c319abfb119adea1] | committer: 
Paul B Mahol

avfilter: add readvitc filter

Add a filter to scan the top lines of video frames for vertical interval
timecode (VITC) information and attach it as metadata keys.

Signed-off-by: Tobias Rapp 

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

 Changelog |1 +
 MAINTAINERS   |1 +
 doc/filters.texi  |   37 +++
 libavfilter/Makefile  |1 +
 libavfilter/allfilters.c  |1 +
 libavfilter/version.h |2 +-
 libavfilter/vf_readvitc.c |  258 +
 7 files changed, 300 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 18fdb27..6e40739 100644
--- a/Changelog
+++ b/Changelog
@@ -25,6 +25,7 @@ version :
 - hash and framehash muxers
 - colorspace filter
 - hdcd filter
+- readvitc filter
 
 version 3.0:
 - Common Encryption (CENC) MP4 encoding and decoding support
diff --git a/MAINTAINERS b/MAINTAINERS
index a993a67..d2593e5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -385,6 +385,7 @@ Filters:
   vf_neighbor.c Paul B Mahol
   vf_psnr.c Paul B Mahol
   vf_random.c   Paul B Mahol
+  vf_readvitc.c Tobias Rapp (CC t.rapp at noa-archive 
dot com)
   vf_scale.cMichael Niedermayer
   vf_separatefields.c   Paul B Mahol
   vf_ssim.c Paul B Mahol
diff --git a/doc/filters.texi b/doc/filters.texi
index 61307e5..b17b115 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -10618,6 +10618,43 @@ less than @code{0}, the filter will try to use a good 
random seed on a
 best effort basis.
 @end table
 
+@section readvitc
+
+Read vertical interval timecode (VITC) information from the top lines of a
+video frame.
+
+The filter adds frame metadata key @code{lavfi.readvitc.tc_str} with the
+timecode value, if a valid timecode has been detected. Further metadata key
+@code{lavfi.readvitc.found} is set to 0/1 depending on whether
+timecode data has been found or not.
+
+This filter accepts the following options:
+
+@table @option
+@item scan_max
+Set the maximum number of lines to scan for VITC data. If the value is set to
+@code{-1} the full video frame is scanned. Default is @code{45}.
+
+@item thr_b
+Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
+default value is @code{0.2}. The value must be equal or less than @code{thr_w}.
+
+@item thr_w
+Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
+default value is @code{0.6}. The value must be equal or greater than 
@code{thr_b}.
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Detect and draw VITC data onto the video frame; if no valid VITC is detected,
+draw @code{--:--:--:--} as a placeholder:
+@example
+ffmpeg -i input.avi -filter:v 
'readvitc,drawtext=fontfile=FreeMono.ttf:text=%@{metadata\\:lavfi.readvitc.tc_str\\:--\\:--\\:--\\:--@}:x=(w-tw)/2:y=400-ascent'
+@end example
+@end itemize
+
 @section remap
 
 Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 2ea8c84..f1f37cb 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -227,6 +227,7 @@ OBJS-$(CONFIG_PSNR_FILTER)   += vf_psnr.o 
dualinput.o framesync.
 OBJS-$(CONFIG_PULLUP_FILTER) += vf_pullup.o
 OBJS-$(CONFIG_QP_FILTER) += vf_qp.o
 OBJS-$(CONFIG_RANDOM_FILTER) += vf_random.o
+OBJS-$(CONFIG_READVITC_FILTER)   += vf_readvitc.o
 OBJS-$(CONFIG_REALTIME_FILTER)   += f_realtime.o
 OBJS-$(CONFIG_REMAP_FILTER)  += vf_remap.o framesync.o
 OBJS-$(CONFIG_REMOVEGRAIN_FILTER)+= vf_removegrain.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 52d3f61..ad6ba21 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -247,6 +247,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(PULLUP, pullup, vf);
 REGISTER_FILTER(QP, qp, vf);
 REGISTER_FILTER(RANDOM, random, vf);
+REGISTER_FILTER(READVITC,   readvitc,   vf);
 REGISTER_FILTER(REALTIME,   realtime,   vf);
 REGISTER_FILTER(REMAP,  remap,  vf);
 REGISTER_FILTER(REMOVEGRAIN,removegrain,vf);
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 48b9d9a..f4ade1c 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -30,7 +30,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVFILTER_VERSION_MAJOR   6
-#define LIBAVFILTER_VERSION_MINOR  42
+#define LIBAVFILTER_VERSION_MINOR  43
 #define LIBAVFILTER_VERSION_MICRO 100
 
 #define LIBAVFILTER_VERS

[FFmpeg-cvslog] vc2enc: don't require interlacing for 1080p50/60 base video formats

2016-04-16 Thread Rostislav Pehlivanov
ffmpeg | branch: master | Rostislav Pehlivanov  | Sat Apr 
16 23:56:14 2016 +0100| [77fb7177afd69eacbf9034917ab85138a40d2d93] | committer: 
Rostislav Pehlivanov

vc2enc: don't require interlacing for 1080p50/60 base video formats

Typo

Signed-off-by: Rostislav Pehlivanov 

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

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

diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index 577d49d..07638c5 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -65,8 +65,8 @@ static const VC2BaseVideoFormat base_video_fmts[] = {
 { AV_PIX_FMT_YUV422P10, {1,50 }, 1280,  720, 0, 3,  "HD720P-50"  },
 { AV_PIX_FMT_YUV422P10, { 1001, 3 }, 1920, 1080, 1, 3,  "HD1080I-60" },
 { AV_PIX_FMT_YUV422P10, {1,25 }, 1920, 1080, 1, 3,  "HD1080I-50" },
-{ AV_PIX_FMT_YUV422P10, { 1001, 6 }, 1920, 1080, 1, 3,  "HD1080P-60" },
-{ AV_PIX_FMT_YUV422P10, {1,50 }, 1920, 1080, 1, 3,  "HD1080P-50" },
+{ AV_PIX_FMT_YUV422P10, { 1001, 6 }, 1920, 1080, 0, 3,  "HD1080P-60" },
+{ AV_PIX_FMT_YUV422P10, {1,50 }, 1920, 1080, 0, 3,  "HD1080P-50" },
 
 { AV_PIX_FMT_YUV444P12, {1,24 }, 2048, 1080, 0, 4,"DC2K" },
 { AV_PIX_FMT_YUV444P12, {1,24 }, 4096, 2160, 0, 5,"DC4K" },

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


[FFmpeg-cvslog] vc2enc: use 32x16 slices by default

2016-04-16 Thread Rostislav Pehlivanov
ffmpeg | branch: master | Rostislav Pehlivanov  | Sat Apr 
16 23:57:46 2016 +0100| [9e138c481306b4b1f32db0659055d30268163676] | committer: 
Rostislav Pehlivanov

vc2enc: use 32x16 slices by default

Approximately 1.25 times faster than 64x32, visually and
statistically improves quality.

Signed-off-by: Rostislav Pehlivanov 

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

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

diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index 07638c5..943198b 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -1234,8 +1234,8 @@ alloc_fail:
 #define VC2ENC_FLAGS (AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 static const AVOption vc2enc_options[] = {
 {"tolerance", "Max undershoot in percent", offsetof(VC2EncContext, 
tolerance), AV_OPT_TYPE_DOUBLE, {.dbl = 5.0f}, 0.0f, 45.0f, VC2ENC_FLAGS, 
"tolerance"},
-{"slice_width",   "Slice width",  offsetof(VC2EncContext, slice_width), 
AV_OPT_TYPE_INT, {.i64 = 64}, 32, 1024, VC2ENC_FLAGS, "slice_width"},
-{"slice_height",  "Slice height", offsetof(VC2EncContext, slice_height), 
AV_OPT_TYPE_INT, {.i64 = 32}, 8, 1024, VC2ENC_FLAGS, "slice_height"},
+{"slice_width",   "Slice width",  offsetof(VC2EncContext, slice_width), 
AV_OPT_TYPE_INT, {.i64 = 32}, 32, 1024, VC2ENC_FLAGS, "slice_width"},
+{"slice_height",  "Slice height", offsetof(VC2EncContext, slice_height), 
AV_OPT_TYPE_INT, {.i64 = 16}, 8, 1024, VC2ENC_FLAGS, "slice_height"},
 {"wavelet_depth", "Transform depth", offsetof(VC2EncContext, 
wavelet_depth), AV_OPT_TYPE_INT, {.i64 = 4}, 1, 5, VC2ENC_FLAGS, 
"wavelet_depth"},
 {"wavelet_type",  "Transform type",  offsetof(VC2EncContext, wavelet_idx), 
AV_OPT_TYPE_INT, {.i64 = VC2_TRANSFORM_9_7}, 0, VC2_TRANSFORMS_NB, 
VC2ENC_FLAGS, "wavelet_idx"},
 {"9_7",  "Deslauriers-Dubuc (9,7)", 0, AV_OPT_TYPE_CONST, 
{.i64 = VC2_TRANSFORM_9_7},INT_MIN, INT_MAX, VC2ENC_FLAGS, "wavelet_idx"},

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


[FFmpeg-cvslog] fate: add test for Ticket4816 (PNG decoding with alpha)

2016-04-16 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Apr 13 18:38:21 2016 +0200| [618032da0d05cfebb40bde46c1baceae1012fd27] | 
committer: Michael Niedermayer

fate: add test for Ticket4816 (PNG decoding with alpha)

Signed-off-by: Michael Niedermayer 

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

 tests/fate/video.mak|3 +++
 tests/ref/fate/rgbapng-4816 |6 ++
 2 files changed, 9 insertions(+)

diff --git a/tests/fate/video.mak b/tests/fate/video.mak
index 8b70b08..dd24d28 100644
--- a/tests/fate/video.mak
+++ b/tests/fate/video.mak
@@ -93,6 +93,9 @@ fate-cljr: CMD = framecrc -i 
$(TARGET_SAMPLES)/cljr/testcljr-partial.avi
 FATE_VIDEO-$(call DEMDEC, AVI, PNG) += fate-corepng
 fate-corepng: CMD = framecrc -i $(TARGET_SAMPLES)/png1/corepng-partial.avi
 
+FATE_VIDEO-$(call DEMDEC, AVI, PNG) += fate-rgbapng-4816
+fate-rgbapng-4816: CMD = framecrc -i 
$(TARGET_SAMPLES)/png1/55c99e750a5fd6_50314226.png
+
 FATE_VIDEO-$(call DEMDEC, AVS, AVS) += fate-creatureshock-avs
 fate-creatureshock-avs: CMD = framecrc -i 
$(TARGET_SAMPLES)/creatureshock-avs/OUTATIME.AVS -pix_fmt rgb24
 
diff --git a/tests/ref/fate/rgbapng-4816 b/tests/ref/fate/rgbapng-4816
new file mode 100644
index 000..99493bc
--- /dev/null
+++ b/tests/ref/fate/rgbapng-4816
@@ -0,0 +1,6 @@
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 330x330
+#sar 0: 0/1
+0,  0,  0,1,   435600, 0x961c0f09

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


[FFmpeg-cvslog] avcodec/exr: Fix "libavcodec/exr.c:1494:13: warning: ISO C90 forbids mixed declarations and code"

2016-04-16 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Apr 17 01:37:27 2016 +0200| [487c346d98c0180eb8e4066c2c341a2a19f7f0af] | 
committer: Michael Niedermayer

avcodec/exr: Fix "libavcodec/exr.c:1494:13: warning: ISO C90 forbids mixed 
declarations and code"

Signed-off-by: Michael Niedermayer 

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

 libavcodec/exr.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index f54ffad..363562e 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1484,6 +1484,8 @@ static int decode_header(EXRContext *s)
 continue;
 } else if ((var_size = check_header_variable(s, "tiles",
  "tiledesc", 22)) >= 0) {
+char tileLevel;
+
 if (!s->is_tile)
 av_log(s->avctx, AV_LOG_WARNING,
"Found tile attribute and scanline flags. Exr will be 
interpreted as scanline.\n");
@@ -1491,7 +1493,7 @@ static int decode_header(EXRContext *s)
 s->tile_attr.xSize = bytestream2_get_le32(&s->gb);
 s->tile_attr.ySize = bytestream2_get_le32(&s->gb);
 
-char tileLevel = bytestream2_get_byte(&s->gb);
+tileLevel = bytestream2_get_byte(&s->gb);
 s->tile_attr.level_mode = tileLevel & 0x0f;
 s->tile_attr.level_round = (tileLevel >> 4) & 0x0f;
 

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


[FFmpeg-cvslog] avformat/hashenc: add missing avio_flush to hash_write_trailer

2016-04-16 Thread James Almer
ffmpeg | branch: master | James Almer  | Sat Apr 16 21:31:58 
2016 -0300| [b63ba3a51782baca737e646110f4832f8abbaadd] | committer: James Almer

avformat/hashenc: add missing avio_flush to hash_write_trailer

It was accidentally deleted in the previous hashenc commit

Signed-off-by: James Almer 

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

 libavformat/hashenc.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c
index 01b00b5..a66db4a 100644
--- a/libavformat/hashenc.c
+++ b/libavformat/hashenc.c
@@ -79,6 +79,7 @@ static int hash_write_trailer(struct AVFormatContext *s)
 av_hash_final_hex(c->hash, buf + strlen(buf), sizeof(buf) - strlen(buf));
 av_strlcatf(buf, sizeof(buf), "\n");
 avio_write(s->pb, buf, strlen(buf));
+avio_flush(s->pb);
 
 av_hash_freep(&c->hash);
 return 0;

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


[FFmpeg-cvslog] avcodec/h264: Fix for H.264 configuration parsing

2016-04-16 Thread Ivan
ffmpeg | branch: master | Ivan  | Tue Apr 12 
16:32:04 2016 -0400| [3a727606c474d3d0b9efa3c900294a84bdb5e331] | committer: 
Michael Niedermayer

avcodec/h264: Fix for H.264 configuration parsing

Sometimes video fails to decode if H.264 configuration changes mid stream.
The reason is that configuration parser assumes that nal_ref_idc is equal to 11b
while actually some codecs but 01b there. The H.264 spec is somewhat
vague about this but it looks like it allows any non-zero nal_ref_idc for 
sps/pps.

Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index f1399b8..88768af 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1781,7 +1781,7 @@ static int is_extra(const uint8_t *buf, int buf_size)
 const uint8_t *p= buf+6;
 while(cnt--){
 int nalsize= AV_RB16(p) + 2;
-if(nalsize > buf_size - (p-buf) || p[2]!=0x67)
+if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 7)
 return 0;
 p += nalsize;
 }
@@ -1790,7 +1790,7 @@ static int is_extra(const uint8_t *buf, int buf_size)
 return 0;
 while(cnt--){
 int nalsize= AV_RB16(p) + 2;
-if(nalsize > buf_size - (p-buf) || p[2]!=0x68)
+if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 8)
 return 0;
 p += nalsize;
 }

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