[FFmpeg-cvslog] avcodec/opus: set skip_samples

2018-11-28 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Nov 27 15:16:36 
2018 +0100| [18aea7bdd96b320a40573bccabea56afeccdd91c] | committer: Paul B Mahol

avcodec/opus: set skip_samples

Also update fate test. Fixes #5258.

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

 libavcodec/opus.c   | 3 ++-
 tests/fate/opus.mak | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/opus.c b/libavcodec/opus.c
index aa827b604c..22cda64801 100644
--- a/libavcodec/opus.c
+++ b/libavcodec/opus.c
@@ -31,6 +31,7 @@
 
 #include "opus_celt.h"
 #include "opustab.h"
+#include "internal.h"
 #include "vorbis.h"
 
 static const uint16_t opus_frame_duration[32] = {
@@ -325,7 +326,7 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx,
 return AVERROR_PATCHWELCOME;
 }
 
-avctx->delay = AV_RL16(extradata + 10);
+avctx->delay = avctx->internal->skip_samples = AV_RL16(extradata + 10);
 
 channels = avctx->extradata ? extradata[9] : (avctx->channels == 1) ? 1 : 
2;
 if (!channels) {
diff --git a/tests/fate/opus.mak b/tests/fate/opus.mak
index 7f289455cf..c50d88f5e9 100644
--- a/tests/fate/opus.mak
+++ b/tests/fate/opus.mak
@@ -36,6 +36,7 @@ fate-opus-testvector09:  CMP_TARGET = 0
 fate-opus-testvector10:  CMP_TARGET = 38
 fate-opus-testvector11:  CMP_TARGET = 0
 fate-opus-testvector12:  CMP_TARGET = 160
+fate-opus-tron.6ch.tinypkts: CMP_SHIFT = 1440
 fate-opus-tron.6ch.tinypkts: CMP_TARGET = 0
 
 $(FATE_OPUS_CELT): CMP = oneoff

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


[FFmpeg-cvslog] configure: detect djgpp libc

2018-11-28 Thread Peter Ross
ffmpeg | branch: master | Peter Ross  | Sun Nov 11 22:02:56 
2018 +1100| [533ba0b6b5a5357fe8c19b3b5bb23fa16b6979f1] | committer: Peter Ross

configure: detect djgpp libc

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

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

diff --git a/configure b/configure
index ab3144e459..6909eaa72a 100755
--- a/configure
+++ b/configure
@@ -5297,7 +5297,6 @@ case $target_os in
 network_extralibs="-lsocket"
 objformat="coff"
 enable dos_paths
-add_cppflags -U__STRICT_ANSI__
 ;;
 linux)
 enable section_data_rel_ro
@@ -5466,6 +5465,9 @@ EOF
 elif test_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; 
then
 eval ${pfx}libc_type=solaris
 add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
+elif test_${pfx}cpp_condition sys/version.h "defined __DJGPP__"; then
+eval ${pfx}libc_type=djgpp
+add_cppflags -U__STRICT_ANSI__
 fi
 test_${pfx}cc <

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


[FFmpeg-cvslog] avpriv_tempfile: add djgpp fallback

2018-11-28 Thread Peter Ross
ffmpeg | branch: master | Peter Ross  | Tue Nov 20 18:42:41 
2018 +1100| [331715534a5bbf692b468989225104cd9bbf9fdb] | committer: Peter Ross

avpriv_tempfile: add djgpp fallback

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

 libavutil/file_open.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/file_open.c b/libavutil/file_open.c
index a8da283583..cc302f2f76 100644
--- a/libavutil/file_open.c
+++ b/libavutil/file_open.c
@@ -138,7 +138,7 @@ int avpriv_tempfile(const char *prefix, char **filename, 
int log_offset, void *l
 #else
 snprintf(*filename, len, "/tmp/%sXX", prefix);
 fd = mkstemp(*filename);
-#if defined(_WIN32) || defined (__ANDROID__)
+#if defined(_WIN32) || defined (__ANDROID__) || defined(__DJGPP__)
 if (fd < 0) {
 snprintf(*filename, len, "./%sXX", prefix);
 fd = mkstemp(*filename);

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


[FFmpeg-cvslog] configure: memalign is broken on djgpp 2.05

2018-11-28 Thread Peter Ross
ffmpeg | branch: master | Peter Ross  | Tue Nov 13 21:32:23 
2018 +1100| [8b7a1c22274e591f6927e1d4f0e2cb6989081fcc] | committer: Peter Ross

configure: memalign is broken on djgpp 2.05

djgpp 2.05 finally provides posix-compatible memalign, but it is broken,
so use malloc instead.

discussion: 
http://www.delorie.com/archives/browse.cgi?p=djgpp/2017/12/29/16:26:58

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

 configure | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 197e978a55..3e9222ed1b 100755
--- a/configure
+++ b/configure
@@ -6796,10 +6796,17 @@ check_deps $CONFIG_LIST   \
 enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non 
pthread threading without atomics not supported, try adding --enable-pthreads 
or --cpu=i486 or higher if you are on x86"
 enabled avresample && warn "Building with deprecated library libavresample"
 
-if test $target_os = "haiku"; then
+case $target_os in
+haiku)
 disable memalign
 disable posix_memalign
-fi
+;;
+*-dos|freedos|opendos)
+if test_cpp_condition sys/version.h "defined(__DJGPP__) && __DJGPP__ == 2 
&& __DJGPP_MINOR__ == 5"; then
+disable memalign
+fi
+;;
+esac
 
 flatten_extralibs(){
 nested_entries=

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


[FFmpeg-cvslog] additional math.h functions for djgpp

2018-11-28 Thread Peter Ross
ffmpeg | branch: master | Peter Ross  | Sun Nov 11 21:49:29 
2018 +1100| [dea1224754fda003b0229c56bce6602a5699d8db] | committer: Peter Ross

additional math.h functions for djgpp

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

 compat/djgpp/math.c   | 47 +++
 compat/djgpp/math.h   | 25 +
 configure |  2 ++
 tests/ref/fate/source |  1 +
 4 files changed, 75 insertions(+)

diff --git a/compat/djgpp/math.c b/compat/djgpp/math.c
new file mode 100644
index 00..777b879e01
--- /dev/null
+++ b/compat/djgpp/math.c
@@ -0,0 +1,47 @@
+/*
+ * 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
+ */
+
+#include 
+
+#define FUN(name, type, op) \
+type name(type x, type y) \
+{ \
+if (fpclassify(x) == FP_NAN) return y; \
+if (fpclassify(y) == FP_NAN) return x; \
+return x op y ? x : y; \
+}
+
+FUN(fmin, double, <)
+FUN(fmax, double, >)
+FUN(fminf, float, <)
+FUN(fmaxf, float, >)
+
+long double fmodl(long double x, long double y)
+{
+return fmod(x, y);
+}
+
+long double scalbnl(long double x, int exp)
+{
+return scalbn(x, exp);
+}
+
+long double copysignl(long double x, long double y)
+{
+return copysign(x, y);
+}
diff --git a/compat/djgpp/math.h b/compat/djgpp/math.h
new file mode 100644
index 00..4c02ea9c40
--- /dev/null
+++ b/compat/djgpp/math.h
@@ -0,0 +1,25 @@
+/*
+ * 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
+ */
+
+double fmin(double, double);
+double fmax(double, double);
+float fminf(float, float);
+float fmaxf(float, float);
+long double fmodl(long double, long double);
+long double scalbnl(long double, int);
+long double copysignl(long double, long double);
diff --git a/configure b/configure
index 6909eaa72a..197e978a55 100755
--- a/configure
+++ b/configure
@@ -5468,6 +5468,8 @@ EOF
 elif test_${pfx}cpp_condition sys/version.h "defined __DJGPP__"; then
 eval ${pfx}libc_type=djgpp
 add_cppflags -U__STRICT_ANSI__
+add_cflags "-include $source_path/compat/djgpp/math.h"
+add_compat djgpp/math.o
 fi
 test_${pfx}cc <
diff --git a/tests/ref/fate/source b/tests/ref/fate/source
index b35f016127..0c98a0638a 100644
--- a/tests/ref/fate/source
+++ b/tests/ref/fate/source
@@ -28,6 +28,7 @@ compat/avisynth/avxsynth_c.h
 compat/avisynth/windowsPorts/basicDataTypeConversions.h
 compat/avisynth/windowsPorts/windows2linux.h
 compat/cuda/dynlink_loader.h
+compat/djgpp/math.h
 compat/float/float.h
 compat/float/limits.h
 Use of av_clip() where av_clip_uintp2() could be used:

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


[FFmpeg-cvslog] avcodec/opus: check if internal is available

2018-11-28 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Wed Nov 28 20:27:43 
2018 +0100| [68f289dacddcdf9742a8e9af51956ac226bfbafb] | committer: Paul B Mahol

avcodec/opus: check if internal is available

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

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

diff --git a/libavcodec/opus.c b/libavcodec/opus.c
index 22cda64801..f74278a7e3 100644
--- a/libavcodec/opus.c
+++ b/libavcodec/opus.c
@@ -326,7 +326,9 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx,
 return AVERROR_PATCHWELCOME;
 }
 
-avctx->delay = avctx->internal->skip_samples = AV_RL16(extradata + 10);
+avctx->delay = AV_RL16(extradata + 10);
+if (avctx->internal)
+avctx->internal->skip_samples = avctx->delay;
 
 channels = avctx->extradata ? extradata[9] : (avctx->channels == 1) ? 1 : 
2;
 if (!channels) {

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


[FFmpeg-cvslog] lavf/rawdec: Do not mark streams from raw subtitle demuxers as data streams.

2018-11-28 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Tue Nov 27 
18:22:02 2018 +0100| [271a00043ef3116d9561e45fa5773a0d9a0993c2] | committer: 
Carl Eugen Hoyos

lavf/rawdec: Do not mark streams from raw subtitle demuxers as data streams.

Improves "ffmpeg -i" output for raw dvbsub files.

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

 libavformat/rawdec.c  | 11 +++
 libavformat/rawdec.h  |  4 +++-
 libavformat/version.h |  2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index b38a4b5e5d..6249352d28 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -91,6 +91,17 @@ fail:
 return ret;
 }
 
+int ff_raw_subtitle_read_header(AVFormatContext *s)
+{
+AVStream *st = avformat_new_stream(s, NULL);
+if (!st)
+return AVERROR(ENOMEM);
+st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
+st->codecpar->codec_id = s->iformat->raw_codec_id;
+st->start_time = 0;
+return 0;
+}
+
 int ff_raw_data_read_header(AVFormatContext *s)
 {
 AVStream *st = avformat_new_stream(s, NULL);
diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h
index a464bbb432..3eb416b8ee 100644
--- a/libavformat/rawdec.h
+++ b/libavformat/rawdec.h
@@ -41,6 +41,8 @@ int ff_raw_audio_read_header(AVFormatContext *s);
 
 int ff_raw_video_read_header(AVFormatContext *s);
 
+int ff_raw_subtitle_read_header(AVFormatContext *s);
+
 int ff_raw_data_read_header(AVFormatContext *s);
 
 #define FF_RAWVIDEO_DEMUXER_CLASS(name)\
@@ -83,7 +85,7 @@ AVInputFormat ff_ ## shortname ## _demuxer = {\
 .name   = #shortname,\
 .long_name  = NULL_IF_CONFIG_SMALL(longname),\
 .read_probe = probe,\
-.read_header= ff_raw_data_read_header,\
+.read_header= ff_raw_subtitle_read_header,\
 .read_packet= ff_raw_read_partial_packet,\
 .extensions = ext,\
 .flags  = flag,\
diff --git a/libavformat/version.h b/libavformat/version.h
index 70e868ffbc..824b9e7cd6 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -33,7 +33,7 @@
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  58
 #define LIBAVFORMAT_VERSION_MINOR  23
-#define LIBAVFORMAT_VERSION_MICRO 100
+#define LIBAVFORMAT_VERSION_MICRO 101
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \

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


[FFmpeg-cvslog] avcodec/libopusenc: Fix warning when encoding ambisonics with channel mapping 2

2018-11-28 Thread Felicia Lim
ffmpeg | branch: master | Felicia Lim  | Mon Jul 30 12:59:44 
2018 -0700| [4cd6f08d2005c20a03ccd53a0a6f8a115c5ebe2e] | committer: Michael 
Niedermayer

avcodec/libopusenc: Fix warning when encoding ambisonics with channel mapping 2

Also adds checks on the number of channels.

Signed-off-by: Michael Niedermayer 

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

 libavcodec/libopusenc.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c
index 7c025a66d7..50d843ebc5 100644
--- a/libavcodec/libopusenc.c
+++ b/libavcodec/libopusenc.c
@@ -27,6 +27,7 @@
 #include "bytestream.h"
 #include "internal.h"
 #include "libopus.h"
+#include "mathops.h"
 #include "vorbis.h"
 #include "audio_frame_queue.h"
 
@@ -200,6 +201,21 @@ static int libopus_check_vorbis_layout(AVCodecContext 
*avctx, int mapping_family
 return 0;
 }
 
+static int libopus_check_ambisonics_channels(AVCodecContext *avctx) {
+int channels = avctx->channels;
+int ambisonic_order = ff_sqrt(channels) - 1;
+if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1)) &&
+channels != ((ambisonic_order + 1) * (ambisonic_order + 1) + 2)) {
+av_log(avctx, AV_LOG_ERROR,
+   "Ambisonics coding is only specified for channel counts"
+   " which can be written as (n + 1)^2 or (n + 1)^2 + 2"
+   " for nonnegative integer n\n");
+return AVERROR_INVALIDDATA;
+}
+
+return 0;
+}
+
 static int libopus_validate_layout_and_get_channel_map(
 AVCodecContext *avctx,
 int mapping_family,
@@ -231,6 +247,12 @@ static int libopus_validate_layout_and_get_channel_map(
 channel_map = ff_vorbis_channel_layout_offsets[avctx->channels - 
1];
 }
 break;
+case 2:
+ret = libopus_check_max_channels(avctx, 227);
+if (ret == 0) {
+ret = libopus_check_ambisonics_channels(avctx);
+}
+break;
 case 255:
 ret = libopus_check_max_channels(avctx, 254);
 break;

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


[FFmpeg-cvslog] Revert "avcodec/libopusenc: Fix warning when encoding ambisonics with channel mapping 2"

2018-11-28 Thread Rostislav Pehlivanov
ffmpeg | branch: master | Rostislav Pehlivanov  | Wed Nov 
28 23:53:51 2018 +| [cf283f2dfbbf8b4c59d4f32f4308ede851613257] | committer: 
Rostislav Pehlivanov

Revert "avcodec/libopusenc: Fix warning when encoding ambisonics with channel 
mapping 2"

This reverts commit 4cd6f08d2005c20a03ccd53a0a6f8a115c5ebe2e.

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

 libavcodec/libopusenc.c | 22 --
 1 file changed, 22 deletions(-)

diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c
index 50d843ebc5..7c025a66d7 100644
--- a/libavcodec/libopusenc.c
+++ b/libavcodec/libopusenc.c
@@ -27,7 +27,6 @@
 #include "bytestream.h"
 #include "internal.h"
 #include "libopus.h"
-#include "mathops.h"
 #include "vorbis.h"
 #include "audio_frame_queue.h"
 
@@ -201,21 +200,6 @@ static int libopus_check_vorbis_layout(AVCodecContext 
*avctx, int mapping_family
 return 0;
 }
 
-static int libopus_check_ambisonics_channels(AVCodecContext *avctx) {
-int channels = avctx->channels;
-int ambisonic_order = ff_sqrt(channels) - 1;
-if (channels != ((ambisonic_order + 1) * (ambisonic_order + 1)) &&
-channels != ((ambisonic_order + 1) * (ambisonic_order + 1) + 2)) {
-av_log(avctx, AV_LOG_ERROR,
-   "Ambisonics coding is only specified for channel counts"
-   " which can be written as (n + 1)^2 or (n + 1)^2 + 2"
-   " for nonnegative integer n\n");
-return AVERROR_INVALIDDATA;
-}
-
-return 0;
-}
-
 static int libopus_validate_layout_and_get_channel_map(
 AVCodecContext *avctx,
 int mapping_family,
@@ -247,12 +231,6 @@ static int libopus_validate_layout_and_get_channel_map(
 channel_map = ff_vorbis_channel_layout_offsets[avctx->channels - 
1];
 }
 break;
-case 2:
-ret = libopus_check_max_channels(avctx, 227);
-if (ret == 0) {
-ret = libopus_check_ambisonics_channels(avctx);
-}
-break;
 case 255:
 ret = libopus_check_max_channels(avctx, 254);
 break;

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


[FFmpeg-cvslog] Revert "libopus: Add channel mapping 2 support in libopusdec"

2018-11-28 Thread Rostislav Pehlivanov
ffmpeg | branch: master | Rostislav Pehlivanov  | Wed Nov 
28 23:54:08 2018 +| [ffec9d32feaff7075c0b150f1168e08aeb4a296a] | committer: 
Rostislav Pehlivanov

Revert "libopus: Add channel mapping 2 support in libopusdec"

This reverts commit c8c995bc1ddc34df93049f002432286018c8cc94.

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

 libavcodec/libopusdec.c | 39 ++-
 1 file changed, 10 insertions(+), 29 deletions(-)

diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c
index 2a97811d18..1724a49906 100644
--- a/libavcodec/libopusdec.c
+++ b/libavcodec/libopusdec.c
@@ -63,6 +63,8 @@ static av_cold int libopus_decode_init(AVCodecContext *avc)
 avc->sample_rate= 48000;
 avc->sample_fmt = avc->request_sample_fmt == AV_SAMPLE_FMT_FLT ?
   AV_SAMPLE_FMT_FLT : AV_SAMPLE_FMT_S16;
+avc->channel_layout = avc->channels > 8 ? 0 :
+  ff_vorbis_channel_layouts[avc->channels - 1];
 
 if (avc->extradata_size >= OPUS_HEAD_SIZE) {
 opus->pre_skip = AV_RL16(avc->extradata + 10);
@@ -86,35 +88,14 @@ static av_cold int libopus_decode_init(AVCodecContext *avc)
 mapping= mapping_arr;
 }
 
-if (channel_map == 1) {
-avc->channel_layout = avc->channels > 8 ? 0 :
-  ff_vorbis_channel_layouts[avc->channels - 1];
-if (avc->channels > 2 && avc->channels <= 8) {
-const uint8_t *vorbis_offset = 
ff_vorbis_channel_layout_offsets[avc->channels - 1];
-int ch;
-
-/* Remap channels from Vorbis order to ffmpeg order */
-for (ch = 0; ch < avc->channels; ch++)
-mapping_arr[ch] = mapping[vorbis_offset[ch]];
-mapping = mapping_arr;
-}
-} else if (channel_map == 2) {
-int ambisonic_order = ff_sqrt(avc->channels) - 1;
-if (avc->channels != (ambisonic_order + 1) * (ambisonic_order + 1) &&
-avc->channels != (ambisonic_order + 1) * (ambisonic_order + 1) + 
2) {
-av_log(avc, AV_LOG_ERROR,
-   "Channel mapping 2 is only specified for channel counts"
-   " which can be written as (n + 1)^2 or (n + 2)^2 + 2"
-   " for nonnegative integer n\n");
-return AVERROR_INVALIDDATA;
-}
-if (avc->channels > 227) {
-av_log(avc, AV_LOG_ERROR, "Too many channels\n");
-return AVERROR_INVALIDDATA;
-}
-avc->channel_layout = 0;
-} else {
-avc->channel_layout = 0;
+if (avc->channels > 2 && avc->channels <= 8) {
+const uint8_t *vorbis_offset = 
ff_vorbis_channel_layout_offsets[avc->channels - 1];
+int ch;
+
+/* Remap channels from Vorbis order to ffmpeg order */
+for (ch = 0; ch < avc->channels; ch++)
+mapping_arr[ch] = mapping[vorbis_offset[ch]];
+mapping = mapping_arr;
 }
 
 opus->dec = opus_multistream_decoder_create(avc->sample_rate, 
avc->channels,

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


[FFmpeg-cvslog] avcodec/libdav1d: read profile from the sequence header referenced by the ouput picture

2018-11-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Nov 28 22:49:06 
2018 -0300| [0fca2f60dac7a294719919ca32813e9fde19cc66] | committer: James Almer

avcodec/libdav1d: read profile from the sequence header referenced by the ouput 
picture

Signed-off-by: James Almer 

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

 libavcodec/libdav1d.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index ed2262df7c..9a24a3e408 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -84,14 +84,6 @@ static const enum AVPixelFormat pix_fmt[][2] = {
 [DAV1D_PIXEL_LAYOUT_I444] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10 },
 };
 
-// TODO: Update once 12bit support is added.
-static const int profile[] = {
-[DAV1D_PIXEL_LAYOUT_I400] = FF_PROFILE_AV1_MAIN,
-[DAV1D_PIXEL_LAYOUT_I420] = FF_PROFILE_AV1_MAIN,
-[DAV1D_PIXEL_LAYOUT_I422] = FF_PROFILE_AV1_PROFESSIONAL,
-[DAV1D_PIXEL_LAYOUT_I444] = FF_PROFILE_AV1_HIGH,
-};
-
 static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
 {
 Libdav1dContext *dav1d = c->priv_data;
@@ -156,7 +148,7 @@ static int libdav1d_receive_frame(AVCodecContext *c, 
AVFrame *frame)
 frame->linesize[1] = p.stride[1];
 frame->linesize[2] = p.stride[1];
 
-c->profile = profile[p.p.layout];
+c->profile = p.seq_hdr->profile;
 frame->format = c->pix_fmt = pix_fmt[p.p.layout][p.p.bpc == 10];
 frame->width = p.p.w;
 frame->height = p.p.h;

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


[FFmpeg-cvslog] avcodec/libdav1d: use constants defined in the public API to limit thread count

2018-11-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Nov 28 22:48:13 
2018 -0300| [3cd275bcde5c0de509c239fff275e8277cece514] | committer: James Almer

avcodec/libdav1d: use constants defined in the public API to limit thread count

Signed-off-by: James Almer 

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

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

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index cfa014455e..ed2262df7c 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -46,7 +46,7 @@ static av_cold int libdav1d_init(AVCodecContext *c)
 
 dav1d_default_settings(&s);
 s.n_tile_threads = dav1d->tile_threads;
-s.n_frame_threads = FFMIN(c->thread_count ? c->thread_count : 
av_cpu_count(), 256);
+s.n_frame_threads = FFMIN(c->thread_count ? c->thread_count : 
av_cpu_count(), DAV1D_MAX_FRAME_THREADS);
 
 res = dav1d_open(&dav1d->c, &s);
 if (res < 0)
@@ -223,7 +223,7 @@ static av_cold int libdav1d_close(AVCodecContext *c)
 #define OFFSET(x) offsetof(Libdav1dContext, x)
 #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 static const AVOption libdav1d_options[] = {
-{ "tilethreads",  "Tile threads",  OFFSET(tile_threads),  AV_OPT_TYPE_INT, 
{ .i64 = 1 }, 1,  64, VD, NULL },
+{ "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { 
.i64 = 1 }, 1, DAV1D_MAX_TILE_THREADS, VD },
 { NULL }
 };
 

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


[FFmpeg-cvslog] avcodec/libdav1d: add an option to toggle Film Grain

2018-11-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Nov 28 22:54:19 
2018 -0300| [e695b0beba4aab5c1197d1bc96eef1f42635c423] | committer: James Almer

avcodec/libdav1d: add an option to toggle Film Grain

Signed-off-by: James Almer 

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

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

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 9a24a3e408..52a7c10617 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -34,6 +34,7 @@ typedef struct Libdav1dContext {
 
 Dav1dData data;
 int tile_threads;
+int apply_grain;
 } Libdav1dContext;
 
 static av_cold int libdav1d_init(AVCodecContext *c)
@@ -46,6 +47,7 @@ static av_cold int libdav1d_init(AVCodecContext *c)
 
 dav1d_default_settings(&s);
 s.n_tile_threads = dav1d->tile_threads;
+s.apply_grain = dav1d->apply_grain;
 s.n_frame_threads = FFMIN(c->thread_count ? c->thread_count : 
av_cpu_count(), DAV1D_MAX_FRAME_THREADS);
 
 res = dav1d_open(&dav1d->c, &s);
@@ -216,6 +218,7 @@ static av_cold int libdav1d_close(AVCodecContext *c)
 #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 static const AVOption libdav1d_options[] = {
 { "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { 
.i64 = 1 }, 1, DAV1D_MAX_TILE_THREADS, VD },
+{ "filmgrain", "Apply Film Grain", OFFSET(apply_grain), AV_OPT_TYPE_BOOL, 
{ .i64 = 1 }, 0, 1, VD },
 { NULL }
 };
 

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


[FFmpeg-cvslog] avcodec/libdav1d: remove init cleanup internal codec cap

2018-11-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Nov 28 22:40:23 
2018 -0300| [53ca505acc533edd2ef76a324c0ed0a98ee0] | committer: James Almer

avcodec/libdav1d: remove init cleanup internal codec cap

It's no longer needed now that the AVFifoBuffer was removed.

Signed-off-by: James Almer 

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

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

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index d927f11a9e..cfa014455e 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -245,8 +245,7 @@ AVCodec ff_libdav1d_decoder = {
 .flush  = libdav1d_flush,
 .receive_frame  = libdav1d_receive_frame,
 .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AUTO_THREADS,
-.caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP 
|
-  FF_CODEC_CAP_SETS_PKT_DTS,
+.caps_internal  = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SETS_PKT_DTS,
 .priv_class = &libdav1d_class,
 .wrapper_name   = "libdav1d",
 };

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