[FFmpeg-cvslog] configure: add support for libnpp* from cuda sdk 9

2017-08-30 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Tue Aug 
29 13:30:29 2017 +0200| [1ac03c8dc0a9359cdd33e341303296862a0e5f84] | committer: 
Timo Rothenpieler

configure: add support for libnpp* from cuda sdk 9

Signed-off-by: Timo Rothenpieler 

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

 configure | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 61d8160491..172ff3fc07 100755
--- a/configure
+++ b/configure
@@ -5875,7 +5875,9 @@ enabled libmfx&& { use_pkg_config libmfx 
"mfx/mfxvideo.h" MFXInit ||
 enabled libmodplug&& require_pkg_config libmodplug 
libmodplug/modplug.h ModPlug_Load
 enabled libmp3lame&& require "libmp3lame >= 3.98.3" lame/lame.h 
lame_set_VBR_quality -lmp3lame
 enabled libmysofa && require libmysofa "mysofa.h" mysofa_load -lmysofa
-enabled libnpp&& require libnpp npp.h nppGetLibVersion -lnppi 
-lnppc
+enabled libnpp&& { check_lib libnpp npp.h nppGetLibVersion -lnppig 
-lnppicc -lnppc ||
+   check_lib libnpp npp.h nppGetLibVersion -lnppi 
-lnppc ||
+   die "ERROR: libnpp not found"; }
 enabled libopencore_amrnb && require libopencore_amrnb 
opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
 enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h 
D_IF_init -lopencore-amrwb
 enabled libopencv && { check_header opencv2/core/core_c.h &&

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


[FFmpeg-cvslog] compat/cuda/ptx2c: strip CR from each line

2017-08-30 Thread Ricardo Constantino
ffmpeg | branch: master | Ricardo Constantino  | Tue Aug 29 
01:46:13 2017 +0100| [7fbc0825773eb597c5a3f5679a8d58ced0d9456f] | committer: 
Timo Rothenpieler

compat/cuda/ptx2c: strip CR from each line

Windows nvcc + cl.exe produce a .ctx file with CR+LF newlines which
need to be stripped to work with gcc.

Signed-off-by: Timo Rothenpieler 

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

 compat/cuda/ptx2c.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat/cuda/ptx2c.sh b/compat/cuda/ptx2c.sh
index 1f37023290..5ccabbf56f 100755
--- a/compat/cuda/ptx2c.sh
+++ b/compat/cuda/ptx2c.sh
@@ -29,7 +29,7 @@ NAME="$(basename "$IN" | sed 's/\..*//')"
 printf "const char %s_ptx[] = \\" "$NAME" > "$OUT"
 while read LINE
 do
-printf "\n\t\"%s\\\n\"" "$(printf "%s" "$LINE" | sed 's/["\\]/\\&/g')" >> 
"$OUT"
+printf "\n\t\"%s\\\n\"" "$(printf "%s" "$LINE" | sed -e 's/\r//g' -e 
's/["\\]/\\&/g')" >> "$OUT"
 done < "$IN"
 printf ";\n" >> "$OUT"
 

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


[FFmpeg-cvslog] Add FITS Decoder

2017-08-30 Thread Paras Chadha
ffmpeg | branch: master | Paras Chadha  | Tue Aug 29 
23:04:44 2017 +0530| [61e4db4bb730409798dff8d87d83459cb888786e] | committer: 
Paul B Mahol

Add FITS Decoder

Signed-off-by: Paras Chadha 

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

 Changelog   |   1 +
 doc/general.texi|   2 +
 libavcodec/Makefile |   2 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/codec_desc.c |   7 ++
 libavcodec/fits.c   | 203 +++
 libavcodec/fits.h   |  79 
 libavcodec/fitsdec.c| 318 
 libavcodec/version.h|   4 +-
 10 files changed, 616 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index b064328c3f..548f67d202 100644
--- a/Changelog
+++ b/Changelog
@@ -38,6 +38,7 @@ version :
 - Some video filters with several inputs now use a common set of options:
   blend, libvmaf, lut3d, overlay, psnr, ssim.
   They must always be used by name.
+- FITS demuxer and decoder
 
 version 3.3:
 - CrystalHD decoder moved to new decode API
diff --git a/doc/general.texi b/doc/general.texi
index 7d8da113e6..686460e5aa 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -593,6 +593,8 @@ following image formats are supported:
 @tab Digital Picture Exchange
 @item EXR  @tab   @tab X
 @tab OpenEXR
+@item FITS @tab   @tab X
+@tab Flexible Image Transport System
 @item JPEG @tab X @tab X
 @tab Progressive JPEG is not supported.
 @item JPEG 2000@tab X @tab X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 982d7f5179..6988c03596 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -291,6 +291,7 @@ OBJS-$(CONFIG_FFV1_DECODER)+= ffv1dec.o ffv1.o
 OBJS-$(CONFIG_FFV1_ENCODER)+= ffv1enc.o ffv1.o
 OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
 OBJS-$(CONFIG_FIC_DECODER) += fic.o
+OBJS-$(CONFIG_FITS_DECODER)+= fitsdec.o fits.o
 OBJS-$(CONFIG_FLAC_DECODER)+= flacdec.o flacdata.o flac.o
 OBJS-$(CONFIG_FLAC_ENCODER)+= flacenc.o flacdata.o flac.o 
vorbis_data.o
 OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
@@ -847,6 +848,7 @@ OBJS-$(CONFIG_ISO_MEDIA)   += mpeg4audio.o 
mpegaudiodata.o
 OBJS-$(CONFIG_ADTS_MUXER)  += mpeg4audio.o
 OBJS-$(CONFIG_CAF_DEMUXER) += ac3tab.o
 OBJS-$(CONFIG_DNXHD_DEMUXER)   += dnxhddata.o
+OBJS-$(CONFIG_FITS_DEMUXER)+= fits.o
 OBJS-$(CONFIG_FLV_DEMUXER) += mpeg4audio.o
 OBJS-$(CONFIG_LATM_MUXER)  += mpeg4audio.o
 OBJS-$(CONFIG_MATROSKA_AUDIO_MUXER)+= mpeg4audio.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 1e5942d7d1..dbde1f985a 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -192,6 +192,7 @@ static void register_all(void)
 REGISTER_ENCDEC (FFV1,  ffv1);
 REGISTER_ENCDEC (FFVHUFF,   ffvhuff);
 REGISTER_DECODER(FIC,   fic);
+REGISTER_DECODER(FITS,  fits);
 REGISTER_ENCDEC (FLASHSV,   flashsv);
 REGISTER_ENCDEC (FLASHSV2,  flashsv2);
 REGISTER_DECODER(FLIC,  flic);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 65092a..513236a863 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -447,6 +447,7 @@ enum AVCodecID {
 AV_CODEC_ID_SRGC,
 AV_CODEC_ID_SVG,
 AV_CODEC_ID_GDV,
+AV_CODEC_ID_FITS,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 6f43b68b83..2fea6805ab 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1464,6 +1464,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
  AV_CODEC_PROP_LOSSLESS,
 },
 {
+.id= AV_CODEC_ID_FITS,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "fits",
+.long_name = NULL_IF_CONFIG_SMALL("FITS image"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+},
+{
 .id= AV_CODEC_ID_GIF,
 .type  = AVMEDIA_TYPE_VIDEO,
 .name  = "gif",
diff --git a/libavcodec/fits.c b/libavcodec/fits.c
new file mode 100644
index 00..365347fc64
--- /dev/null
+++ b/libavcodec/fits.c
@@ -0,0 +1,203 @@
+/*
+ * FITS implementation of common functions
+ * Copyright (c) 2017 Paras Chadha
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT AN

[FFmpeg-cvslog] Add FITS Muxer

2017-08-30 Thread Paras Chadha
ffmpeg | branch: master | Paras Chadha  | Tue Aug 29 
23:08:33 2017 +0530| [df475db9a29e5f3e93dc5f4faa663d30f75ec80b] | committer: 
Paul B Mahol

Add FITS Muxer

Signed-off-by: Paras Chadha 

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

 libavformat/Makefile |   1 +
 libavformat/allformats.c |   2 +-
 libavformat/fitsenc.c| 183 +++
 libavformat/img2enc.c|   2 +
 4 files changed, 187 insertions(+), 1 deletion(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index dfae160bee..36f5839aa8 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -165,6 +165,7 @@ OBJS-$(CONFIG_FIFO_MUXER)+= fifo.o
 OBJS-$(CONFIG_FILMSTRIP_DEMUXER) += filmstripdec.o
 OBJS-$(CONFIG_FILMSTRIP_MUXER)   += filmstripenc.o
 OBJS-$(CONFIG_FITS_DEMUXER)  += fitsdec.o
+OBJS-$(CONFIG_FITS_MUXER)+= fitsenc.o
 OBJS-$(CONFIG_FLAC_DEMUXER)  += flacdec.o rawdec.o \
 flac_picture.o   \
 oggparsevorbis.o \
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index f23a9a06e5..cb09a60e6f 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -121,7 +121,7 @@ static void register_all(void)
 REGISTER_MUXDEMUX(FFMETADATA,   ffmetadata);
 REGISTER_MUXER   (FIFO, fifo);
 REGISTER_MUXDEMUX(FILMSTRIP,filmstrip);
-REGISTER_DEMUXER (FITS, fits);
+REGISTER_MUXDEMUX(FITS, fits);
 REGISTER_MUXDEMUX(FLAC, flac);
 REGISTER_DEMUXER (FLIC, flic);
 REGISTER_MUXDEMUX(FLV,  flv);
diff --git a/libavformat/fitsenc.c b/libavformat/fitsenc.c
new file mode 100644
index 00..0dcdcdfb04
--- /dev/null
+++ b/libavformat/fitsenc.c
@@ -0,0 +1,183 @@
+/*
+ * FITS muxer
+ * Copyright (c) 2017 Paras Chadha
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * FITS muxer.
+ */
+
+#include "internal.h"
+
+typedef struct FITSContext {
+int first_image;
+} FITSContext;
+
+static int fits_write_header(AVFormatContext *s)
+{
+FITSContext *fitsctx = s->priv_data;
+fitsctx->first_image = 1;
+return 0;
+}
+
+/**
+ * Write one header line comprising of keyword and value(int)
+ * @param s AVFormat Context
+ * @param keyword pointer to the char array in which keyword is stored
+ * @param value the value corresponding to the keyword
+ * @param lines_written to keep track of lines written so far
+ * @return 0
+ */
+static int write_keyword_value(AVFormatContext *s, const char *keyword, int 
value, int *lines_written)
+{
+int len, ret;
+uint8_t header[80];
+
+len = strlen(keyword);
+memset(header, ' ', sizeof(header));
+memcpy(header, keyword, len);
+
+header[8] = '=';
+header[9] = ' ';
+
+ret = snprintf(header + 10, 70, "%d", value);
+header[ret + 10] = ' ';
+
+avio_write(s->pb, header, sizeof(header));
+*lines_written += 1;
+return 0;
+}
+
+static int write_image_header(AVFormatContext *s)
+{
+AVStream *st = s->streams[0];
+AVCodecParameters *encctx = st->codecpar;
+FITSContext *fitsctx = s->priv_data;
+uint8_t buffer[80];
+int bitpix, naxis, naxis3 = 1, bzero = 0, rgb = 0, lines_written = 0, 
lines_left;
+
+switch (encctx->format) {
+case AV_PIX_FMT_GRAY8:
+bitpix = 8;
+naxis = 2;
+break;
+case AV_PIX_FMT_GRAY16BE:
+bitpix = 16;
+naxis = 2;
+bzero = 32768;
+break;
+case AV_PIX_FMT_GBRP:
+case AV_PIX_FMT_GBRAP:
+bitpix = 8;
+naxis = 3;
+rgb = 1;
+if (encctx->format == AV_PIX_FMT_GBRP) {
+naxis3 = 3;
+} else {
+naxis3 = 4;
+}
+break;
+case AV_PIX_FMT_GBRP16BE:
+case AV_PIX_FMT_GBRAP16BE:
+bitpix = 16;
+naxis = 3;
+rgb = 1;
+if (encctx->format == AV_PIX_FMT_GBRP16BE) {
+naxis3 = 3;
+} else {
+naxis3 = 4

[FFmpeg-cvslog] Add FITS Demuxer

2017-08-30 Thread Paras Chadha
ffmpeg | branch: master | Paras Chadha  | Tue Aug 29 
23:00:26 2017 +0530| [207f0cff2ac8e79747eca0de0bfcd823d4b7] | committer: 
Paul B Mahol

Add FITS Demuxer

Signed-off-by: Paras Chadha 

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

 libavformat/Makefile |   1 +
 libavformat/allformats.c |   1 +
 libavformat/fitsdec.c| 231 +++
 libavformat/version.h|   2 +-
 4 files changed, 234 insertions(+), 1 deletion(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index f2b465cfa2..dfae160bee 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -164,6 +164,7 @@ OBJS-$(CONFIG_FFMETADATA_MUXER)  += ffmetaenc.o
 OBJS-$(CONFIG_FIFO_MUXER)+= fifo.o
 OBJS-$(CONFIG_FILMSTRIP_DEMUXER) += filmstripdec.o
 OBJS-$(CONFIG_FILMSTRIP_MUXER)   += filmstripenc.o
+OBJS-$(CONFIG_FITS_DEMUXER)  += fitsdec.o
 OBJS-$(CONFIG_FLAC_DEMUXER)  += flacdec.o rawdec.o \
 flac_picture.o   \
 oggparsevorbis.o \
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index cd8200ea1c..f23a9a06e5 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -121,6 +121,7 @@ static void register_all(void)
 REGISTER_MUXDEMUX(FFMETADATA,   ffmetadata);
 REGISTER_MUXER   (FIFO, fifo);
 REGISTER_MUXDEMUX(FILMSTRIP,filmstrip);
+REGISTER_DEMUXER (FITS, fits);
 REGISTER_MUXDEMUX(FLAC, flac);
 REGISTER_DEMUXER (FLIC, flic);
 REGISTER_MUXDEMUX(FLV,  flv);
diff --git a/libavformat/fitsdec.c b/libavformat/fitsdec.c
new file mode 100644
index 00..4b288b3903
--- /dev/null
+++ b/libavformat/fitsdec.c
@@ -0,0 +1,231 @@
+/*
+ * FITS demuxer
+ * Copyright (c) 2017 Paras Chadha
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * FITS demuxer.
+ */
+
+#include "libavutil/intreadwrite.h"
+#include "internal.h"
+#include "libavutil/opt.h"
+#include "libavcodec/fits.h"
+#include "libavutil/bprint.h"
+
+#define FITS_BLOCK_SIZE 2880
+
+typedef struct FITSContext {
+const AVClass *class;
+AVRational framerate;
+int first_image;
+int64_t pts;
+} FITSContext;
+
+static int fits_probe(AVProbeData *p)
+{
+const uint8_t *b = p->buf;
+if (!memcmp(b, "SIMPLE  =T", 30))
+return AVPROBE_SCORE_MAX - 1;
+return 0;
+}
+
+static int fits_read_header(AVFormatContext *s)
+{
+AVStream *st;
+FITSContext * fits = s->priv_data;
+
+st = avformat_new_stream(s, NULL);
+if (!st)
+return AVERROR(ENOMEM);
+
+st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+st->codecpar->codec_id = AV_CODEC_ID_FITS;
+
+avpriv_set_pts_info(st, 64, fits->framerate.den, fits->framerate.num);
+fits->pts = 0;
+fits->first_image = 1;
+return 0;
+}
+
+/**
+ * Parses header and checks that the current HDU contains image or not
+ * It also stores the header in the avbuf and stores the size of data part in 
data_size
+ * @param s pointer to AVFormat Context
+ * @param fits pointer to FITSContext
+ * @param header pointer to FITSHeader
+ * @param avbuf pointer to AVBPrint to store the header
+ * @param data_size to store the size of data part
+ * @return 1 if image found, 0 if any other extension and AVERROR_INVALIDDATA 
otherwise
+ */
+static int64_t is_image(AVFormatContext *s, FITSContext *fits, FITSHeader 
*header,
+ AVBPrint *avbuf, uint64_t *data_size)
+{
+int i, ret, image = 0;
+char buf[FITS_BLOCK_SIZE] = { 0 };
+int64_t buf_size = 0, size = 0, t;
+
+do {
+ret = avio_read(s->pb, buf, FITS_BLOCK_SIZE);
+if (ret < 0) {
+return ret;
+} else if (ret < FITS_BLOCK_SIZE) {
+return AVERROR_INVALIDDATA;
+}
+
+av_bprint_append_data(avbuf, buf, FITS_BLOCK_SIZE);
+ret = 0;
+buf_size = 0;
+while(!ret && buf_size < FITS_BLOCK_SIZE) {
+ret = avpriv_fits_header_parse_line(s, header, buf + buf_size, 
NULL);
+buf_size += 80;
+}
+ 

[FFmpeg-cvslog] Add FITS Encoder

2017-08-30 Thread Paras Chadha
ffmpeg | branch: master | Paras Chadha  | Tue Aug 29 
23:07:30 2017 +0530| [6e02f66f1bc7c9d559bc7ef3393c66cd800d4651] | committer: 
Paul B Mahol

Add FITS Encoder

Signed-off-by: Paras Chadha 

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

 Changelog  |   1 +
 doc/general.texi   |   2 +-
 libavcodec/Makefile|   1 +
 libavcodec/allcodecs.c |   2 +-
 libavcodec/fitsenc.c   | 129 +
 5 files changed, 133 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index 548f67d202..830941757e 100644
--- a/Changelog
+++ b/Changelog
@@ -39,6 +39,7 @@ version :
   blend, libvmaf, lut3d, overlay, psnr, ssim.
   They must always be used by name.
 - FITS demuxer and decoder
+- FITS muxer and encoder
 
 version 3.3:
 - CrystalHD decoder moved to new decode API
diff --git a/doc/general.texi b/doc/general.texi
index 686460e5aa..5299a9b58c 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -593,7 +593,7 @@ following image formats are supported:
 @tab Digital Picture Exchange
 @item EXR  @tab   @tab X
 @tab OpenEXR
-@item FITS @tab   @tab X
+@item FITS @tab X @tab X
 @tab Flexible Image Transport System
 @item JPEG @tab X @tab X
 @tab Progressive JPEG is not supported.
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 6988c03596..999632cf9e 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -292,6 +292,7 @@ OBJS-$(CONFIG_FFV1_ENCODER)+= ffv1enc.o ffv1.o
 OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
 OBJS-$(CONFIG_FIC_DECODER) += fic.o
 OBJS-$(CONFIG_FITS_DECODER)+= fitsdec.o fits.o
+OBJS-$(CONFIG_FITS_ENCODER)+= fitsenc.o
 OBJS-$(CONFIG_FLAC_DECODER)+= flacdec.o flacdata.o flac.o
 OBJS-$(CONFIG_FLAC_ENCODER)+= flacenc.o flacdata.o flac.o 
vorbis_data.o
 OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index dbde1f985a..ce0bc7ecf3 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -192,7 +192,7 @@ static void register_all(void)
 REGISTER_ENCDEC (FFV1,  ffv1);
 REGISTER_ENCDEC (FFVHUFF,   ffvhuff);
 REGISTER_DECODER(FIC,   fic);
-REGISTER_DECODER(FITS,  fits);
+REGISTER_ENCDEC (FITS,  fits);
 REGISTER_ENCDEC (FLASHSV,   flashsv);
 REGISTER_ENCDEC (FLASHSV2,  flashsv2);
 REGISTER_DECODER(FLIC,  flic);
diff --git a/libavcodec/fitsenc.c b/libavcodec/fitsenc.c
new file mode 100644
index 00..b44507e436
--- /dev/null
+++ b/libavcodec/fitsenc.c
@@ -0,0 +1,129 @@
+/*
+ * FITS image encoder
+ * Copyright (c) 2017 Paras Chadha
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * FITS image encoder
+ *
+ * Specification: https://fits.gsfc.nasa.gov/fits_standard.html Version 3.0
+ *
+ * RGBA images are encoded as planes in RGBA order. So, NAXIS3 is 3 or 4 for 
them.
+ * Also CTYPE3 = 'RGB ' is added to the header to distinguish them from 3d 
images.
+ */
+
+#include "libavutil/intreadwrite.h"
+#include "avcodec.h"
+#include "bytestream.h"
+#include "internal.h"
+
+static int fits_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
+const AVFrame *pict, int *got_packet)
+{
+AVFrame * const p = (AVFrame *)pict;
+uint8_t *bytestream, *bytestream_start, *ptr;
+const uint16_t flip = (1 << 15);
+uint64_t data_size = 0, padded_data_size = 0;
+int ret, bitpix, naxis3 = 1, i, j, k, bytes_left;
+int map[] = {2, 0, 1, 3}; // mapping from GBRA -> RGBA as RGBA is to be 
stored in FITS file..
+
+switch (avctx->pix_fmt) {
+case AV_PIX_FMT_GRAY8:
+case AV_PIX_FMT_GRAY16BE:
+map[0] = 0; // grayscale images should be directly mapped
+if (avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
+bitpix = 8;
+} else {
+bitpix = 16;
+}
+break;
+case AV_PIX_FMT_GBRP:
+case AV_PIX_FMT_GBRAP:
+bitpix = 8;
+if (avctx->pix_fmt == AV_PIX_FMT_GBRP) {
+naxis3 = 3;
+} else {
+naxis3 

[FFmpeg-cvslog] FATE: Add FITS tests

2017-08-30 Thread Paras Chadha
ffmpeg | branch: master | Paras Chadha  | Tue Aug 29 
23:24:42 2017 +0530| [9d99f0afbeedf3e170478c3e8c05789bf2eef48f] | committer: 
Paul B Mahol

FATE: Add FITS tests

Signed-off-by: Paras Chadha 

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

 tests/Makefile  |  1 +
 tests/fate/avformat.mak |  1 +
 tests/fate/demux.mak|  4 +++
 tests/fate/fits.mak | 59 +
 tests/lavf-regression.sh|  9 +
 tests/ref/fate/fits-demux   | 10 ++
 tests/ref/fate/fitsdec-bitpix-32|  6 
 tests/ref/fate/fitsdec-bitpix-64|  6 
 tests/ref/fate/fitsdec-blank_bitpix32   |  6 
 tests/ref/fate/fitsdec-ext_data_min_max |  6 
 tests/ref/fate/fitsdec-gbrap16  |  6 
 tests/ref/fate/fitsdec-gbrp |  6 
 tests/ref/fate/fitsdec-gbrp16   |  6 
 tests/ref/fate/fitsdec-gray |  6 
 tests/ref/fate/fitsdec-multi| 10 ++
 tests/ref/fate/fitsenc-gbrap| 10 ++
 tests/ref/fate/fitsenc-gbrap16be| 10 ++
 tests/ref/fate/fitsenc-gbrp | 10 ++
 tests/ref/fate/fitsenc-gbrp16be | 10 ++
 tests/ref/fate/fitsenc-gray | 10 ++
 tests/ref/fate/fitsenc-gray16be | 10 ++
 tests/ref/lavf/fits | 18 ++
 22 files changed, 220 insertions(+)

diff --git a/tests/Makefile b/tests/Makefile
index 30f05bec15..18fe9c5b4a 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -131,6 +131,7 @@ include $(SRC_PATH)/tests/fate/fft.mak
 include $(SRC_PATH)/tests/fate/fifo-muxer.mak
 include $(SRC_PATH)/tests/fate/filter-audio.mak
 include $(SRC_PATH)/tests/fate/filter-video.mak
+include $(SRC_PATH)/tests/fate/fits.mak
 include $(SRC_PATH)/tests/fate/flac.mak
 include $(SRC_PATH)/tests/fate/flvenc.mak
 include $(SRC_PATH)/tests/fate/gapless.mak
diff --git a/tests/fate/avformat.mak b/tests/fate/avformat.mak
index 82a531c7a5..c4cf2bc473 100644
--- a/tests/fate/avformat.mak
+++ b/tests/fate/avformat.mak
@@ -10,6 +10,7 @@ FATE_LAVF-$(call ENCDEC,  PCM_S16BE, CAF) 
   += caf
 FATE_LAVF-$(call ENCDEC,  DPX,   IMAGE2) += dpx
 FATE_LAVF-$(call ENCDEC2, DVVIDEO,PCM_S16LE, AVI)+= dv_fmt
 FATE_LAVF-$(call ENCDEC2, MPEG1VIDEO, MP2,   FFM)+= ffm
+FATE_LAVF-$(call ENCDEC,  FITS,  IMAGE2) += fits
 FATE_LAVF-$(call ENCDEC,  RAWVIDEO,  FILMSTRIP)  += flm
 FATE_LAVF-$(call ENCDEC,  FLV,   FLV)+= flv_fmt
 FATE_LAVF-$(call ENCDEC,  GIF,   IMAGE2) += gif
diff --git a/tests/fate/demux.mak b/tests/fate/demux.mak
index 8a2703fc84..261b004d69 100644
--- a/tests/fate/demux.mak
+++ b/tests/fate/demux.mak
@@ -36,6 +36,10 @@ fate-d-cinema-demux: CMD = framecrc -i 
$(TARGET_SAMPLES)/d-cinema/THX_Science_FL
 FATE_SAMPLES_DEMUX-$(CONFIG_EA_DEMUXER) += fate-d-eavp6-demux
 fate-d-eavp6-demux: CMD = framecrc -i $(TARGET_SAMPLES)/ea-vp6/SmallRing.vp6 
-map 0 -vcodec copy
 
+FATE_SAMPLES_DEMUX-$(CONFIG_FITS_DEMUXER) += fate-fits-demux
+fate-fits-demux: tests/data/fits-multi.fits
+fate-fits-demux: CMD = framecrc -i $(TARGET_PATH)/tests/data/fits-multi.fits 
-vcodec copy
+
 FATE_SAMPLES_DEMUX-$(CONFIG_FLV_DEMUXER) += fate-flv-demux
 fate-flv-demux: CMD = framecrc -i 
$(TARGET_SAMPLES)/flv/Enigma_Principles_of_Lust-part.flv -codec copy
 
diff --git a/tests/fate/fits.mak b/tests/fate/fits.mak
new file mode 100644
index 00..bc1b771a52
--- /dev/null
+++ b/tests/fate/fits.mak
@@ -0,0 +1,59 @@
+tests/data/fits-multi.fits: TAG = GEN
+tests/data/fits-multi.fits: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
+   $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
+-i $(TARGET_SAMPLES)/gif/m4nb.gif \
+-y $(TARGET_PATH)/$(@) 2>/dev/null
+
+#mapping of fits file formats to png filenames
+map.tests/data/lena-gray.fits:= gray8
+map.tests/data/lena-gbrp.fits:= rgb24
+map.tests/data/lena-gbrp16.fits  := rgb48
+map.tests/data/lena-gbrap16.fits := rgba64
+
+tests/data/lena%.fits: TAG = GEN
+tests/data/lena%.fits: NAME = $(map.$(@))
+tests/data/lena%.fits: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
+   $(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
+-i $(TARGET_SAMPLES)/png1/lena-$(map.$(@)).png \
+-y $(TARGET_PATH)/$(@) 2>/dev/null
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-ext_data_min_max
+fate-fitsdec-ext_data_min_max: CMD = framecrc -i 
$(TARGET_SAMPLES)/fits/x0cj010ct_d0h.fit -pix_fmt gray16
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-blank_bitpix32
+fate-fitsdec-blank_bitpix32: CMD = framecrc -blank_value 65535 -i 
$(TARGET_SAMPLES)/fits/file008.fits -pix_fmt gray16
+
+FATE_FITS_DEC-$(call DEMDEC, FITS, FITS) += fate-fitsdec-bitpix-32
+fate-fitsdec-bitpix-32: CMD = framecrc -i

[FFmpeg-cvslog] avfilter/vf_lut2: add framesync options

2017-08-30 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Wed Aug 30 12:06:47 
2017 +0200| [a4d18a3f54e5b0277234d8fcff65dff8516417a0] | committer: Paul B Mahol

avfilter/vf_lut2: add framesync options

Also stop leaking memory.

Signed-off-by: Paul B Mahol 

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

 libavfilter/vf_lut2.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_lut2.c b/libavfilter/vf_lut2.c
index 176b98ee80..ba599c3d14 100644
--- a/libavfilter/vf_lut2.c
+++ b/libavfilter/vf_lut2.c
@@ -52,6 +52,7 @@ enum var_name {
 
 typedef struct LUT2Context {
 const AVClass *class;
+FFFrameSync fs;
 
 char   *comp_expr_str[4];
 
@@ -66,7 +67,6 @@ typedef struct LUT2Context {
 
 void (*lut2)(struct LUT2Context *s, AVFrame *dst, AVFrame *srcx, AVFrame 
*srcy);
 
-FFFrameSync fs;
 } LUT2Context;
 
 #define OFFSET(x) offsetof(LUT2Context, x)
@@ -85,6 +85,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 LUT2Context *s = ctx->priv;
 int i;
 
+ff_framesync2_uninit(&s->fs);
 av_frame_free(&s->prev_frame);
 
 for (i = 0; i < 4; i++) {
@@ -212,14 +213,14 @@ static int process_frame(FFFrameSync *fs)
 AVFilterContext *ctx = fs->parent;
 LUT2Context *s = fs->opaque;
 AVFilterLink *outlink = ctx->outputs[0];
-AVFrame *out, *srcx, *srcy;
+AVFrame *out, *srcx = NULL, *srcy = NULL;
 int ret;
 
 if ((ret = ff_framesync2_get_frame(&s->fs, 0, &srcx, 0)) < 0 ||
 (ret = ff_framesync2_get_frame(&s->fs, 1, &srcy, 0)) < 0)
 return ret;
 
-if (ctx->is_disabled) {
+if (ctx->is_disabled || !srcy) {
 out = av_frame_clone(srcx);
 if (!out)
 return AVERROR(ENOMEM);
@@ -332,7 +333,7 @@ static int lut2_config_output(AVFilterLink *outlink)
 in = s->fs.in;
 in[0].time_base = srcx->time_base;
 in[1].time_base = srcy->time_base;
-in[0].sync   = 1;
+in[0].sync   = 2;
 in[0].before = EXT_STOP;
 in[0].after  = EXT_INFINITY;
 in[1].sync   = 1;
@@ -378,11 +379,12 @@ static const AVFilterPad outputs[] = {
 
 #define lut2_options options
 
-AVFILTER_DEFINE_CLASS(lut2);
+FRAMESYNC_DEFINE_CLASS(lut2, LUT2Context, fs);
 
 AVFilter ff_vf_lut2 = {
 .name  = "lut2",
 .description   = NULL_IF_CONFIG_SMALL("Compute and apply a lookup table 
from two video inputs."),
+.preinit   = lut2_framesync_preinit,
 .priv_size = sizeof(LUT2Context),
 .priv_class= &lut2_class,
 .uninit= uninit,

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


[FFmpeg-cvslog] avcodec/codec_desc: make FITS description longer

2017-08-30 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Wed Aug 30 12:18:22 
2017 +0200| [2b9fd157342fbe3db86228db4f9e23b52670c264] | committer: Paul B Mahol

avcodec/codec_desc: make FITS description longer

Signed-off-by: Paul B Mahol 

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

 libavcodec/codec_desc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 2fea6805ab..6a13bbbf0e 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1467,7 +1467,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .id= AV_CODEC_ID_FITS,
 .type  = AVMEDIA_TYPE_VIDEO,
 .name  = "fits",
-.long_name = NULL_IF_CONFIG_SMALL("FITS image"),
+.long_name = NULL_IF_CONFIG_SMALL("FITS (Flexible Image Transport 
System)"),
 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
 },
 {

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


[FFmpeg-cvslog] avfilter/vf_libvmaf: fix pre convert to framesync2 bugs

2017-08-30 Thread Ashish Singh
ffmpeg | branch: master | Ashish Singh  | Thu Aug  3 
11:22:01 2017 +0530| [2a4a26fa4f3c9310cd8cf6a0d093c927f64ef8a7] | committer: 
Ronald S. Bultje

avfilter/vf_libvmaf: fix pre convert to framesync2 bugs

Hi, it fixes the errors while converting to framesync2.
libvmaf was changed recently, double *score variable is removed in the new
version since it's not used anywhere. This patch fixes all the warnings and
segmentation faults.

Signed-off-by: Ashish Singh 
Signed-off-by: Ronald S. Bultje 

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

 libavfilter/vf_libvmaf.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c
index 2165561c5a..405820f182 100644
--- a/libavfilter/vf_libvmaf.c
+++ b/libavfilter/vf_libvmaf.c
@@ -24,7 +24,6 @@
  * Calculate the VMAF between two input videos.
  */
 
-#include 
 #include 
 #include 
 #include "libavutil/avstring.h"
@@ -84,11 +83,10 @@ static const AVOption libvmaf_options[] = {
 FRAMESYNC_DEFINE_CLASS(libvmaf, LIBVMAFContext, fs);
 
 #define read_frame_fn(type, bits)  
 \
-static int read_frame_##bits##bit(float *ref_data, float *main_data,   
 \
-  float *temp_data, int stride,
 \
-  double *score, void *ctx)
 \
+static int read_frame_##bits##bit(float *ref_data, float *main_data,   
 \
+  float *temp_data, int stride, void *ctx) 
 \
 {  
 \
-LIBVMAFContext *s = (LIBVMAFContext *) ctx;
   \
+LIBVMAFContext *s = (LIBVMAFContext *) ctx;
 \
 int ret;   
 \
 \
 pthread_mutex_lock(&s->lock);  
 \
@@ -150,7 +148,7 @@ read_frame_fn(uint16_t, 10);
 static void compute_vmaf_score(LIBVMAFContext *s)
 {
 int (*read_frame)(float *ref_data, float *main_data, float *temp_data,
-  int stride, double *score, void *ctx);
+  int stride, void *ctx);
 
 if (s->desc->comp[0].depth <= 8) {
 read_frame = read_frame_8bit;

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


[FFmpeg-cvslog] configure: require pkg-config for libvmaf

2017-08-30 Thread Ashish Singh
ffmpeg | branch: master | Ashish Singh  | Tue Aug  1 
21:02:18 2017 +0530| [1dc33c123715e195f7f19b2dca8f192a550f047c] | committer: 
Ronald S. Bultje

configure: require pkg-config for libvmaf

This patch makes the libvmaf filter use pkg-config to detect
and link to libvmaf.

Signed-off-by: Ashish Singh 
Signed-off-by: Ronald S. Bultje 

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

 configure | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure b/configure
index 172ff3fc07..4f1c172333 100755
--- a/configure
+++ b/configure
@@ -5920,8 +5920,7 @@ enabled libtwolame&& require libtwolame twolame.h 
twolame_init -ltwolame
die "ERROR: libtwolame must be installed and 
version must be >= 0.3.10"; }
 enabled libv4l2   && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
 enabled libvidstab&& require_pkg_config "vidstab >= 0.98" 
vid.stab/libvidstab.h vsMotionDetectInit
-enabled libvmaf   && { check_lib libvmaf "libvmaf.h" "compute_vmaf" 
-lvmaf -lstdc++ -lpthread -lm ||
-   die "ERROR: libvmaf must be installed"; }
+enabled libvmaf   && require_pkg_config libvmaf libvmaf.h compute_vmaf
 enabled libvo_amrwbenc&& require libvo_amrwbenc vo-amrwbenc/enc_if.h 
E_IF_init -lvo-amrwbenc
 enabled libvorbis && require_pkg_config vorbis vorbis/codec.h 
vorbis_info_init &&
  require_pkg_config vorbisenc vorbis/vorbisenc.h 
vorbis_encode_init

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


[FFmpeg-cvslog] fate: remove usage of deprecated AVCodecContext.me_method in vsynth snow tests

2017-08-30 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Aug 30 14:06:49 
2017 -0300| [350dc01dcb80345eafe45e85850bc8f8028e298d] | committer: James Almer

fate: remove usage of deprecated AVCodecContext.me_method in vsynth snow tests

Signed-off-by: James Almer 

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

 tests/fate/vcodec.mak | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
index 8c24510937..5fc27c02cd 100644
--- a/tests/fate/vcodec.mak
+++ b/tests/fate/vcodec.mak
@@ -376,11 +376,11 @@ fate-vsynth%-rv20:   FMT = rm
 
 FATE_VCODEC-$(call ENCDEC, SNOW, AVI)   += snow snow-hpel snow-ll
 fate-vsynth%-snow:   ENCOPTS = -qscale 2 -flags +qpel \
-   -me_method iter -dia_size 2   \
+   -motion_est iter -dia_size 2  \
-cmp 12 -subcmp 12 -s 128x64
 
 fate-vsynth%-snow-hpel:  ENCOPTS = -qscale 2  \
-   -me_method iter -dia_size 2   \
+   -motion_est iter -dia_size 2  \
-cmp 12 -subcmp 12 -s 128x64
 
 fate-vsynth%-snow-ll:ENCOPTS = -qscale .001 -pred 1 \

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


[FFmpeg-cvslog] fate: stop using deprecated filter syntax in hls tests

2017-08-30 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Aug 30 14:14:54 
2017 -0300| [ec07574a15bacabe0f6e4e496842e4935862c094] | committer: James Almer

fate: stop using deprecated filter syntax in hls tests

Signed-off-by: James Almer 

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

 tests/fate/filter-audio.mak | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak
index 8030641ed6..5035e8f073 100644
--- a/tests/fate/filter-audio.mak
+++ b/tests/fate/filter-audio.mak
@@ -145,7 +145,7 @@ fate-filter-compand: CMD = framecrc -i $(SRC) -frames:a 20 
-filter_complex_scrip
 tests/data/hls-list.m3u8: TAG = GEN
 tests/data/hls-list.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
--f lavfi -i "aevalsrc=cos(2*PI*t)*sin(2*PI*(440+4*t)*t)::d=20" -f 
segment -segment_time 10 -map 0 -flags +bitexact -codec:a mp2fixed \
+-f lavfi -i "aevalsrc=cos(2*PI*t)*sin(2*PI*(440+4*t)*t):d=20" -f 
segment -segment_time 10 -map 0 -flags +bitexact -codec:a mp2fixed \
 -segment_list $(TARGET_PATH)/$@ -y 
$(TARGET_PATH)/tests/data/hls-out-%03d.ts 2>/dev/null
 
 FATE_AFILTER-$(call ALLYES, HLS_DEMUXER MPEGTS_MUXER MPEGTS_DEMUXER 
AEVALSRC_FILTER LAVFI_INDEV MP2FIXED_ENCODER) += fate-filter-hls
@@ -155,10 +155,10 @@ fate-filter-hls: CMD = framecrc -flags +bitexact -i 
$(TARGET_PATH)/tests/data/hl
 tests/data/hls-list-append.m3u8: TAG = GEN
 tests/data/hls-list-append.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
--f lavfi -i "aevalsrc=cos(2*PI*t)*sin(2*PI*(440+4*t)*t)::d=20" -f 
segment -segment_time 10 -map 0 -flags +bitexact -codec:a mp2fixed \
+-f lavfi -i "aevalsrc=cos(2*PI*t)*sin(2*PI*(440+4*t)*t):d=20" -f 
segment -segment_time 10 -map 0 -flags +bitexact -codec:a mp2fixed \
 -segment_list $(TARGET_PATH)/$@ -y 
$(TARGET_PATH)/tests/data/hls-append-out-%03d.ts 2>/dev/null; \
 $(TARGET_EXEC) $(TARGET_PATH)/$< \
--f lavfi -i "aevalsrc=cos(2*PI*t)*sin(2*PI*(440+4*t)*t)::d=20" -f hls 
-hls_time 10 -map 0 -flags +bitexact \
+-f lavfi -i "aevalsrc=cos(2*PI*t)*sin(2*PI*(440+4*t)*t):d=20" -f hls 
-hls_time 10 -map 0 -flags +bitexact \
 -hls_flags append_list -codec:a mp2fixed -hls_segment_filename 
$(TARGET_PATH)/tests/data/hls-append-out-%03d.ts \
 $(TARGET_PATH)/tests/data/hls-list-append.m3u8 2>/dev/null
 

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


[FFmpeg-cvslog] avfilter/vf_mcdeint: free the AVCodecContext struct properly

2017-08-30 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Aug 30 14:34:04 
2017 -0300| [f7d4c60ac47547f69ddc96e7bed682f54436cd1a] | committer: James Almer

avfilter/vf_mcdeint: free the AVCodecContext struct properly

Signed-off-by: James Almer 

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

 libavfilter/vf_mcdeint.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavfilter/vf_mcdeint.c b/libavfilter/vf_mcdeint.c
index 26387b84e7..d53322b40d 100644
--- a/libavfilter/vf_mcdeint.c
+++ b/libavfilter/vf_mcdeint.c
@@ -154,10 +154,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 {
 MCDeintContext *mcdeint = ctx->priv;
 
-if (mcdeint->enc_ctx) {
-avcodec_close(mcdeint->enc_ctx);
-av_freep(&mcdeint->enc_ctx);
-}
+avcodec_free_context(&mcdeint->enc_ctx);
 }
 
 static int query_formats(AVFilterContext *ctx)

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


[FFmpeg-cvslog] postproc: remove usage of deprecated QP_STORE_T define

2017-08-30 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Aug 30 14:43:22 
2017 -0300| [2b7da70a70fef364f9a42e69b6d34133b3d089f8] | committer: James Almer

postproc: remove usage of deprecated QP_STORE_T define

Signed-off-by: James Almer 

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

 libpostproc/postprocess.c  | 12 ++--
 libpostproc/postprocess_internal.h |  6 +++---
 libpostproc/postprocess_template.c |  4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index 6aa4ace337..1fef8747c0 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -558,10 +558,10 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, 
int step,
 #endif
 
 typedef void (*pp_fn)(const uint8_t src[], int srcStride, uint8_t dst[], int 
dstStride, int width, int height,
-  const QP_STORE_T QPs[], int QPStride, int isColor, 
PPContext *c2);
+  const int8_t QPs[], int QPStride, int isColor, PPContext 
*c2);
 
 static inline void postProcess(const uint8_t src[], int srcStride, uint8_t 
dst[], int dstStride, int width, int height,
-const QP_STORE_T QPs[], int QPStride, int isColor, pp_mode *vm, 
pp_context *vc)
+const int8_t QPs[], int QPStride, int isColor, pp_mode *vm, pp_context 
*vc)
 {
 pp_fn pp = postProcess_C;
 PPContext *c= (PPContext *)vc;
@@ -870,9 +870,9 @@ static void reallocBuffers(PPContext *c, int width, int 
height, int stride, int
 }
 
 reallocAlign((void **)&c->deintTemp, 2*width+32);
-reallocAlign((void **)&c->nonBQPTable, 
qpStride*mbHeight*sizeof(QP_STORE_T));
-reallocAlign((void **)&c->stdQPTable, 
qpStride*mbHeight*sizeof(QP_STORE_T));
-reallocAlign((void **)&c->forcedQPTable, mbWidth*sizeof(QP_STORE_T));
+reallocAlign((void **)&c->nonBQPTable, qpStride*mbHeight*sizeof(int8_t));
+reallocAlign((void **)&c->stdQPTable, qpStride*mbHeight*sizeof(int8_t));
+reallocAlign((void **)&c->forcedQPTable, mbWidth*sizeof(int8_t));
 }
 
 static const char * context_to_name(void * ptr) {
@@ -940,7 +940,7 @@ av_cold void pp_free_context(void *vc){
 void  pp_postprocess(const uint8_t * src[3], const int srcStride[3],
  uint8_t * dst[3], const int dstStride[3],
  int width, int height,
- const QP_STORE_T *QP_store,  int QPStride,
+ const int8_t *QP_store,  int QPStride,
  pp_mode *vm,  void *vc, int pict_type)
 {
 int mbWidth = (width+15)>>4;
diff --git a/libpostproc/postprocess_internal.h 
b/libpostproc/postprocess_internal.h
index d128dfbe2f..765fdeb14a 100644
--- a/libpostproc/postprocess_internal.h
+++ b/libpostproc/postprocess_internal.h
@@ -149,9 +149,9 @@ typedef struct PPContext{
 DECLARE_ALIGNED(32, uint64_t, mmxDcOffset)[64];
 DECLARE_ALIGNED(32, uint64_t, mmxDcThreshold)[64];
 
-QP_STORE_T *stdQPTable;   ///< used to fix MPEG2 style qscale
-QP_STORE_T *nonBQPTable;
-QP_STORE_T *forcedQPTable;
+int8_t *stdQPTable;   ///< used to fix MPEG2 style qscale
+int8_t *nonBQPTable;
+int8_t *forcedQPTable;
 
 int QP;
 int nonBQP;
diff --git a/libpostproc/postprocess_template.c 
b/libpostproc/postprocess_template.c
index 2a25ce44e3..0a43989266 100644
--- a/libpostproc/postprocess_template.c
+++ b/libpostproc/postprocess_template.c
@@ -3081,7 +3081,7 @@ static av_always_inline void RENAME(do_a_deblock)(uint8_t 
*src, int step, int st
 #endif //TEMPLATE_PP_MMX
 
 static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t 
dst[], int dstStride, int width, int height,
-const QP_STORE_T QPs[], int QPStride, int 
isColor, PPContext *c);
+const int8_t QPs[], int QPStride, int isColor, 
PPContext *c);
 
 /**
  * Copy a block from src to dst and fixes the blacklevel.
@@ -3309,7 +3309,7 @@ static inline void RENAME(prefetcht2)(const void *p)
  * Filter array of bytes (Y or U or V values)
  */
 static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t 
dst[], int dstStride, int width, int height,
-const QP_STORE_T QPs[], int QPStride, int 
isColor, PPContext *c2)
+const int8_t QPs[], int QPStride, int isColor, 
PPContext *c2)
 {
 DECLARE_ALIGNED(8, PPContext, c)= *c2; //copy to stack for faster access
 int x,y;

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


[FFmpeg-cvslog] avfilter/af_adelay: remove requirement that at least one delay should be provided

2017-08-30 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Wed Aug 30 18:14:10 
2017 +0200| [6ccd32c36760ac8b8261d68eb32b07cf5c762e52] | committer: Paul B Mahol

avfilter/af_adelay: remove requirement that at least one delay should be 
provided

Such requirement is not necessary and code works without it just fine.

Signed-off-by: Paul B Mahol 

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

 doc/filters.texi| 1 -
 libavfilter/af_adelay.c | 5 -
 2 files changed, 6 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 19e13a1346..afcb99d876 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -551,7 +551,6 @@ The filter accepts the following option:
 @table @option
 @item delays
 Set list of delays in milliseconds for each channel separated by '|'.
-At least one delay greater than 0 should be provided.
 Unused delays will be silently ignored. If number of given delays is
 smaller than number of channels all remaining channels will not be delayed.
 If you want to delay exact number of samples, append 'S' to number.
diff --git a/libavfilter/af_adelay.c b/libavfilter/af_adelay.c
index 187cacf28a..983f089c21 100644
--- a/libavfilter/af_adelay.c
+++ b/libavfilter/af_adelay.c
@@ -171,11 +171,6 @@ static int config_input(AVFilterLink *inlink)
 s->max_delay = FFMAX(s->max_delay, d->delay);
 }
 
-if (!s->max_delay) {
-av_log(ctx, AV_LOG_ERROR, "At least one delay >0 must be 
specified.\n");
-return AVERROR(EINVAL);
-}
-
 switch (inlink->format) {
 case AV_SAMPLE_FMT_U8P : s->delay_channel = delay_channel_u8p ; break;
 case AV_SAMPLE_FMT_S16P: s->delay_channel = delay_channel_s16p; break;

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


[FFmpeg-cvslog] avfilter/vf_mcdeint: remove usage of deprecated AVCodecContext.me_method

2017-08-30 Thread James Almer
ffmpeg | branch: master | James Almer  | Mon Aug 28 13:40:06 
2017 -0300| [027c682fa07999820a11cbcbf7a7ba9edbb9ecab] | committer: James Almer

avfilter/vf_mcdeint: remove usage of deprecated AVCodecContext.me_method

Signed-off-by: James Almer 

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

 libavfilter/vf_mcdeint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_mcdeint.c b/libavfilter/vf_mcdeint.c
index d53322b40d..9cdec6308d 100644
--- a/libavfilter/vf_mcdeint.c
+++ b/libavfilter/vf_mcdeint.c
@@ -134,7 +134,7 @@ static int config_props(AVFilterLink *inlink)
 case MODE_EXTRA_SLOW:
 enc_ctx->refs = 3;
 case MODE_SLOW:
-enc_ctx->me_method = ME_ITER;
+av_dict_set(&opts, "motion_est", "iter", 0);
 case MODE_MEDIUM:
 enc_ctx->flags |= AV_CODEC_FLAG_4MV;
 enc_ctx->dia_size = 2;

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


[FFmpeg-cvslog] fate/pixlet : add test for rgb

2017-08-30 Thread Martin Vignali
ffmpeg | branch: master | Martin Vignali  | Sun Apr  
2 23:25:33 2017 +0200| [2fcf47e2d175397c44e0d4b9063dc1ad78614d78] | committer: 
Michael Niedermayer

fate/pixlet : add test for rgb

Signed-off-by: Michael Niedermayer 

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

 tests/Makefile| 1 +
 tests/fate/pixlet.mak | 5 +
 tests/ref/fate/pixlet-rgb | 6 ++
 3 files changed, 12 insertions(+)

diff --git a/tests/Makefile b/tests/Makefile
index 18fe9c5b4a..99f7e1730b 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -159,6 +159,7 @@ include $(SRC_PATH)/tests/fate/mpeg4.mak
 include $(SRC_PATH)/tests/fate/mxf.mak
 include $(SRC_PATH)/tests/fate/opus.mak
 include $(SRC_PATH)/tests/fate/pcm.mak
+include $(SRC_PATH)/tests/fate/pixlet.mak
 include $(SRC_PATH)/tests/fate/probe.mak
 include $(SRC_PATH)/tests/fate/prores.mak
 include $(SRC_PATH)/tests/fate/qt.mak
diff --git a/tests/fate/pixlet.mak b/tests/fate/pixlet.mak
new file mode 100644
index 00..c720f32616
--- /dev/null
+++ b/tests/fate/pixlet.mak
@@ -0,0 +1,5 @@
+FATE_PIXLET += fate-pixlet-rgb
+fate-pixlet-rgb: CMD = framecrc -i $(TARGET_SAMPLES)/pixlet/pixlet_rgb.mov -an 
-pix_fmt yuv420p16le
+
+FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, PIXLET) += $(FATE_PIXLET)
+fate-pixlet: $(FATE_PIXLET)
diff --git a/tests/ref/fate/pixlet-rgb b/tests/ref/fate/pixlet-rgb
new file mode 100644
index 00..a445fddfa7
--- /dev/null
+++ b/tests/ref/fate/pixlet-rgb
@@ -0,0 +1,6 @@
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 13x9
+#sar 0: 1/1
+0,  0,  0,1,  374, 0x93f1ba6d

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


[FFmpeg-cvslog] ffmpeg_opt: add proper deprecation guards to lowres code

2017-08-30 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Aug 30 22:31:35 
2017 -0300| [6e131a7cd970a39bcc8cbfdd32d10a90e3ab51c5] | committer: James Almer

ffmpeg_opt: add proper deprecation guards to lowres code

Signed-off-by: James Almer 

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

 ffmpeg_opt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index f275f711be..100fa76e46 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -791,14 +791,16 @@ static void add_input_streams(OptionsContext *o, 
AVFormatContext *ic)
 case AVMEDIA_TYPE_VIDEO:
 if(!ist->dec)
 ist->dec = avcodec_find_decoder(par->codec_id);
-#if FF_API_EMU_EDGE
+#if FF_API_LOWRES
 if (av_codec_get_lowres(st->codec)) {
 av_codec_set_lowres(ist->dec_ctx, 
av_codec_get_lowres(st->codec));
 ist->dec_ctx->width  = st->codec->width;
 ist->dec_ctx->height = st->codec->height;
 ist->dec_ctx->coded_width  = st->codec->coded_width;
 ist->dec_ctx->coded_height = st->codec->coded_height;
+#if FF_API_EMU_EDGE
 ist->dec_ctx->flags |= CODEC_FLAG_EMU_EDGE;
+#endif
 }
 #endif
 

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


[FFmpeg-cvslog] fate/flvenc: set bitexact output format flag explicitly

2017-08-30 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Aug 30 23:21:41 
2017 -0300| [b34c16a38d3e6fa02b5d39ae6ed73acf12dff92c] | committer: James Almer

fate/flvenc: set bitexact output format flag explicitly

Using the encoder flags to set the muxer in bitexact mode is deprecated.

Signed-off-by: James Almer 

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

 tests/fate/flvenc.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/fate/flvenc.mak b/tests/fate/flvenc.mak
index 3881bcd105..4fdeeff4c1 100644
--- a/tests/fate/flvenc.mak
+++ b/tests/fate/flvenc.mak
@@ -1,7 +1,7 @@
 tests/data/add_keyframe_index.flv: TAG = GEN
 tests/data/add_keyframe_index.flv: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
-   -f lavfi -i 
"sws_flags=+accurate_rnd+bitexact;testsrc=r=7:n=2:d=20" -sws_flags 
'+accurate_rnd+bitexact' -metadata "encoder=Lavf" -pix_fmt yuv420p -c:v flv1 -g 
7 -f flv -flags +bitexact \
+   -f lavfi -i 
"sws_flags=+accurate_rnd+bitexact;testsrc=r=7:n=2:d=20" -sws_flags 
'+accurate_rnd+bitexact' -metadata "encoder=Lavf" -pix_fmt yuv420p -c:v flv1 -g 
7 -f flv -flags +bitexact -fflags +bitexact \
-flvflags add_keyframe_index -idct simple -dct int -y 
$(TARGET_PATH)/tests/data/add_keyframe_index.flv 2> /dev/null;
 
 FATE_AFILTER-$(call ALLYES, FLV_MUXER FLV_DEMUXER AVDEVICE TESTSRC_FILTER 
LAVFI_INDEV FLV_ENCODER) += fate-flv-add_keyframe_index

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