[FFmpeg-devel] [PATCH v2] lavf/matroskadec: Set A_QUICKTIME bit depth

2016-01-15 Thread Mats Peterson

Since mkvmerge doesn't set the bit depth for A_QUICKTIME audio (as far
as I know), the track->audio.bitdepth variable will be zero, and its
value needs to be retrieved from the sound sample description. Also,
confine the 0x to 'raw '/'twos' fourcc mapping to old version 0
sound sample descriptions, since they are the only valid sample
descriptions for this type of mapping.

Also, 'twos' audio can be signed 8-bit.

Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
>From 8de708387f9bff7f20c825ccad59352b0fd7fc33 Mon Sep 17 00:00:00 2001
From: Mats Peterson 
Date: Fri, 15 Jan 2016 10:49:45 +0100
Subject: [PATCH v2] lavf/matroskadec: Set A_QUICKTIME bit depth

Since mkvmerge doesn't set the bit depth for A_QUICKTIME audio (as far
as I know), the track->audio.bitdepth variable will be zero, and its
value needs to be retrieved from the sound sample description. Also,
confine the 0x to 'raw '/'twos' fourcc mapping to old version 0
sound sample descriptions, since they are the only valid sample
descriptions for this type of mapping.

Also, 'twos' audio can be signed 8-bit.

---
 libavformat/matroskadec.c |   24 +---
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index cc5ec19..687929a 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1891,17 +1891,27 @@ static int matroska_parse_tracks(AVFormatContext *s)
/* Normally 36, but allow noncompliant private data */
&& (track->codec_priv.size >= 32)
&& (track->codec_priv.data)) {
+uint16_t stsd_version;
 int ret = get_qt_codec(track, , _id);
 if (ret < 0)
 return ret;
-if (fourcc == 0) {
-if (track->audio.bitdepth == 8) {
-fourcc = MKTAG('r','a','w',' ');
-codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
-} else if (track->audio.bitdepth == 16) {
-fourcc = MKTAG('t','w','o','s');
-codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
+stsd_version = AV_RB16(track->codec_priv.data + 16);
+if (stsd_version == 0) {
+/* Currently not set by mkvmerge, so get the bit depth
+ * from the sample description. */
+track->audio.bitdepth = AV_RB16(track->codec_priv.data + 26);
+if (fourcc == 0) {
+if (track->audio.bitdepth == 8) {
+fourcc = MKTAG('r','a','w',' ');
+codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
+} else if (track->audio.bitdepth == 16) {
+fourcc = MKTAG('t','w','o','s');
+codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
+}
 }
+/* 'twos' audio can be 8-bit */
+if (fourcc == MKTAG('t','w','o','s') && track->audio.bitdepth == 8)
+codec_id = AV_CODEC_ID_PCM_S8;
 }
 } else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
(track->codec_priv.size >= 21)  &&
-- 
1.7.10.4

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


Re: [FFmpeg-devel] [PATCH] lavc/rawdec: Use AV_PIX_FMT_PAL8 for 1-bit raw QuickTime video

2016-01-15 Thread Mats Peterson

On 01/13/2016 01:42 PM, Mats Peterson wrote:

Match the use of AV_PIX_FMT_PAL8 for 1-bit QuickTime Animation in
lavc/qtrle. To reiterate, 1-bit video is not necessary black & white in
QuickTime, merely bi-level. The two colors can be any color. The palette,
either included in the sample description, or the default Macintosh
palette (black & white for 1-bit video) will be set in lavf/qtpalette.
See the QuickTime File Format Specification for details.

Mats


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



ping

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


Re: [FFmpeg-devel] [PATCH v2] lavf/matroskadec: Set A_QUICKTIME bit depth

2016-01-15 Thread Mats Peterson

On 01/15/2016 11:12 AM, Mats Peterson wrote:

Since mkvmerge doesn't set the bit depth for A_QUICKTIME audio (as far
as I know), the track->audio.bitdepth variable will be zero, and its
value needs to be retrieved from the sound sample description. Also,
confine the 0x to 'raw '/'twos' fourcc mapping to old version 0
sound sample descriptions, since they are the only valid sample
descriptions for this type of mapping.

Also, 'twos' audio can be signed 8-bit.

Mats



Skip this one, I have another one coming.

Mats

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


[FFmpeg-devel] [PATCH v3] lavf/matroskadec: Set A_QUICKTIME bit depth

2016-01-15 Thread Mats Peterson
FFmpeg curiously uses 'sowt' as the fourcc when writing 8-bit signed 
QuickTime data, so cater for this as well. Description follows:


Since mkvmerge doesn't set the bit depth for A_QUICKTIME audio (as far 
as I know), the track->audio.bitdepth variable will be zero, and its 
value needs to be retrieved from the sound sample description. Also, 
confine the 0x to 'raw '/'twos' fourcc mapping to old version 0 
sound sample descriptions, since they are the only valid sample 
descriptions for this type of mapping.


Also, 'twos' and 'sowt' audio can be signed 8-bit.

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
>From 0fce7d158725fe9c3fe673cebba3c42e328a8aad Mon Sep 17 00:00:00 2001
From: Mats Peterson 
Date: Fri, 15 Jan 2016 13:01:40 +0100
Subject: [PATCH v3] lavf/matroskadec: Set A_QUICKTIME bit depth

Since mkvmerge doesn't set the bit depth for A_QUICKTIME audio (as far
as I know), the track->audio.bitdepth variable will be zero, and its
value needs to be retrieved from the sound sample description. Also,
confine the 0x to 'raw '/'twos' fourcc mapping to old version 0
sound sample descriptions, since they are the only valid sample
descriptions for this type of mapping.

Also, 'twos' and 'sowt' audio can be signed 8-bit.

---
 libavformat/matroskadec.c |   25 ++---
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index cc5ec19..95faf4a 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1891,17 +1891,28 @@ static int matroska_parse_tracks(AVFormatContext *s)
/* Normally 36, but allow noncompliant private data */
&& (track->codec_priv.size >= 32)
&& (track->codec_priv.data)) {
+uint16_t stsd_version;
 int ret = get_qt_codec(track, , _id);
 if (ret < 0)
 return ret;
-if (fourcc == 0) {
-if (track->audio.bitdepth == 8) {
-fourcc = MKTAG('r','a','w',' ');
-codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
-} else if (track->audio.bitdepth == 16) {
-fourcc = MKTAG('t','w','o','s');
-codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
+stsd_version = AV_RB16(track->codec_priv.data + 16);
+if (stsd_version == 0) {
+/* Currently not set by mkvmerge, so get the bit depth
+ * from the sample description. */
+track->audio.bitdepth = AV_RB16(track->codec_priv.data + 26);
+if (fourcc == 0) {
+if (track->audio.bitdepth == 8) {
+fourcc = MKTAG('r','a','w',' ');
+codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
+} else if (track->audio.bitdepth == 16) {
+fourcc = MKTAG('t','w','o','s');
+codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
+}
 }
+/* 'twos' and 'sowt' audio can be 8-bit */
+if ((fourcc == MKTAG('t','w','o','s') || fourcc == MKTAG('s','o','w','t')) &&
+track->audio.bitdepth == 8)
+codec_id = AV_CODEC_ID_PCM_S8;
 }
 } else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
(track->codec_priv.size >= 21)  &&
-- 
1.7.10.4

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


[FFmpeg-devel] [PATCH] libkvazaar: Set frame rate as a rational number

2016-01-15 Thread Arttu Ylä-Outinen
Updates libkvazaar to pass the exact frame rate to Kvazaar by setting
the numerator and denominator separately instead of a single floating
point number. The exact frame rate is needed for writing timing info to
the bitstream.

Requires Kvazaar version 0.8.1.

Signed-off-by: Arttu Ylä-Outinen 
---
 configure   | 2 +-
 libavcodec/libkvazaar.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 7cef6f5..1b004db 100755
--- a/configure
+++ b/configure
@@ -5452,7 +5452,7 @@ enabled libgsm&& { for gsm_hdr in "gsm.h" 
"gsm/gsm.h"; do
check_lib "${gsm_hdr}" gsm_create -lgsm && 
break;
done || die "ERROR: libgsm not found"; }
 enabled libilbc   && require libilbc ilbc.h WebRtcIlbcfix_InitDecode 
-lilbc
-enabled libkvazaar&& require_pkg_config "kvazaar >= 0.7.1" kvazaar.h 
kvz_api_get
+enabled libkvazaar&& require_pkg_config "kvazaar >= 0.8.1" kvazaar.h 
kvz_api_get
 enabled libmfx&& require_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
diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index e58405d..87b802f 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -75,8 +75,8 @@ static av_cold int libkvazaar_init(AVCodecContext *avctx)
 cfg->width  = avctx->width;
 cfg->height = avctx->height;
 
-cfg->framerate =
-  avctx->time_base.den / (double)(avctx->time_base.num * 
avctx->ticks_per_frame);
+cfg->framerate_num   = avctx->time_base.den;
+cfg->framerate_denom = avctx->time_base.num * avctx->ticks_per_frame;
 cfg->target_bitrate = avctx->bit_rate;
 cfg->vui.sar_width  = avctx->sample_aspect_ratio.num;
 cfg->vui.sar_height = avctx->sample_aspect_ratio.den;
-- 
2.7.0

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


[FFmpeg-devel] [PATCH 1/2] ffplay: Seek only when pressing the right mouse button on the video window.

2016-01-15 Thread Vittorio Gambaletta (VittGam)

Seeking by clicking on the video window can be annoying, because
the user might click on it accidentally while eg. trying to get
focus on it, and ffplay seeks instead.

This commit changes that behaviour to seek only when the right
mouse button is used to click and drag on the window.

Signed-off-by: Vittorio Gambaletta 

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

diff --git a/ffplay.c b/ffplay.c
index d2e3dc6..2fa7165 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3480,9 +3480,11 @@ static void event_loop(VideoState *cur_stream)
 }
 cursor_last_shown = av_gettime_relative();
 if (event.type == SDL_MOUSEBUTTONDOWN) {
+if (event.button.button != SDL_BUTTON_RIGHT)
+break;
 x = event.button.x;
 } else {
-if (event.motion.state != SDL_PRESSED)
+if (!(event.motion.state & SDL_BUTTON_RMASK))
 break;
 x = event.motion.x;
 }
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] ffplay: Toggle full screen when double-clicking the video window with the left mouse button.

2016-01-15 Thread Vittorio Gambaletta (VittGam)

Now that the seek only happens with the right mouse button, it makes
sense to toggle full screen when double-clicking with the left mouse
button, like other video players do.

Signed-off-by: Vittorio Gambaletta 

---
 ffplay.c |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/ffplay.c b/ffplay.c
index 2fa7165..582ca39 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -3473,6 +3473,24 @@ static void event_loop(VideoState *cur_stream)
 do_exit(cur_stream);
 break;
 }
+{
+static int mouse_left_click_status = 0;
+static double mouse_left_click_last_x, mouse_left_click_last_y;
+if (event.button.button == SDL_BUTTON_LEFT) {
+if (mouse_left_click_status == 1 && av_gettime_relative() - 
cursor_last_shown <= 50
+&& fabs(event.button.x - mouse_left_click_last_x) <= 1 && 
fabs(event.button.y - mouse_left_click_last_y) <= 1) {
+toggle_full_screen(cur_stream);
+cur_stream->force_refresh = 1;
+mouse_left_click_status = 0;
+} else {
+mouse_left_click_status = 1;
+mouse_left_click_last_x = event.button.x;
+mouse_left_click_last_y = event.button.y;
+}
+} else {
+mouse_left_click_status = 0;
+}
+}
 case SDL_MOUSEMOTION:
 if (cursor_hidden) {
 SDL_ShowCursor(1);
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] mov: Add an option to toggle dref opening

2016-01-15 Thread Derek Buitenhuis
This feature is mostly only used by NLE software, and is
both of dubious value being enabled by default, and a
possible security risk.

Signed-off-by: Derek Buitenhuis 
---
 libavformat/isom.h|  1 +
 libavformat/mov.c | 22 +-
 libavformat/version.h |  4 ++--
 3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index e07dc0e9..99bc7be 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -227,6 +227,7 @@ typedef struct MOVContext {
 struct AVAES *aes_decrypt;
 uint8_t *decryption_key;
 int decryption_key_len;
+int enable_drefs;
 } MOVContext;
 
 int ff_mp4_read_descr_len(AVIOContext *pb);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4cc5ff2..106bdcf 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3051,13 +3051,23 @@ static int mov_read_trak(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 
 if (sc->dref_id-1 < sc->drefs_count && sc->drefs[sc->dref_id-1].path) {
 MOVDref *dref = >drefs[sc->dref_id - 1];
-if (mov_open_dref(c, >pb, c->fc->filename, dref,
-  >fc->interrupt_callback) < 0)
-av_log(c->fc, AV_LOG_ERROR,
-   "stream %d, error opening alias: path='%s', dir='%s', "
-   "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d\n",
+if (c->enable_drefs) {
+if (mov_open_dref(c, >pb, c->fc->filename, dref,
+  >fc->interrupt_callback) < 0)
+av_log(c->fc, AV_LOG_ERROR,
+   "stream %d, error opening alias: path='%s', dir='%s', "
+   "filename='%s', volume='%s', nlvl_from=%d, 
nlvl_to=%d\n",
+   st->index, dref->path, dref->dir, dref->filename,
+   dref->volume, dref->nlvl_from, dref->nlvl_to);
+} else {
+av_log(c->fc, AV_LOG_WARNING,
+   "Skipped opening external track: "
+   "stream %d, alias: path='%s', dir='%s', "
+   "filename='%s', volume='%s', nlvl_from=%d, nlvl_to=%d."
+   "Set enable_drefs to allow this.\n",
st->index, dref->path, dref->dir, dref->filename,
dref->volume, dref->nlvl_from, dref->nlvl_to);
+}
 } else {
 sc->pb = c->fc->pb;
 sc->pb_is_copied = 1;
@@ -5219,6 +5229,8 @@ static const AVOption mov_options[] = {
 AV_OPT_TYPE_BINARY, {.str="77214d4b196a87cd520045fd20a51d67"},
 .flags = AV_OPT_FLAG_DECODING_PARAM },
 { "decryption_key", "The media decryption key (hex)", 
OFFSET(decryption_key), AV_OPT_TYPE_BINARY, .flags = AV_OPT_FLAG_DECODING_PARAM 
},
+{ "enable_drefs", "Enable external track support.", OFFSET(enable_drefs), 
AV_OPT_TYPE_BOOL,
+{.i64 = 0}, 0, 1, FLAGS },
 
 { NULL },
 };
diff --git a/libavformat/version.h b/libavformat/version.h
index ad9ba63..a4feab8 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR  21
-#define LIBAVFORMAT_VERSION_MICRO 101
+#define LIBAVFORMAT_VERSION_MINOR  22
+#define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
-- 
1.8.3.1

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


Re: [FFmpeg-devel] [PATCH] x86/intmath: add sse optimized av_clipf and av_clipd

2016-01-15 Thread Michael Niedermayer
On Thu, Jan 07, 2016 at 02:26:26PM -0300, James Almer wrote:
> On 1/7/2016 10:32 AM, Michael Niedermayer wrote:
> > On Thu, Jan 07, 2016 at 12:36:02AM -0300, James Almer wrote:
> >> Signed-off-by: James Almer 
> >> ---
> >> I could also include stdlib.h inside the __GNU__ section if that's
> >> prefered, since other compilers don't need it.
> >>
> >>  libavutil/x86/intmath.h | 33 +
> >>  1 file changed, 33 insertions(+)
> > 
> > works here, no more comments from me
> 
> Pushed, thanks.

This seems to have broken all intel C fate boxes
http://fate.ffmpeg.org/history.cgi?slot=x86_64-archlinux-icc-2013

only issue i see is use of +x instead of + but i dont have icc
locally so i cant check

if its not that maybe that could be disabled for ICC ...


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 3/3] lavc/wmadec: replace pow by faster functions

2016-01-15 Thread Ganesh Ajjanagadde
Further speedups possible by getting rid of exp2f...

Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/wmadec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index da54182..1a84323 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -35,6 +35,7 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/internal.h"
+#include "libavutil/libm.h"
 
 #include "avcodec.h"
 #include "internal.h"
@@ -164,7 +165,7 @@ static av_cold void wma_lsp_to_curve_init(WMACodecContext 
*s, int frame_len)
 /* tables for x^-0.25 computation */
 for (i = 0; i < 256; i++) {
 e = i - 126;
-s->lsp_pow_e_table[i] = pow(2.0, e * -0.25);
+s->lsp_pow_e_table[i] = exp2f(e * -0.25);
 }
 
 /* NOTE: these two tables are needed to avoid two operations in
@@ -173,7 +174,7 @@ static av_cold void wma_lsp_to_curve_init(WMACodecContext 
*s, int frame_len)
 for (i = (1 << LSP_POW_BITS) - 1; i >= 0; i--) {
 m  = (1 << LSP_POW_BITS) + i;
 a  = (float) m * (0.5 / (1 << LSP_POW_BITS));
-a  = pow(a, -0.25);
+a  = 1/sqrt(sqrt(a));
 s->lsp_pow_m_table1[i] = 2 * a - b;
 s->lsp_pow_m_table2[i] = b - a;
 b  = a;
-- 
2.7.0

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


[FFmpeg-devel] [PATCH 1/3] lavc/atrac3plusdsp: change pow(2, x) to exp2f(x)

2016-01-15 Thread Ganesh Ajjanagadde
Much faster generation possible; but array is small so don't want to bloat
the binary.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/atrac3plusdsp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/atrac3plusdsp.c b/libavcodec/atrac3plusdsp.c
index 17c6437..d089588 100644
--- a/libavcodec/atrac3plusdsp.c
+++ b/libavcodec/atrac3plusdsp.c
@@ -28,6 +28,7 @@
 #include 
 
 #include "libavutil/float_dsp.h"
+#include "libavutil/libm.h"
 #include "avcodec.h"
 #include "sinewin.h"
 #include "fft.h"
@@ -107,7 +108,7 @@ av_cold void ff_atrac3p_init_wave_synth(void)
 
 /* generate amplitude scalefactors table */
 for (i = 0; i < 64; i++)
-amp_sf_tab[i] = pow(2.0f, ((double)i - 3) / 4.0f);
+amp_sf_tab[i] = exp2f((i - 3) / 4.0f);
 }
 
 /**
-- 
2.7.0

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


[FFmpeg-devel] [PATCH 2/3] lavc/opus_celt: replace pow(2, x) by exp2f(x)

2016-01-15 Thread Ganesh Ajjanagadde
Faster methods possible; since exponent is always a multiple of 1/8.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/opus_celt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/opus_celt.c b/libavcodec/opus_celt.c
index 474452f..61a9dc6 100644
--- a/libavcodec/opus_celt.c
+++ b/libavcodec/opus_celt.c
@@ -27,6 +27,7 @@
 #include 
 
 #include "libavutil/float_dsp.h"
+#include "libavutil/libm.h"
 
 #include "imdct15.h"
 #include "opus.h"
@@ -1839,7 +1840,7 @@ static void process_anticollapse(CeltContext *s, 
CeltFrame *frame, float *X)
 
 /* depth in 1/8 bits */
 depth = (1 + s->pulses[i]) / (celt_freq_range[i] << s->duration);
-thresh = pow(2, -1.0 - 0.125f * depth);
+thresh = exp2f(-1.0 - 0.125f * depth);
 sqrt_1 = 1.0f / sqrtf(celt_freq_range[i] << s->duration);
 
 xptr = X + (celt_freq_bands[i] << s->duration);
-- 
2.7.0

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


[FFmpeg-devel] [PATCH 2/4] avcodec/v210: add avx2 version of the 8-bit line encoder

2016-01-15 Thread James Darnley
Around 35% faster than the avx version.

Signed-off-by: Henrik Gramner 
---
The only changes here are the ones suggested by Henrik and a whitespace change
for alignment at the function definition in v210enc_init.c
---
 libavcodec/v210enc.c  |  5 +++--
 libavcodec/v210enc.h  |  1 +
 libavcodec/x86/constants.c|  3 ++-
 libavcodec/x86/constants.h|  2 +-
 libavcodec/x86/v210enc.asm| 48 ---
 libavcodec/x86/v210enc_init.c |  7 +++
 6 files changed, 45 insertions(+), 21 deletions(-)

diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index 0612248..ec63864 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -86,6 +86,7 @@ av_cold void ff_v210enc_init(V210EncContext *s)
 {
 s->pack_line_8  = v210_planar_pack_8_c;
 s->pack_line_10 = v210_planar_pack_10_c;
+s->sample_factor = 1;
 
 if (ARCH_X86)
 ff_v210enc_init_x86(s);
@@ -172,13 +173,13 @@ static int encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
 const uint8_t *v = pic->data[2];
 for (h = 0; h < avctx->height; h++) {
 uint32_t val;
-w = (avctx->width / 12) * 12;
+w = (avctx->width / (12 * s->sample_factor)) * 12 * 
s->sample_factor;
 s->pack_line_8(y, u, v, dst, w);
 
 y += w;
 u += w >> 1;
 v += w >> 1;
-dst += (w / 12) * 32;
+dst += (w / (12 * s->sample_factor)) * 32 * s->sample_factor;
 
 for (; w < avctx->width - 5; w += 6) {
 WRITE_PIXELS8(u, y, v);
diff --git a/libavcodec/v210enc.h b/libavcodec/v210enc.h
index a205427..85f84f1 100644
--- a/libavcodec/v210enc.h
+++ b/libavcodec/v210enc.h
@@ -28,6 +28,7 @@ typedef struct V210EncContext {
 const uint8_t *v, uint8_t *dst, ptrdiff_t width);
 void (*pack_line_10)(const uint16_t *y, const uint16_t *u,
  const uint16_t *v, uint8_t *dst, ptrdiff_t width);
+int sample_factor;
 } V210EncContext;
 
 void ff_v210enc_init(V210EncContext *s);
diff --git a/libavcodec/x86/constants.c b/libavcodec/x86/constants.c
index 0098e20..7e6883d 100644
--- a/libavcodec/x86/constants.c
+++ b/libavcodec/x86/constants.c
@@ -74,7 +74,8 @@ DECLARE_ALIGNED(32, const ymm_reg,  ff_pb_3)= { 
0x0303030303030303ULL, 0x030
 0x0303030303030303ULL, 
0x0303030303030303ULL };
 DECLARE_ALIGNED(32, const xmm_reg,  ff_pb_15)   = { 0x0F0F0F0F0F0F0F0FULL, 
0x0F0F0F0F0F0F0F0FULL };
 DECLARE_ALIGNED(16, const xmm_reg,  ff_pb_80)   = { 0x8080808080808080ULL, 
0x8080808080808080ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pb_FE)   = { 0xFEFEFEFEFEFEFEFEULL, 
0xFEFEFEFEFEFEFEFEULL };
+DECLARE_ALIGNED(32, const ymm_reg,  ff_pb_FE)   = { 0xFEFEFEFEFEFEFEFEULL, 
0xFEFEFEFEFEFEFEFEULL,
+0xFEFEFEFEFEFEFEFEULL, 
0xFEFEFEFEFEFEFEFEULL };
 DECLARE_ALIGNED(8,  const uint64_t, ff_pb_FC)   =   0xFCFCFCFCFCFCFCFCULL;
 
 DECLARE_ALIGNED(16, const xmm_reg,  ff_ps_neg)  = { 0x80008000ULL, 
0x80008000ULL };
diff --git a/libavcodec/x86/constants.h b/libavcodec/x86/constants.h
index f989755..8c02864 100644
--- a/libavcodec/x86/constants.h
+++ b/libavcodec/x86/constants.h
@@ -57,7 +57,7 @@ extern const ymm_reg  ff_pb_1;
 extern const ymm_reg  ff_pb_2;
 extern const ymm_reg  ff_pb_3;
 extern const xmm_reg  ff_pb_80;
-extern const xmm_reg  ff_pb_FE;
+extern const ymm_reg  ff_pb_FE;
 extern const uint64_t ff_pb_FC;
 
 extern const xmm_reg  ff_ps_neg;
diff --git a/libavcodec/x86/v210enc.asm b/libavcodec/x86/v210enc.asm
index 859e2d9..e6776a5 100644
--- a/libavcodec/x86/v210enc.asm
+++ b/libavcodec/x86/v210enc.asm
@@ -21,30 +21,30 @@
 
 %include "libavutil/x86/x86util.asm"
 
-SECTION_RODATA
+SECTION_RODATA 32
 
 cextern pw_4
 %define v210_enc_min_10 pw_4
-v210_enc_max_10: times 8 dw 0x3fb
+v210_enc_max_10: times 16 dw 0x3fb
 
-v210_enc_luma_mult_10: dw 4,1,16,4,1,16,0,0
-v210_enc_luma_shuf_10: db -1,0,1,-1,2,3,4,5,-1,6,7,-1,8,9,10,11
+v210_enc_luma_mult_10: times 2 dw 4,1,16,4,1,16,0,0
+v210_enc_luma_shuf_10: times 2 db -1,0,1,-1,2,3,4,5,-1,6,7,-1,8,9,10,11
 
-v210_enc_chroma_mult_10: dw 1,4,16,0,16,1,4,0
-v210_enc_chroma_shuf_10: db 0,1,8,9,-1,2,3,-1,10,11,4,5,-1,12,13,-1
+v210_enc_chroma_mult_10: times 2 dw 1,4,16,0,16,1,4,0
+v210_enc_chroma_shuf_10: times 2 db 0,1,8,9,-1,2,3,-1,10,11,4,5,-1,12,13,-1
 
 cextern pb_1
 %define v210_enc_min_8 pb_1
 cextern pb_FE
 %define v210_enc_max_8 pb_FE
 
-v210_enc_luma_shuf_8: db 6,-1,7,-1,8,-1,9,-1,10,-1,11,-1,-1,-1,-1,-1
-v210_enc_luma_mult_8: dw 16,4,64,16,4,64,0,0
+v210_enc_luma_shuf_8: times 2 db 6,-1,7,-1,8,-1,9,-1,10,-1,11,-1,-1,-1,-1,-1
+v210_enc_luma_mult_8: times 2 dw 16,4,64,16,4,64,0,0
 
-v210_enc_chroma_shuf1_8: db 0,-1,1,-1,2,-1,3,-1,8,-1,9,-1,10,-1,11,-1
-v210_enc_chroma_shuf2_8: db 3,-1,4,-1,5,-1,7,-1,11,-1,12,-1,13,-1,15,-1
+v210_enc_chroma_shuf1_8: times 2 db 

[FFmpeg-devel] [PATCH 4/4] avcodec/v210: document the requirement for sample_factor

2016-01-15 Thread James Darnley
The sample factor must be the same for both 8- and 10-bit functions chosen
otherwise the output will be incorrect.
---
Should I squash this one too?
---
 libavcodec/v210enc.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/v210enc.h b/libavcodec/v210enc.h
index 85f84f1..899a7d9 100644
--- a/libavcodec/v210enc.h
+++ b/libavcodec/v210enc.h
@@ -28,7 +28,8 @@ typedef struct V210EncContext {
 const uint8_t *v, uint8_t *dst, ptrdiff_t width);
 void (*pack_line_10)(const uint16_t *y, const uint16_t *u,
  const uint16_t *v, uint8_t *dst, ptrdiff_t width);
-int sample_factor;
+int sample_factor; /* This value must be the same for both 8-and 10-bit
+  functions otherwise the output will be incorrect. */
 } V210EncContext;
 
 void ff_v210enc_init(V210EncContext *s);
-- 
2.6.2

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


[FFmpeg-devel] [PATCH 3/4] avcodec/v210: add avx2 version of the 10-bit line encoder

2016-01-15 Thread James Darnley
Around 25% faster than the ssse3 version.
---
New patch.  Should I squash this into the previous patch before committing?
---
 libavcodec/v210enc.c  | 11 +--
 libavcodec/x86/constants.c|  3 ++-
 libavcodec/x86/constants.h|  2 +-
 libavcodec/x86/v210enc.asm| 20 +++-
 libavcodec/x86/v210enc_init.c |  4 
 5 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index ec63864..00c89dc 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -135,13 +135,20 @@ static int encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
 const uint16_t *v = (const uint16_t *)pic->data[2];
 for (h = 0; h < avctx->height; h++) {
 uint32_t val;
-w = (avctx->width / 6) * 6;
+w = (avctx->width / (6 * s->sample_factor)) * 6 * s->sample_factor;
 s->pack_line_10(y, u, v, dst, w);
 
 y += w;
 u += w >> 1;
 v += w >> 1;
-dst += (w / 6) * 16;
+dst += (w / (6 * s->sample_factor)) * 16 * s->sample_factor;
+
+for (; w < avctx->width - 5; w += 6) {
+WRITE_PIXELS(u, y, v);
+WRITE_PIXELS(y, u, y);
+WRITE_PIXELS(v, y, u);
+WRITE_PIXELS(y, v, y);
+}
 if (w < avctx->width - 1) {
 WRITE_PIXELS(u, y, v);
 
diff --git a/libavcodec/x86/constants.c b/libavcodec/x86/constants.c
index 7e6883d..11002ee 100644
--- a/libavcodec/x86/constants.c
+++ b/libavcodec/x86/constants.c
@@ -27,7 +27,8 @@ DECLARE_ALIGNED(32, const ymm_reg,  ff_pw_1)= { 
0x0001000100010001ULL, 0x000
 DECLARE_ALIGNED(32, const ymm_reg,  ff_pw_2)= { 0x0002000200020002ULL, 
0x0002000200020002ULL,
 0x0002000200020002ULL, 
0x0002000200020002ULL };
 DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_3)= { 0x0003000300030003ULL, 
0x0003000300030003ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_4)= { 0x0004000400040004ULL, 
0x0004000400040004ULL };
+DECLARE_ALIGNED(32, const ymm_reg,  ff_pw_4)= { 0x0004000400040004ULL, 
0x0004000400040004ULL,
+0x0004000400040004ULL, 
0x0004000400040004ULL };
 DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_5)= { 0x0005000500050005ULL, 
0x0005000500050005ULL };
 DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_8)= { 0x0008000800080008ULL, 
0x0008000800080008ULL };
 DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_9)= { 0x0009000900090009ULL, 
0x0009000900090009ULL };
diff --git a/libavcodec/x86/constants.h b/libavcodec/x86/constants.h
index 8c02864..b82aef9 100644
--- a/libavcodec/x86/constants.h
+++ b/libavcodec/x86/constants.h
@@ -28,7 +28,7 @@
 extern const ymm_reg  ff_pw_1;
 extern const ymm_reg  ff_pw_2;
 extern const xmm_reg  ff_pw_3;
-extern const xmm_reg  ff_pw_4;
+extern const ymm_reg  ff_pw_4;
 extern const xmm_reg  ff_pw_5;
 extern const xmm_reg  ff_pw_8;
 extern const xmm_reg  ff_pw_9;
diff --git a/libavcodec/x86/v210enc.asm b/libavcodec/x86/v210enc.asm
index e6776a5..d74e5ac 100644
--- a/libavcodec/x86/v210enc.asm
+++ b/libavcodec/x86/v210enc.asm
@@ -51,7 +51,7 @@ SECTION .text
 %macro v210_planar_pack_10 0
 
 ; v210_planar_pack_10(const uint16_t *y, const uint16_t *u, const uint16_t *v, 
uint8_t *dst, ptrdiff_t width)
-cglobal v210_planar_pack_10, 5, 5, 4, y, u, v, dst, width
+cglobal v210_planar_pack_10, 5, 5, 4+cpuflag(avx2), y, u, v, dst, width
 lea r0, [yq+2*widthq]
 add uq, widthq
 add vq, widthq
@@ -61,11 +61,19 @@ cglobal v210_planar_pack_10, 5, 5, 4, y, u, v, dst, width
 movam3, [v210_enc_max_10]
 
 .loop:
-movum0, [yq+2*widthq]
+movuxm0, [yq+2*widthq]
+%if cpuflag(avx2)
+vinserti128 m0,   m0, [yq+widthq*2+12], 1
+%endif
 CLIPW   m0, m2, m3
 
-movqm1, [uq+widthq]
-movhps  m1, [vq+widthq]
+movq xm1, [uq+widthq]
+movhps   xm1, [vq+widthq]
+%if cpuflag(avx2)
+movq xm4, [uq+widthq+6]
+movhps   xm4, [vq+widthq+6]
+vinserti128  m1,   m1, xm4, 1
+%endif
 CLIPW   m1, m2, m3
 
 pmullw  m0, [v210_enc_luma_mult_10]
@@ -79,7 +87,7 @@ cglobal v210_planar_pack_10, 5, 5, 4, y, u, v, dst, width
 movu[dstq], m0
 
 add dstq, mmsize
-add widthq, 6
+add widthq, (mmsize*3)/8
 jl .loop
 
 RET
@@ -87,6 +95,8 @@ cglobal v210_planar_pack_10, 5, 5, 4, y, u, v, dst, width
 
 INIT_XMM ssse3
 v210_planar_pack_10
+INIT_YMM avx2
+v210_planar_pack_10
 
 %macro v210_planar_pack_8 0
 
diff --git a/libavcodec/x86/v210enc_init.c b/libavcodec/x86/v210enc_init.c
index be6698c..ee48e80 100644
--- a/libavcodec/x86/v210enc_init.c
+++ b/libavcodec/x86/v210enc_init.c
@@ -29,6 +29,9 @@ void ff_v210_planar_pack_8_avx2(const uint8_t *y, const 
uint8_t *u,
 void ff_v210_planar_pack_10_ssse3(const uint16_t *y, const uint16_t *u,
   const 

[FFmpeg-devel] [PATCH 1/4] fate: add 10-bit v210 encoder tests

2016-01-15 Thread James Darnley
---
Is the name I chose for the 10-bit tests (v210-10) okay?
---
 tests/fate/vcodec.mak| 3 ++-
 tests/ref/vsynth/vsynth1-v210-10 | 4 
 tests/ref/vsynth/vsynth2-v210-10 | 4 
 tests/ref/vsynth/vsynth3-v210-10 | 4 
 tests/ref/vsynth/vsynth_lena-v210-10 | 4 
 5 files changed, 18 insertions(+), 1 deletion(-)
 create mode 100644 tests/ref/vsynth/vsynth1-v210-10
 create mode 100644 tests/ref/vsynth/vsynth2-v210-10
 create mode 100644 tests/ref/vsynth/vsynth3-v210-10
 create mode 100644 tests/ref/vsynth/vsynth_lena-v210-10

diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
index bbaec8a..9ee3043 100644
--- a/tests/fate/vcodec.mak
+++ b/tests/fate/vcodec.mak
@@ -300,7 +300,8 @@ fate-vsynth%-svq1:   FMT = mov
 
 FATE_VCODEC-$(call ENCDEC, R210, AVI)   += r210
 
-FATE_VCODEC-$(call ENCDEC, V210, AVI)   += v210
+FATE_VCODEC-$(call ENCDEC, V210, AVI)   += v210 v210-10
+fate-vsynth%-v210-10:ENCOPTS = -pix_fmt yuv422p10
 
 FATE_VCODEC-$(call ENCDEC, V308, AVI)   += v308
 
diff --git a/tests/ref/vsynth/vsynth1-v210-10 b/tests/ref/vsynth/vsynth1-v210-10
new file mode 100644
index 000..4621b9d
--- /dev/null
+++ b/tests/ref/vsynth/vsynth1-v210-10
@@ -0,0 +1,4 @@
+230bbd31c82d4fbb92d5ea2ac591ded5 *tests/data/fate/vsynth1-v210-10.avi
+14752452 tests/data/fate/vsynth1-v210-10.avi
+50973792d3f1abe04a51ee0121f077f2 *tests/data/fate/vsynth1-v210-10.out.rawvideo
+stddev:1.85 PSNR: 42.78 MAXDIFF:   29 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-v210-10 b/tests/ref/vsynth/vsynth2-v210-10
new file mode 100644
index 000..db38b2f
--- /dev/null
+++ b/tests/ref/vsynth/vsynth2-v210-10
@@ -0,0 +1,4 @@
+02a5d983deb4bc91bb273c2b26c3100f *tests/data/fate/vsynth2-v210-10.avi
+14752452 tests/data/fate/vsynth2-v210-10.avi
+8bb1c449e1a2a94fd0d98841c04246bb *tests/data/fate/vsynth2-v210-10.out.rawvideo
+stddev:0.39 PSNR: 56.17 MAXDIFF:9 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth3-v210-10 b/tests/ref/vsynth/vsynth3-v210-10
new file mode 100644
index 000..1a664af
--- /dev/null
+++ b/tests/ref/vsynth/vsynth3-v210-10
@@ -0,0 +1,4 @@
+b68ad16e3bfd78556b816ec1a676445c *tests/data/fate/vsynth3-v210-10.avi
+224452 tests/data/fate/vsynth3-v210-10.avi
+0cf7cf68724fa5146b1667e4fa08b0e1 *tests/data/fate/vsynth3-v210-10.out.rawvideo
+stddev:2.12 PSNR: 41.58 MAXDIFF:   26 bytes:86700/86700
diff --git a/tests/ref/vsynth/vsynth_lena-v210-10 
b/tests/ref/vsynth/vsynth_lena-v210-10
new file mode 100644
index 000..1e5732b
--- /dev/null
+++ b/tests/ref/vsynth/vsynth_lena-v210-10
@@ -0,0 +1,4 @@
+a3913b719397fae870c1d9bc35053259 *tests/data/fate/vsynth_lena-v210-10.avi
+14752452 tests/data/fate/vsynth_lena-v210-10.avi
+a627fb50c8276200fd71383977d87ca3 
*tests/data/fate/vsynth_lena-v210-10.out.rawvideo
+stddev:0.34 PSNR: 57.43 MAXDIFF:6 bytes:  7603200/  7603200
-- 
2.6.2

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


Re: [FFmpeg-devel] [PATCH] avcodec/h264: mmxext 4:2:2 chroma deblock/loop filter

2016-01-15 Thread James Darnley
On 2016-01-15 04:21, Ronald S. Bultje wrote:
> If you don't need r%dm (looks like you don't, but didn't check
> exhaustively), you can also use a negative stack size (0 - mmsize -
> ARCH_X86_64 * 2 * mmsize), then it will not create a stack pointer.

I am already using r[0-3]m for storage.  (A nice trick from the other
chroma function.)




signature.asc
Description: OpenPGP digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/h264: mmxext 4:2:2 chroma deblock/loop filter

2016-01-15 Thread James Darnley
On 2016-01-15 03:55, James Almer wrote:
> On 1/14/2016 11:05 PM, James Darnley wrote:
>> diff --git a/libavcodec/x86/h264_deblock.asm 
>> b/libavcodec/x86/h264_deblock.asm
>> index 5151f3c..20f0814 100644
>> --- a/libavcodec/x86/h264_deblock.asm
>> +++ b/libavcodec/x86/h264_deblock.asm
>> @@ -864,7 +864,47 @@ ff_chroma_inter_body_mmxext:
>>  DEBLOCK_P0_Q0
>>  ret
>>  
>> +cglobal h264_h_loop_filter_chroma422_8, 5, 7, 8, mmsize + 
>> ARCH_X86_64*2*mmsize
> 
> This will not work with x86_32 compilers that don't have aligned stack (Like 
> msvc)
> because r6 is needed to store the stack pointer.

The other chroma deblock function I borrowed most of this from doesn't
appear to use any guard against that (see a few lines above where my
patch starts).  Neither in assembly or in the init function.

>> +%if ARCH_X86_64
>> +%define buf0 [rsp+16]
>> +%define buf1 [rsp+8]
>> +%else
>> +%define buf0 r0m
>> +%define buf1 r2m
>> +%endif
>> +
>> +movd m6, [r4]
> 
> Since r4 is free after this point, you can use it instead of r6 to easily 
> solve
> the above.

Noted.




signature.asc
Description: OpenPGP digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] feature request: add instructions on the trac upload page for how to upload larger files

2016-01-15 Thread Roger Pack
I know ways exist to "upload" a file larger than 2.5MB.
However many people "at trac upload time" may be unfamiliar with those.
Might be nice to add a link on the trac "upload" page to the
instructions for larger files.  Example page:
https://trac.ffmpeg.org/attachment/ticket/3025/?action=new=Attach+file
Just because its nice to have "instructions" right at the place where
you run into needing them.
Cheers!
-roger-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 3/3] configure: remove libzvbi GPL dependency

2016-01-15 Thread Marton Balint
The COPYING.LIB file in the zvbi source tree as well as libzvbi.h references
the GNU Library General Public License version 2 since version 0.2.28.

Signed-off-by: Marton Balint 
---
 configure| 5 +++--
 doc/general.texi | 6 --
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 450c574..0d35f50 100755
--- a/configure
+++ b/configure
@@ -4851,7 +4851,6 @@ die_license_disabled gpl libx264
 die_license_disabled gpl libx265
 die_license_disabled gpl libxavs
 die_license_disabled gpl libxvid
-die_license_disabled gpl libzvbi
 die_license_disabled gpl x11grab
 
 die_license_disabled nonfree libaacplus
@@ -5537,7 +5536,9 @@ enabled libxavs   && require libxavs xavs.h 
xavs_encoder_encode -lxavs
 enabled libxvid   && require libxvid xvid.h xvid_global -lxvidcore
 enabled libzimg   && require_pkg_config zimg zimg.h 
zimg_get_api_version
 enabled libzmq&& require_pkg_config libzmq zmq.h zmq_ctx_new
-enabled libzvbi   && require libzvbi libzvbi.h vbi_decoder_new -lzvbi
+enabled libzvbi   && require libzvbi libzvbi.h vbi_decoder_new -lzvbi 
&&
+ { check_cpp_condition libzvbi.h 
"VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && 
VBI_VERSION_MICRO >= 28" ||
+   enabled gpl || die "ERROR: libzvbi requires 
version 0.2.28 or --enable-gpl."; }
 enabled mmal  && { check_lib interface/mmal/mmal.h 
mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
 { ! enabled cross_compile && {
 add_cflags -isystem/opt/vc/include/ 
-isystem/opt/vc/include/interface/vmcs_host/linux 
-isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline ;
diff --git a/doc/general.texi b/doc/general.texi
index 06933ab..6f40671 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -173,12 +173,6 @@ Go to @url{http://sourceforge.net/projects/zapping/} and 
follow the instructions
 installing the library. Then pass @code{--enable-libzvbi} to configure to
 enable it.
 
-@float NOTE
-libzvbi is licensed under the GNU General Public License Version 2 or later
-(see @url{http://www.gnu.org/licenses/old-licenses/gpl-2.0.html} for details),
-you must upgrade FFmpeg's license to GPL in order to use it.
-@end float
-
 @section AviSynth
 
 FFmpeg can read AviSynth scripts as input. To enable support, pass
-- 
2.6.2

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


[FFmpeg-devel] libavformat/tcp.c : add send_buffer_size and recv_buffer_size options

2016-01-15 Thread Perette Barella
Attached is a patch to libavformat/tcp.c for your consideration.  It 
adds two new options that may be set via the dictionary:

- send_buffer_size
- recv_buffer_size

When present, setsockopt() is used with SO_SNDBUF and SO_RCVBUF to set 
socket buffer sizes.  I chose to make send and receive independent 
because buffering requirements are often asymmetric.

Errors in setting the buffer size mean the socket will use its 
default, so they are ignored.

There is no sanity checking on values, as the kernel/socket layers 
already impose reasonable limits if asked for something crazy.

Rationale for enlarging receive buffers is to reduce susceptibility 
to intermittent network delays/congestion.  I added setting the send 
buffer for symmetry.

Changes to other lines in the options table were just to align the
columns neatly.

In case the mailing list strips or mangles attachments, the patch
is also at: http://deviousfish.com/Downloads/tcp_c_buffer_size.patch

Thank you.

Perette
--
Perette Barella • pere...@barella.org • 585-286-1312
176 Middlesex Road, Rochester NY 14610




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


Re: [FFmpeg-devel] [PATCH 7/7] avcodec/dca: add native DCA decoder based on libdcadec

2016-01-15 Thread James Almer
On 1/14/2016 1:28 PM, foo86 wrote:
> +static void sumdiff_c(int32_t *v1, int32_t *v2, intptr_t len)
> +{
> +int i;
> +
> +for (i = 0; i < len; i++) {
> +int32_t t = v1[i] - v2[i];
> +v1[i] += v2[i];
> +v2[i] = t;
> +}
> +}

You have AVFixedDSPContext's butterflies for this, just like you used
AVFloatDSPContext's.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCHv3] lavu/x86/lls: add fma3 optimizations for update_lls

2016-01-15 Thread Ganesh Ajjanagadde
On Thu, Jan 14, 2016 at 7:39 PM, Ganesh Ajjanagadde
 wrote:
> This improves accuracy (very slightly) and speed for processors having
> fma3.
>
> Sample benchmark (fate flac-16-lpc-cholesky, Haswell):
> old:
> 5993610 decicycles in ff_lpc_calc_coefs,  64 runs,  0 skips
> 5951528 decicycles in ff_lpc_calc_coefs, 128 runs,  0 skips
>
> new:
> 5252410 decicycles in ff_lpc_calc_coefs,  64 runs,  0 skips
> 5232869 decicycles in ff_lpc_calc_coefs, 128 runs,  0 skips
>
> Tested with FATE and --disable-fma3, also examined contents of
> lavu/lls-test.
>
> Reviewed-by: James Almer 
> Reviewed-by: Henrik Gramner 
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavutil/x86/lls.asm| 59 
> ++--
>  libavutil/x86/lls_init.c |  4 
>  2 files changed, 61 insertions(+), 2 deletions(-)
>
> diff --git a/libavutil/x86/lls.asm b/libavutil/x86/lls.asm
> index 769befb..317fba6 100644
> --- a/libavutil/x86/lls.asm
> +++ b/libavutil/x86/lls.asm
> @@ -125,8 +125,7 @@ cglobal update_lls, 2,5,8, ctx, var, i, j, covar2
>  .ret:
>  REP_RET
>
> -%if HAVE_AVX_EXTERNAL
> -INIT_YMM avx
> +%macro UPDATE_LLS 0
>  cglobal update_lls, 3,6,8, ctx, var, count, i, j, count2
>  %define covarq ctxq
>  mov  countd, [ctxq + LLSModel.indep_count]
> @@ -140,6 +139,18 @@ cglobal update_lls, 3,6,8, ctx, var, count, i, j, count2
>  vbroadcastsd ymm6, [varq + iq*8 + 16]
>  vbroadcastsd ymm7, [varq + iq*8 + 24]
>  vextractf128 xmm3, ymm1, 1
> +%if cpuflag(fma3)
> +mova ymm0, COVAR(iq  ,0)
> +mova xmm2, COVAR(iq+2,2)
> +fmaddpd ymm0, ymm1, ymm4, ymm0
> +fmaddpd xmm2, xmm3, xmm6, xmm2
> +fmaddpd ymm1, ymm5, ymm1, COVAR(iq  ,1)
> +fmaddpd xmm3, xmm7, xmm3, COVAR(iq+2,3)
> +mova COVAR(iq  ,0), ymm0
> +mova COVAR(iq  ,1), ymm1
> +mova COVAR(iq+2,2), xmm2
> +mova COVAR(iq+2,3), xmm3
> +%else
>  vmulpd  ymm0, ymm1, ymm4
>  vmulpd  ymm1, ymm1, ymm5
>  vmulpd  xmm2, xmm3, xmm6
> @@ -148,12 +159,26 @@ cglobal update_lls, 3,6,8, ctx, var, count, i, j, count2
>  ADDPD_MEM COVAR(iq  ,1), ymm1
>  ADDPD_MEM COVAR(iq+2,2), xmm2
>  ADDPD_MEM COVAR(iq+2,3), xmm3
> +%endif ; cpuflag(fma3)
>  lea jd, [iq + 4]
>  cmp jd, count2d
>  jg .skip4x4
>  .loop4x4:
>  ; Compute all 16 pairwise products of a 4x4 block
>  movaymm3, [varq + jq*8]
> +%if cpuflag(fma3)
> +mova ymm0, COVAR(jq, 0)
> +mova ymm1, COVAR(jq, 1)
> +mova ymm2, COVAR(jq, 2)
> +fmaddpd ymm0, ymm3, ymm4, ymm0
> +fmaddpd ymm1, ymm3, ymm5, ymm1
> +fmaddpd ymm2, ymm3, ymm6, ymm2
> +fmaddpd ymm3, ymm7, ymm3, COVAR(jq,3)
> +mova COVAR(jq, 0), ymm0
> +mova COVAR(jq, 1), ymm1
> +mova COVAR(jq, 2), ymm2
> +mova COVAR(jq, 3), ymm3
> +%else
>  vmulpd  ymm0, ymm3, ymm4
>  vmulpd  ymm1, ymm3, ymm5
>  vmulpd  ymm2, ymm3, ymm6
> @@ -162,6 +187,7 @@ cglobal update_lls, 3,6,8, ctx, var, count, i, j, count2
>  ADDPD_MEM COVAR(jq,1), ymm1
>  ADDPD_MEM COVAR(jq,2), ymm2
>  ADDPD_MEM COVAR(jq,3), ymm3
> +%endif ; cpuflag(fma3)
>  add jd, 4
>  cmp jd, count2d
>  jle .loop4x4
> @@ -169,6 +195,19 @@ cglobal update_lls, 3,6,8, ctx, var, count, i, j, count2
>  cmp jd, countd
>  jg .skip2x4
>  movaxmm3, [varq + jq*8]
> +%if cpuflag(fma3)
> +mova xmm0, COVAR(jq, 0)
> +mova xmm1, COVAR(jq, 1)
> +mova xmm2, COVAR(jq, 2)
> +fmaddpd xmm0, xmm3, xmm4, xmm0
> +fmaddpd xmm1, xmm3, xmm5, xmm1
> +fmaddpd xmm2, xmm3, xmm6, xmm2
> +fmaddpd xmm3, xmm7, xmm3, COVAR(jq,3)
> +mova COVAR(jq, 0), xmm0
> +mova COVAR(jq, 1), xmm1
> +mova COVAR(jq, 2), xmm2
> +mova COVAR(jq, 3), xmm3
> +%else
>  vmulpd  xmm0, xmm3, xmm4
>  vmulpd  xmm1, xmm3, xmm5
>  vmulpd  xmm2, xmm3, xmm6
> @@ -177,6 +216,7 @@ cglobal update_lls, 3,6,8, ctx, var, count, i, j, count2
>  ADDPD_MEM COVAR(jq,1), xmm1
>  ADDPD_MEM COVAR(jq,2), xmm2
>  ADDPD_MEM COVAR(jq,3), xmm3
> +%endif ; cpuflag(fma3)
>  .skip2x4:
>  add id, 4
>  add covarq, 4*COVAR_STRIDE
> @@ -187,14 +227,29 @@ cglobal update_lls, 3,6,8, ctx, var, count, i, j, count2
>  mov jd, id
>  .loop2x1:
>  vmovddup xmm0, [varq + iq*8]
> +%if cpuflag(fma3)
> +mova xmm1, [varq + jq*8]
> +fmaddpd xmm0, xmm1, xmm0, COVAR(jq,0)
> +mova COVAR(jq,0), xmm0
> +%else
>  vmulpd   xmm0, [varq + jq*8]
>  ADDPD_MEM COVAR(jq,0), xmm0
> +%endif ; cpuflag(fma3)
>  inc id
>  add covarq, COVAR_STRIDE
>  cmp id, countd
>  jle .loop2x1
>  .ret:
>  REP_RET
> +%endmacro ; UPDATE_LLS
> +
> +%if HAVE_AVX_EXTERNAL
> +INIT_YMM avx
> +UPDATE_LLS
> +%endif
> +%if HAVE_FMA3_EXTERNAL
> +INIT_YMM fma3
> +UPDATE_LLS
>  %endif
>
>  INIT_XMM sse2
> diff --git a/libavutil/x86/lls_init.c b/libavutil/x86/lls_init.c
> index 81f141c..9f0d862 100644
> 

Re: [FFmpeg-devel] [PATCH] avcodec/h264: mmxext 4:2:2 chroma deblock/loop filter

2016-01-15 Thread James Darnley
On 2016-01-15 21:55, James Almer wrote:
> On 1/15/2016 5:00 PM, James Darnley wrote:
>> On 2016-01-15 03:55, James Almer wrote:
>>> On 1/14/2016 11:05 PM, James Darnley wrote:
 diff --git a/libavcodec/x86/h264_deblock.asm 
 b/libavcodec/x86/h264_deblock.asm
 index 5151f3c..20f0814 100644
 --- a/libavcodec/x86/h264_deblock.asm
 +++ b/libavcodec/x86/h264_deblock.asm
 @@ -864,7 +864,47 @@ ff_chroma_inter_body_mmxext:
  DEBLOCK_P0_Q0
  ret
  
 +cglobal h264_h_loop_filter_chroma422_8, 5, 7, 8, mmsize + 
 ARCH_X86_64*2*mmsize
>>>
>>> This will not work with x86_32 compilers that don't have aligned stack 
>>> (Like msvc)
>>> because r6 is needed to store the stack pointer.
>>
>> The other chroma deblock function I borrowed most of this from doesn't
>> appear to use any guard against that (see a few lines above where my
>> patch starts).  Neither in assembly or in the init function.
> 
> That's because the other chroma function doesn't allocate stack using x86inc 
> magic.
> On x86_32 it uses r#m only and on x86_64 it handles the stack pointer by 
> itself.

I don't understand how that works then.  It calls the cglobal macro.
Does that not just assume missing args are 0?  I'd better look and
follow that more closely.




signature.asc
Description: OpenPGP digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] feature request: add instructions on the trac upload page for how to upload larger files

2016-01-15 Thread Michael Niedermayer
On Fri, Jan 15, 2016 at 02:00:19PM -0700, Roger Pack wrote:
> I know ways exist to "upload" a file larger than 2.5MB.
> However many people "at trac upload time" may be unfamiliar with those.
> Might be nice to add a link on the trac "upload" page to the
> instructions for larger files.  Example page:
> https://trac.ffmpeg.org/attachment/ticket/3025/?action=new=Attach+file
> Just because its nice to have "instructions" right at the place where
> you run into needing them.
> Cheers!

i dont know what needs to be edited to achive that but i can apply a
patch if someone posts one assuming thats how its supposed to be
changed 

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3] lavf/matroskadec: Set A_QUICKTIME bit depth

2016-01-15 Thread Mats Peterson

On 01/15/2016 01:06 PM, Mats Peterson wrote:

FFmpeg curiously uses 'sowt' as the fourcc when writing 8-bit signed
QuickTime data, so cater for this as well. Description follows:

Since mkvmerge doesn't set the bit depth for A_QUICKTIME audio (as far
as I know), the track->audio.bitdepth variable will be zero, and its
value needs to be retrieved from the sound sample description. Also,
confine the 0x to 'raw '/'twos' fourcc mapping to old version 0
sound sample descriptions, since they are the only valid sample
descriptions for this type of mapping.

Also, 'twos' and 'sowt' audio can be signed 8-bit.



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



PLEASE WAIT WITH THIS ONE. I have another one coming.

Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavf/matroskadec: Get sample size from private data

2016-01-15 Thread Mats Peterson
Since track->audio.bitdepth is zero for A_QUICKTIME, the sample size has 
to be retrieved from the private data. Also, 'twos' and 'sowt' audio can 
be signed 8-bit.


Mats
>From dbddf5d5fba7992e52bb25db214e7b4debfb8023 Mon Sep 17 00:00:00 2001
From: Mats Peterson 
Date: Fri, 15 Jan 2016 23:25:38 +0100
Subject: [PATCH] lavf/matroskadec: Get sample size from private data

---
 libavformat/matroskadec.c |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index cc5ec19..d788232 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1891,18 +1891,24 @@ static int matroska_parse_tracks(AVFormatContext *s)
/* Normally 36, but allow noncompliant private data */
&& (track->codec_priv.size >= 32)
&& (track->codec_priv.data)) {
+uint16_t sample_size;
 int ret = get_qt_codec(track, , _id);
 if (ret < 0)
 return ret;
+sample_size = AV_RB16(track->codec_priv.data + 26);
 if (fourcc == 0) {
-if (track->audio.bitdepth == 8) {
+if (sample_size == 8) {
 fourcc = MKTAG('r','a','w',' ');
 codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
-} else if (track->audio.bitdepth == 16) {
+} else if (sample_size == 16) {
 fourcc = MKTAG('t','w','o','s');
 codec_id = ff_codec_get_id(ff_codec_movaudio_tags, fourcc);
 }
 }
+if ((fourcc == MKTAG('t','w','o','s') ||
+fourcc == MKTAG('s','o','w','t')) &&
+sample_size == 8)
+codec_id = AV_CODEC_ID_PCM_S8;
 } else if (!strcmp(track->codec_id, "V_QUICKTIME") &&
(track->codec_priv.size >= 21)  &&
(track->codec_priv.data)) {
-- 
1.7.10.4

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


[FFmpeg-devel] [PATCH] lavf/mov: Don't limit fourcc 0 -> raw/twos to version 0 sample descriptions

2016-01-15 Thread Mats Peterson
I had the notion that the fourcc 0x to raw/twos mapping was only 
valid for version 0 sound sample descriptions. However, the 
documentation is quite foggy regarding this subject, so it's better to 
do this mapping regardless of sample description version.


Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
>From 9e3354877146b29a30810a886342145c74d1a7bd Mon Sep 17 00:00:00 2001
From: Mats Peterson 
Date: Fri, 15 Jan 2016 23:28:06 +0100
Subject: [PATCH] lavf/mov: Don't limit fourcc 0 -> raw/twos to version 0 sample descriptions

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4cc5ff2..98c2f51 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1863,7 +1863,7 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
 }
 }
 
-if (version == 0 && sc->format == 0) {
+if (sc->format == 0) {
 if (st->codec->bits_per_coded_sample == 8)
 st->codec->codec_id = mov_codec_id(st, MKTAG('r','a','w',' '));
 else if (st->codec->bits_per_coded_sample == 16)
-- 
1.7.10.4

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


Re: [FFmpeg-devel] [PATCH] lavf/mov: add support for sidx fragment indexes

2016-01-15 Thread Michael Niedermayer
On Fri, Jan 15, 2016 at 10:24:43PM +, Dan Sanders wrote:
> Michael, I wanted to check if you have you looked into this playback issue,
> or were planning to?

i didnt look into it, i had thought rodger would look into it as it
was his patch ...

rodger, did you look into this ?

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] libavformat/tcp.c : add send_buffer_size and recv_buffer_size options

2016-01-15 Thread Michael Niedermayer
On Fri, Jan 15, 2016 at 04:40:38PM -0500, Perette Barella wrote:
> Attached is a patch

no, theres no patch


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] define AVPixelFormat aliases as enumerators instead of macros

2016-01-15 Thread Jean-Yves Avenard
On 15 January 2016 at 18:51, wm4  wrote:
> API users might check for the existence of such pixfmts with #ifdef,
> and I don't understand the reasoning behind your patch. Why would
> external projects redefine these macros?

All other pixfmts are already enums, why the discrepency ?
Having everything an enum seems much cleaner to me IMHO.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] News entry for FFmpeg 2.8.5, 2.7.5, 2.6.7, 2.5.10

2016-01-15 Thread Michael Niedermayer
On Sat, Jan 16, 2016 at 03:15:44AM +0100, Michael Niedermayer wrote:
> From: Michael Niedermayer 
> 
> ---
>  src/index |   14 ++
>  1 file changed, 14 insertions(+)

btw, i soon go to bed, so dont hesitate to push while iam sleeping if
it LGTY

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libkvazaar: Set frame rate as a rational number

2016-01-15 Thread Michael Niedermayer
On Fri, Jan 15, 2016 at 03:42:29PM +0200, Arttu Ylä-Outinen wrote:
> Updates libkvazaar to pass the exact frame rate to Kvazaar by setting
> the numerator and denominator separately instead of a single floating
> point number. The exact frame rate is needed for writing timing info to
> the bitstream.
> 
> Requires Kvazaar version 0.8.1.
> 
> Signed-off-by: Arttu Ylä-Outinen 
> ---
>  configure   | 2 +-
>  libavcodec/libkvazaar.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index 7cef6f5..1b004db 100755
> --- a/configure
> +++ b/configure
> @@ -5452,7 +5452,7 @@ enabled libgsm&& { for gsm_hdr in "gsm.h" 
> "gsm/gsm.h"; do
> check_lib "${gsm_hdr}" gsm_create -lgsm 
> && break;
> done || die "ERROR: libgsm not found"; }
>  enabled libilbc   && require libilbc ilbc.h WebRtcIlbcfix_InitDecode 
> -lilbc
> -enabled libkvazaar&& require_pkg_config "kvazaar >= 0.7.1" kvazaar.h 
> kvz_api_get
> +enabled libkvazaar&& require_pkg_config "kvazaar >= 0.8.1" kvazaar.h 
> kvz_api_get
>  enabled libmfx&& require_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
> diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
> index e58405d..87b802f 100644
> --- a/libavcodec/libkvazaar.c
> +++ b/libavcodec/libkvazaar.c
> @@ -75,8 +75,8 @@ static av_cold int libkvazaar_init(AVCodecContext *avctx)
>  cfg->width  = avctx->width;
>  cfg->height = avctx->height;
>  
> -cfg->framerate =
> -  avctx->time_base.den / (double)(avctx->time_base.num * 
> avctx->ticks_per_frame);
> +cfg->framerate_num   = avctx->time_base.den;
> +cfg->framerate_denom = avctx->time_base.num * avctx->ticks_per_frame;

its probably rather unlikely but the multiplication could overflow

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/4] fate: add 10-bit v210 encoder tests

2016-01-15 Thread Michael Niedermayer
On Fri, Jan 15, 2016 at 08:07:13PM +0100, James Darnley wrote:
> ---
> Is the name I chose for the 10-bit tests (v210-10) okay?

sure

and patch seems working here so should be ok

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] build: make out-of-tree builds bit-identical to in-tree builds

2016-01-15 Thread Michael Niedermayer
On Mon, Dec 28, 2015 at 10:12:56PM +0100, Andreas Cadhalpun wrote:
> Previously the full source path was embedded inconsistently in the debug
> information between in-tree/out-of-tree builds.
> 
> The 'vpath %.inc' becomes necessary for finding
> libavfilter/all_channel_layouts.inc in out-of-tree builds.
> 
> The full source path is still embedded in the debug information, but
> it's now independent of whether building in-tree or out-of-tree.
> 
> The biggest improvement of this patch is that gdb now always searches
> for the path relative to the source directory. It still also searches
> for the full path.
> Previously it searched only for the full path in out-of-tree builds,
> making the debug information generated by Debian's buildds rather hard
> to use.

i am in favor of this being fixed, and the patch seems to work here
iam no makefile expert though ...

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavf/matroskadec: Get sample size from private data

2016-01-15 Thread Mats Peterson

On 01/15/2016 11:31 PM, Mats Peterson wrote:

Since track->audio.bitdepth is zero for A_QUICKTIME


When parsing files created with mkvmerge, that is.

Mats

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


[FFmpeg-devel] [PATCH] News entry for FFmpeg 2.8.5, 2.7.5, 2.6.7, 2.5.10

2016-01-15 Thread Michael Niedermayer
From: Michael Niedermayer 

---
 src/index |   14 ++
 1 file changed, 14 insertions(+)

diff --git a/src/index b/src/index
index 554ad0e..56a7956 100644
--- a/src/index
+++ b/src/index
@@ -37,6 +37,20 @@
 News
   
 
+  January 16, 2015, FFmpeg 2.8.5, 2.7.5, 2.6.7, 2.5.10
+  
+We have made several new point releases (2.8.5,
+  2.7.5,
+  2.6.7,
+  2.5.10).
+They fix various bugs, as well as CVE-2016-1897 and CVE-2016-1898.
+Please see the changelog for more details.
+  
+  
+We recommend users, distributors and system integrators to upgrade unless 
they use
+current git master.
+  
+
   December 5th, 2015, The native FFmpeg AAC 
encoder is now stable!
   
 After seven years the native FFmpeg AAC encoder has had its experimental 
flag
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH] avcodec/h264: mmxext 4:2:2 chroma deblock/loop filter

2016-01-15 Thread Ronald S. Bultje
Hi,

On Fri, Jan 15, 2016 at 4:47 PM, James Darnley 
wrote:

> On 2016-01-15 21:55, James Almer wrote:
> > On 1/15/2016 5:00 PM, James Darnley wrote:
> >> On 2016-01-15 03:55, James Almer wrote:
> >>> On 1/14/2016 11:05 PM, James Darnley wrote:
>  diff --git a/libavcodec/x86/h264_deblock.asm
> b/libavcodec/x86/h264_deblock.asm
>  index 5151f3c..20f0814 100644
>  --- a/libavcodec/x86/h264_deblock.asm
>  +++ b/libavcodec/x86/h264_deblock.asm
>  @@ -864,7 +864,47 @@ ff_chroma_inter_body_mmxext:
>   DEBLOCK_P0_Q0
>   ret
> 
>  +cglobal h264_h_loop_filter_chroma422_8, 5, 7, 8, mmsize +
> ARCH_X86_64*2*mmsize
> >>>
> >>> This will not work with x86_32 compilers that don't have aligned stack
> (Like msvc)
> >>> because r6 is needed to store the stack pointer.
> >>
> >> The other chroma deblock function I borrowed most of this from doesn't
> >> appear to use any guard against that (see a few lines above where my
> >> patch starts).  Neither in assembly or in the init function.
> >
> > That's because the other chroma function doesn't allocate stack using
> x86inc magic.
> > On x86_32 it uses r#m only and on x86_64 it handles the stack pointer by
> itself.
>
> I don't understand how that works then.  It calls the cglobal macro.
> Does that not just assume missing args are 0?  I'd better look and
> follow that more closely.


Yes, it uses %ifnum on %4. If it's a number, it takes it as stack mem, else
it takes it as name of first function argument.

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


Re: [FFmpeg-devel] [PATCH 2/3] lavc/opus_celt: replace pow(2, x) by exp2f(x)

2016-01-15 Thread Michael Niedermayer
On Fri, Jan 15, 2016 at 02:01:11PM -0500, Ganesh Ajjanagadde wrote:
> Faster methods possible; since exponent is always a multiple of 1/8.
> 
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/opus_celt.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

should be ok

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] lavc/atrac3plusdsp: change pow(2, x) to exp2f(x)

2016-01-15 Thread Michael Niedermayer
On Fri, Jan 15, 2016 at 02:01:10PM -0500, Ganesh Ajjanagadde wrote:
> Much faster generation possible; but array is small so don't want to bloat
> the binary.
> 
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/atrac3plusdsp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

LGTM

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] fate: add fixed-dsp test

2016-01-15 Thread James Almer
Adapted from float-dsp

Signed-off-by: James Almer 
---
 libavutil/Makefile   |   1 +
 libavutil/fixed_dsp.c| 249 +++
 tests/fate/libavutil.mak |   6 ++
 3 files changed, 256 insertions(+)

diff --git a/libavutil/Makefile b/libavutil/Makefile
index bf8c713..e8c0614 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -174,6 +174,7 @@ TESTPROGS = adler32 
\
 eval\
 file\
 fifo\
+fixed_dsp   \
 float_dsp   \
 hmac\
 lfg \
diff --git a/libavutil/fixed_dsp.c b/libavutil/fixed_dsp.c
index 8c01858..e0460e1 100644
--- a/libavutil/fixed_dsp.c
+++ b/libavutil/fixed_dsp.c
@@ -165,3 +165,252 @@ AVFixedDSPContext * avpriv_alloc_fixed_dsp(int bit_exact)
 
 return fdsp;
 }
+
+#ifdef TEST
+
+#include 
+#include 
+#include 
+#if HAVE_UNISTD_H
+#include  /* for getopt */
+#endif
+#if !HAVE_GETOPT
+#include "compat/getopt.c"
+#endif
+
+#include "common.h"
+#include "cpu.h"
+#include "internal.h"
+#include "lfg.h"
+#include "log.h"
+#include "random_seed.h"
+
+#define LEN 240
+
+static void fill_array(AVLFG *lfg, int *a, int len)
+{
+int i;
+
+for (i = 0; i < len; i += 2) {
+a[i] = sign_extend(av_lfg_get(lfg), 24);
+a[i + 1] = sign_extend(av_lfg_get(lfg), 24);
+}
+}
+
+static int compare_int16(const int16_t *a, const int16_t *b, int len)
+{
+int i;
+for (i = 0; i < len; i++) {
+if (a[i] != b[i]) {
+av_log(NULL, AV_LOG_ERROR, "%d: %"PRId16" != %"PRId16"\n", i, 
a[i], b[i]);
+return -1;
+}
+}
+return 0;
+}
+
+static int compare_int(const int *a, const int *b, int len)
+{
+int i;
+for (i = 0; i < len; i++) {
+if (a[i] != b[i]) {
+av_log(NULL, AV_LOG_ERROR, "%d: %d != %d\n", i, a[i], b[i]);
+return -1;
+}
+}
+return 0;
+}
+
+static int test_vector_fmul(AVFixedDSPContext *fdsp, AVFixedDSPContext *cdsp,
+const int *v1, const int *v2)
+{
+LOCAL_ALIGNED(32, int, cdst, [LEN]);
+LOCAL_ALIGNED(32, int, odst, [LEN]);
+int ret;
+
+cdsp->vector_fmul(cdst, v1, v2, LEN);
+fdsp->vector_fmul(odst, v1, v2, LEN);
+
+if (ret = compare_int(cdst, odst, LEN))
+av_log(NULL, AV_LOG_ERROR, "vector_fmul failed\n");
+
+return ret;
+}
+
+static int test_vector_fmul_window_scaled(AVFixedDSPContext *fdsp, 
AVFixedDSPContext *cdsp,
+  const int32_t *v1, const int32_t 
*v2, const int32_t *v3)
+{
+LOCAL_ALIGNED(32, int16_t, cdst, [LEN]);
+LOCAL_ALIGNED(32, int16_t, odst, [LEN]);
+int ret;
+
+cdsp->vector_fmul_window_scaled(cdst, v1, v2, v3, LEN / 2, 2);
+fdsp->vector_fmul_window_scaled(odst, v1, v2, v3, LEN / 2, 2);
+
+if (ret = compare_int16(cdst, odst, LEN))
+av_log(NULL, AV_LOG_ERROR, "vector_fmul_window_scaled failed\n");
+
+return ret;
+}
+
+static int test_vector_fmul_window(AVFixedDSPContext *fdsp, AVFixedDSPContext 
*cdsp,
+   const int32_t *v1, const int32_t *v2, const 
int32_t *v3)
+{
+LOCAL_ALIGNED(32, int32_t, cdst, [LEN]);
+LOCAL_ALIGNED(32, int32_t, odst, [LEN]);
+int ret;
+
+cdsp->vector_fmul_window(cdst, v1, v2, v3, LEN / 2);
+fdsp->vector_fmul_window(odst, v1, v2, v3, LEN / 2);
+
+if (ret = compare_int(cdst, odst, LEN))
+av_log(NULL, AV_LOG_ERROR, "vector_fmul_window failed\n");
+
+return ret;
+}
+
+static int test_vector_fmul_add(AVFixedDSPContext *fdsp, AVFixedDSPContext 
*cdsp,
+const int *v1, const int *v2, const int *v3)
+{
+LOCAL_ALIGNED(32, int, cdst, [LEN]);
+LOCAL_ALIGNED(32, int, odst, [LEN]);
+int ret;
+
+cdsp->vector_fmul_add(cdst, v1, v2, v3, LEN);
+fdsp->vector_fmul_add(odst, v1, v2, v3, LEN);
+
+if (ret = compare_int(cdst, odst, LEN))
+av_log(NULL, AV_LOG_ERROR, "vector_fmul_add failed\n");
+
+return ret;
+}
+
+static int test_vector_fmul_reverse(AVFixedDSPContext *fdsp, AVFixedDSPContext 
*cdsp,
+const int *v1, const int *v2)
+{
+LOCAL_ALIGNED(32, int, cdst, [LEN]);
+LOCAL_ALIGNED(32, int, odst, [LEN]);
+int ret;
+
+cdsp->vector_fmul_reverse(cdst, v1, v2, LEN);
+fdsp->vector_fmul_reverse(odst, v1, v2, LEN);
+
+if (ret = compare_int(cdst, odst, LEN))
+av_log(NULL, AV_LOG_ERROR, "vector_fmul_reverse failed\n");
+
+return ret;
+}
+
+static int 

[FFmpeg-devel] [PATCH 1/2] x86/fixed_dsp: add ff_butterflies_fixed_sse2

2016-01-15 Thread James Almer
Signed-off-by: James Almer 
---
 libavutil/fixed_dsp.c  |  3 +++
 libavutil/fixed_dsp.h  |  2 ++
 libavutil/x86/Makefile |  2 ++
 libavutil/x86/fixed_dsp.asm| 48 ++
 libavutil/x86/fixed_dsp_init.c | 35 ++
 5 files changed, 90 insertions(+)
 create mode 100644 libavutil/x86/fixed_dsp.asm
 create mode 100644 libavutil/x86/fixed_dsp_init.c

diff --git a/libavutil/fixed_dsp.c b/libavutil/fixed_dsp.c
index c2f270d..8c01858 100644
--- a/libavutil/fixed_dsp.c
+++ b/libavutil/fixed_dsp.c
@@ -160,5 +160,8 @@ AVFixedDSPContext * avpriv_alloc_fixed_dsp(int bit_exact)
 fdsp->butterflies_fixed = butterflies_fixed_c;
 fdsp->scalarproduct_fixed = scalarproduct_fixed_c;
 
+if (ARCH_X86)
+ff_fixed_dsp_init_x86(fdsp);
+
 return fdsp;
 }
diff --git a/libavutil/fixed_dsp.h b/libavutil/fixed_dsp.h
index 03987ad..f554cb5 100644
--- a/libavutil/fixed_dsp.h
+++ b/libavutil/fixed_dsp.h
@@ -161,6 +161,8 @@ typedef struct AVFixedDSPContext {
  */
 AVFixedDSPContext * avpriv_alloc_fixed_dsp(int strict);
 
+void ff_fixed_dsp_init_x86(AVFixedDSPContext *fdsp);
+
 /**
  * Calculate the square root
  *
diff --git a/libavutil/x86/Makefile b/libavutil/x86/Makefile
index eb70a62..94d8832 100644
--- a/libavutil/x86/Makefile
+++ b/libavutil/x86/Makefile
@@ -1,4 +1,5 @@
 OBJS += x86/cpu.o   \
+x86/fixed_dsp_init.o\
 x86/float_dsp_init.o\
 x86/lls_init.o  \
 
@@ -8,6 +9,7 @@ 
EMMS_OBJS_$(HAVE_MMX_INLINE)_$(HAVE_MMX_EXTERNAL)_$(HAVE_MM_EMPTY) = x86/emms.o
 
 YASM-OBJS += x86/cpuid.o\
  $(EMMS_OBJS__yes_)  \
+ x86/fixed_dsp.o\
  x86/float_dsp.o\
  x86/lls.o  \
 
diff --git a/libavutil/x86/fixed_dsp.asm b/libavutil/x86/fixed_dsp.asm
new file mode 100644
index 000..979dd5c
--- /dev/null
+++ b/libavutil/x86/fixed_dsp.asm
@@ -0,0 +1,48 @@
+;*
+;* x86-optimized Float DSP functions
+;*
+;* Copyright 2016 James Almer
+;*
+;* 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 "x86util.asm"
+
+SECTION .text
+
+;-
+; void ff_butterflies_fixed(float *src0, float *src1, int len);
+;-
+INIT_XMM sse2
+cglobal butterflies_fixed, 3,3,3, src0, src1, len
+shl   lend, 2
+add  src0q, lenq
+add  src1q, lenq
+neg   lenq
+
+align 16
+.loop:
+movam0, [src0q + lenq]
+movam1, [src1q + lenq]
+movam2, m0
+paddd   m0, m1
+psubd   m2, m1
+mova[src0q + lenq], m0
+mova[src1q + lenq], m2
+add   lenq, mmsize
+jl .loop
+RET
diff --git a/libavutil/x86/fixed_dsp_init.c b/libavutil/x86/fixed_dsp_init.c
new file mode 100644
index 000..303a2eb
--- /dev/null
+++ b/libavutil/x86/fixed_dsp_init.c
@@ -0,0 +1,35 @@
+/*
+ * 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, 

Re: [FFmpeg-devel] [PATCH] News entry for FFmpeg 2.8.5, 2.7.5, 2.6.7, 2.5.10

2016-01-15 Thread Ganesh Ajjanagadde
On Fri, Jan 15, 2016 at 9:15 PM, Michael Niedermayer  wrote:
> From: Michael Niedermayer 
>
> ---
>  src/index |   14 ++
>  1 file changed, 14 insertions(+)
>
> diff --git a/src/index b/src/index
> index 554ad0e..56a7956 100644
> --- a/src/index
> +++ b/src/index
> @@ -37,6 +37,20 @@
>  News
>
>
> +  January 16, 2015, FFmpeg 2.8.5, 2.7.5, 2.6.7, 2.5.10
> +  
> +We have made several new point releases ( href="download.html#release_2.8">2.8.5,
> +  2.7.5,
> +  2.6.7,
> +  2.5.10).
> +They fix various bugs, as well as CVE-2016-1897 and CVE-2016-1898.
> +Please see the changelog for more details.

Super minor, but filename is Changelog, and/or it can be ref'ed like
in the 2.8 major entry.

> +  
> +  
> +We recommend users, distributors and system integrators to upgrade 
> unless they use
> +current git master.
> +  
> +
>December 5th, 2015, The native FFmpeg AAC 
> encoder is now stable!
>
>  After seven years the native FFmpeg AAC encoder has had its experimental 
> flag
> --
> 1.7.9.5
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] mpeg4videodec: silence ubsan warning

2016-01-15 Thread Andreas Cadhalpun
On 15.01.2016 03:17, Michael Niedermayer wrote:
> On Fri, Jan 15, 2016 at 12:30:28AM +0100, Andreas Cadhalpun wrote:
>> s->ac_val[0][0] is of type 'int16_t [16]', but points into a larger buffer.
>> Here it is used as base pointer to find the correct position in the
>> larger buffer by adding 's->block_index[n] * 16' and thus as 'int16_t *'.
>>
>> This fixes clang's ubsan runtime error: index out of bounds for type
>> 'int16_t [16]'
>>
>> Fixes: test_case.mp4
>>
>> Found-by: Tyson Smith 
>> Signed-off-by: Andreas Cadhalpun 
> 
> LGTM

Pushed.

Best regards,
Andreas

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


Re: [FFmpeg-devel] libavformat/tcp.c : add send_buffer_size and recv_buffer_size options

2016-01-15 Thread Perette Barella
On 2016年01月15日, at 18:42, Michael Niedermayer  wrote:
> no, theres no patch


Trying again, including it inline below:

--- tcp.c   2015-12-19 21:07:51.0 -0500
+++ /Users/perette/Desktop/tcp.c2016-01-15 16:09:03.0 -0500
@@ -37,19 +37,23 @@
 int fd;
 int listen;
 int open_timeout;
 int rw_timeout;
 int listen_timeout;
+int recv_buffer_size;
+int send_buffer_size;
 } TCPContext;
 
 #define OFFSET(x) offsetof(TCPContext, x)
 #define D AV_OPT_FLAG_DECODING_PARAM
 #define E AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
-{ "listen",  "Listen for incoming connections",  OFFSET(listen),   
  AV_OPT_TYPE_INT, { .i64 = 0 }, 0,   2,   .flags = D|E },
-{ "timeout", "set timeout (in microseconds) of socket I/O operations", 
OFFSET(rw_timeout), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, 
.flags = D|E },
-{ "listen_timeout",  "Connection awaiting timeout (in milliseconds)",  
OFFSET(listen_timeout), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, 
.flags = D|E },
+{ "listen",   "Listen for incoming connections",   
OFFSET(listen),   AV_OPT_TYPE_INT, { .i64 = 0 },   0,   2, 
.flags = D|E },
+{ "timeout", "set timeout (in microseconds) of socket I/O operations", 
OFFSET(rw_timeout),   AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, 
.flags = D|E },
+{ "listen_timeout",   "Connection awaiting timeout (in milliseconds)", 
OFFSET(listen_timeout),   AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, 
.flags = D|E },
+{ "send_buffer_size", "Socket send buffer size (in bytes)",
OFFSET(send_buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, 
.flags = D|E },
+{ "recv_buffer_size", "Socket receive buffer size (in bytes)", 
OFFSET(recv_buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, 
.flags = D|E },
 { NULL }
 };
 
 static const AVClass tcp_class = {
 .class_name = "tcp",
@@ -148,10 +152,19 @@
 }
 }
 
 h->is_streamed = 1;
 s->fd = fd;
+/* Set the socket's send or receive buffer sizes, if specified.
+   If unspecified or setting fails, system default is used. */
+if (s->recv_buffer_size > 0) {
+   setsockopt (fd, SOL_SOCKET, SO_RCVBUF, >recv_buffer_size, sizeof 
(s->recv_buffer_size));
+}
+if (s->send_buffer_size > 0) {
+   setsockopt (fd, SOL_SOCKET, SO_RCVBUF, >send_buffer_size, sizeof 
(s->send_buffer_size));
+}
+
 freeaddrinfo(ai);
 return 0;
 
  fail:
 if (cur_ai->ai_next) {

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


Re: [FFmpeg-devel] [PATCH] lavf/mov: add support for sidx fragment indexes

2016-01-15 Thread Dan Sanders
Michael, I wanted to check if you have you looked into this playback issue,
or were planning to?

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


Re: [FFmpeg-devel] [PATCH] define AVPixelFormat aliases as enumerators instead of macros

2016-01-15 Thread Richard Smith
On Fri Jan 15 08:51:07 CET 2016 wm4  wrote;
> On Thu, 14 Jan 2016 13:58:14 -0800 Richard Smith  
> wrote:
> > libavutil/pixfmt.h defines a collection of endian-specific pixel formats as
> > macros. These macro names can cause conflicts with external projects that
> > use those identifiers for their own purposes. Here's a patch to define
> > these aliases as enumerators instead of macros, please consider merging:
> >
> >
> > https://github.com/zygoloid/FFmpeg/commit/c20a0e2e66e52c45b9193bc750165b7ecf7f3ca4
> >
> > (Note that AV_PIX_FMT_Y400A was already defined as an enumerator in the
> > PixelFormat enumeration, so I deleted its (no-op) macro entirely.)
>
> API users might check for the existence of such pixfmts with #ifdef,

That would be a very odd thing for them to do, as most pixfmts do not
have #defines.

> and I don't understand the reasoning behind your patch. Why would
> external projects redefine these macros?

The project in question has its own enumeration:

namespace MyProject {
  enum PixelFormatToUse {
// ... some other values ...
AV_PIX_FMT_RGB32, // use ffmpeg's AV_PIX_FMT_RGB32
// ...
  };
}

The names are intentionally chosen to be in 1-1 correspondence with
ffmpeg's names. But ffmpeg's macro sometimes renames this project's
enumerator, depending on whether its header is included before that
file.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] remove the deprecated avpicture_get_size() function

2016-01-15 Thread Eddie Hao
---
 libavcodec/avcodec.h | 6 --
 libavcodec/avpicture.c   | 5 -
 libavcodec/libutvideodec.cpp | 3 ++-
 libavcodec/libutvideoenc.cpp | 3 ++-
 libavdevice/decklink_dec.cpp | 2 +-
 libavdevice/lavfi.c  | 3 ++-
 libavformat/frmdec.c | 3 ++-
 7 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index f365775..6fab787 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -4908,12 +4908,6 @@ int avpicture_layout(const AVPicture *src, enum 
AVPixelFormat pix_fmt,
  unsigned char *dest, int dest_size);
 
 /**
- * @deprecated use av_image_get_buffer_size() instead.
- */
-attribute_deprecated
-int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
-
-/**
  * @deprecated av_image_copy() instead.
  */
 attribute_deprecated
diff --git a/libavcodec/avpicture.c b/libavcodec/avpicture.c
index 56435f4..c312113 100644
--- a/libavcodec/avpicture.c
+++ b/libavcodec/avpicture.c
@@ -49,11 +49,6 @@ int avpicture_layout(const AVPicture* src, enum 
AVPixelFormat pix_fmt, int width
pix_fmt, width, height, 1);
 }
 
-int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
-{
-return av_image_get_buffer_size(pix_fmt, width, height, 1);
-}
-
 int avpicture_alloc(AVPicture *picture,
 enum AVPixelFormat pix_fmt, int width, int height)
 {
diff --git a/libavcodec/libutvideodec.cpp b/libavcodec/libutvideodec.cpp
index 47261a6..7c60f4f 100644
--- a/libavcodec/libutvideodec.cpp
+++ b/libavcodec/libutvideodec.cpp
@@ -27,6 +27,7 @@
 
 extern "C" {
 #include "avcodec.h"
+#include "libavutil/imgutils.h"
 }
 
 #include "libutvideo.h"
@@ -93,7 +94,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
 }
 
 /* Only allocate the buffer once */
-utv->buf_size = avpicture_get_size(avctx->pix_fmt, avctx->width, 
avctx->height);
+utv->buf_size = av_image_get_buffer_size(avctx->pix_fmt, avctx->width, 
avctx->height, 1);
 #ifdef UTVF_UQY2
 if (format == UTVF_v210)
 utv->buf_size += avctx->height * ((avctx->width + 47) / 48) * 128; // 
the linesize used by the decoder, this does not seem to be exported
diff --git a/libavcodec/libutvideoenc.cpp b/libavcodec/libutvideoenc.cpp
index 8746247..96d8fe1 100644
--- a/libavcodec/libutvideoenc.cpp
+++ b/libavcodec/libutvideoenc.cpp
@@ -27,6 +27,7 @@
 
 extern "C" {
 #include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
 #include "avcodec.h"
 #include "internal.h"
 }
@@ -94,7 +95,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
  * We use this buffer to hold the data that Ut Video returns,
  * since we cannot decode planes separately with it.
  */
-ret = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
+ret = av_image_get_buffer_size(avctx->pix_fmt, avctx->width, 
avctx->height, 1);
 if (ret < 0) {
 av_free(info);
 return ret;
diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 89f93de..6c5bc5d 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -473,7 +473,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
 
 st->codec->time_base.den  = ctx->bmd_tb_den;
 st->codec->time_base.num  = ctx->bmd_tb_num;
-st->codec->bit_rate= avpicture_get_size(st->codec->pix_fmt, 
ctx->bmd_width, ctx->bmd_height) * 1/av_q2d(st->codec->time_base) * 8;
+st->codec->bit_rate= av_image_get_buffer_size(st->codec->pix_fmt, 
ctx->bmd_width, ctx->bmd_height, 1) * 1/av_q2d(st->codec->time_base) * 8;
 
 if (cctx->v210) {
 st->codec->codec_id= AV_CODEC_ID_V210;
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 3453b4d..077879e 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -30,6 +30,7 @@
 #include "libavutil/bprint.h"
 #include "libavutil/channel_layout.h"
 #include "libavutil/file.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/internal.h"
 #include "libavutil/log.h"
 #include "libavutil/mem.h"
@@ -430,7 +431,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, 
AVPacket *pkt)
 stream_idx = lavfi->sink_stream_map[min_pts_sink_idx];
 
 if (frame->width /* FIXME best way of testing a video */) {
-size = avpicture_get_size(frame->format, frame->width, frame->height);
+size = av_image_get_buffer_size(frame->format, frame->width, 
frame->height, 1);
 if ((ret = av_new_packet(pkt, size)) < 0)
 return ret;
 
diff --git a/libavformat/frmdec.c b/libavformat/frmdec.c
index a6f19af..260afbc 100644
--- a/libavformat/frmdec.c
+++ b/libavformat/frmdec.c
@@ -25,6 +25,7 @@
  */
 
 #include "libavcodec/raw.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
 
@@ -80,7 +81,7 @@ static int frm_read_packet(AVFormatContext *avctx, AVPacket 
*pkt)
 if (s->count)
 return 

Re: [FFmpeg-devel] [PATCH 3/3] configure: remove libzvbi GPL dependency

2016-01-15 Thread Carl Eugen Hoyos
Marton Balint  passwd.hu> writes:

> The COPYING.LIB file in the zvbi source tree as 
> well as libzvbi.h references the GNU Library 
> General Public License version 2.

This may need a version check for "0.2.28" or later.

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] define AVPixelFormat aliases as enumerators instead of macros

2016-01-15 Thread Hendrik Leppkes
On Thu, Jan 14, 2016 at 10:58 PM, Richard Smith  wrote:
> libavutil/pixfmt.h defines a collection of endian-specific pixel formats as
> macros. These macro names can cause conflicts with external projects that
> use those identifiers for their own purposes. Here's a patch to define
> these aliases as enumerators instead of macros, please consider merging:
>
>
> https://github.com/zygoloid/FFmpeg/commit/c20a0e2e66e52c45b9193bc750165b7ecf7f3ca4
>
> (Note that AV_PIX_FMT_Y400A was already defined as an enumerator in the
> PixelFormat enumeration, so I deleted its (no-op) macro entirely.)

In contrast to earlier times where this was not the case and rather
generic names were defined, all those macros are properly namespaced
AV_*, so any conflicts with other software can easily be avoided by
not using our namespace for their own names.
I don't see the point potentially breaking API compat for this.

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