[FFmpeg-cvslog] avfilter/af_sofalizer: increase range for lfegain

2018-12-23 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Dec 23 10:00:44 
2018 +0100| [b13fe6477d5b027aa3e4ec59e102be824d9b3513] | committer: Paul B Mahol

avfilter/af_sofalizer: increase range for lfegain

Fixes #7634.

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

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

diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index 3557b28709..0e478f437a 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -886,7 +886,7 @@ static const AVOption sofalizer_options[] = {
 { "time",  "time domain",  0,   AV_OPT_TYPE_CONST,  
{.i64=0},   0,   0, .flags = FLAGS, "type" },
 { "freq",  "frequency domain", 0,   AV_OPT_TYPE_CONST,  
{.i64=1},   0,   0, .flags = FLAGS, "type" },
 { "speakers",  "set speaker custom positions", OFFSET(speakers_pos), 
AV_OPT_TYPE_STRING,  {.str=0},0, 0, .flags = FLAGS },
-{ "lfegain",   "set lfe gain", OFFSET(lfe_gain), 
AV_OPT_TYPE_FLOAT,   {.dbl=0},   -9, 9, .flags = FLAGS },
+{ "lfegain",   "set lfe gain", OFFSET(lfe_gain), 
AV_OPT_TYPE_FLOAT,   {.dbl=0},  -20,40, .flags = FLAGS },
 { "framesize", "set frame size", OFFSET(framesize), AV_OPT_TYPE_INT,
{.i64=1024},1024,96000, .flags = FLAGS },
 { NULL }
 };

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


[FFmpeg-cvslog] avfilter/af_sofalizer: pick IR length after loading sofa

2018-12-23 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Dec 23 11:02:34 
2018 +0100| [0c3481b43a198e483a20dcd56b08bb402e529ba3] | committer: Paul B Mahol

avfilter/af_sofalizer: pick IR length after loading sofa

Instead of picking it in preloading stage.

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

 libavfilter/af_sofalizer.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index 0e478f437a..9715f78e88 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -113,7 +113,6 @@ static int close_sofa(struct MySofa *sofa)
 
 static int preload_sofa(AVFilterContext *ctx, char *filename, int 
*samplingrate)
 {
-struct SOFAlizerContext *s = ctx->priv;
 struct MYSOFA_HRTF *mysofa;
 char *license;
 int ret;
@@ -126,9 +125,8 @@ static int preload_sofa(AVFilterContext *ctx, char 
*filename, int *samplingrate)
 
 if (mysofa->DataSamplingRate.elements != 1)
 return AVERROR(EINVAL);
+av_log(ctx, AV_LOG_DEBUG, "Original IR length: %d.\n", mysofa->N);
 *samplingrate = mysofa->DataSamplingRate.values[0];
-s->sofa.ir_samples = mysofa->N;
-s->sofa.n_samples = 1 << (32 - ff_clz(s->sofa.ir_samples));
 license = mysofa_getAttribute(mysofa->attributes, (char *)"License");
 if (license)
 av_log(ctx, AV_LOG_INFO, "SOFA license: %s\n", license);
@@ -591,6 +589,10 @@ static int load_data(AVFilterContext *ctx, int azim, int 
elev, float radius, int
 return AVERROR_INVALIDDATA;
 }
 
+av_log(ctx, AV_LOG_DEBUG, "IR length: %d.\n", s->sofa.easy->hrtf->N);
+s->sofa.ir_samples = s->sofa.easy->hrtf->N;
+s->sofa.n_samples = 1 << (32 - ff_clz(s->sofa.ir_samples));
+
 n_samples = s->sofa.n_samples;
 ir_samples = s->sofa.ir_samples;
 

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


[FFmpeg-cvslog] avfilter/af_sofalizer: reset FFT pointers back to NULL

2018-12-23 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Dec 23 11:30:01 
2018 +0100| [d360a79c0a1ee8a37f141a7e5fdbe97743a26cd8] | committer: Paul B Mahol

avfilter/af_sofalizer: reset FFT pointers back to NULL

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

 libavfilter/af_sofalizer.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index 9715f78e88..94e5b73131 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -858,6 +858,10 @@ static av_cold void uninit(AVFilterContext *ctx)
 av_fft_end(s->ifft[1]);
 av_fft_end(s->fft[0]);
 av_fft_end(s->fft[1]);
+s->ifft[0] = NULL;
+s->ifft[1] = NULL;
+s->fft[0] = NULL;
+s->fft[1] = NULL;
 av_freep(&s->delay[0]);
 av_freep(&s->delay[1]);
 av_freep(&s->data_ir[0]);

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


[FFmpeg-cvslog] avcodec: add g732_1 parser

2018-12-23 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Dec 18 20:46:13 
2018 +0100| [3601eb04745600ae6784e874d36a868f459f88c8] | committer: Paul B Mahol

avcodec: add g732_1 parser

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

 libavcodec/Makefile|  1 +
 libavcodec/g723_1_parser.c | 60 ++
 libavcodec/parsers.c   |  1 +
 libavcodec/utils.c |  2 --
 4 files changed, 62 insertions(+), 2 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index d53b8ff330..08f89ae0b2 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1025,6 +1025,7 @@ OBJS-$(CONFIG_DVD_NAV_PARSER)  += dvd_nav_parser.o
 OBJS-$(CONFIG_DVDSUB_PARSER)   += dvdsub_parser.o
 OBJS-$(CONFIG_FLAC_PARSER) += flac_parser.o flacdata.o flac.o \
   vorbis_data.o
+OBJS-$(CONFIG_G723_1_PARSER)   += g723_1_parser.o
 OBJS-$(CONFIG_G729_PARSER) += g729_parser.o
 OBJS-$(CONFIG_GIF_PARSER)  += gif_parser.o
 OBJS-$(CONFIG_GSM_PARSER)  += gsm_parser.o
diff --git a/libavcodec/g723_1_parser.c b/libavcodec/g723_1_parser.c
new file mode 100644
index 00..0305ca329d
--- /dev/null
+++ b/libavcodec/g723_1_parser.c
@@ -0,0 +1,60 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * G723_1 audio parser
+ */
+
+#include "parser.h"
+#include "g723_1.h"
+
+typedef struct G723_1ParseContext {
+ParseContext pc;
+} G723_1ParseContext;
+
+static int g723_1_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
+const uint8_t **poutbuf, int *poutbuf_size,
+const uint8_t *buf, int buf_size)
+{
+G723_1ParseContext *s = s1->priv_data;
+ParseContext *pc = &s->pc;
+int next = END_NOT_FOUND;
+
+if (buf_size > 0)
+next = frame_size[buf[0] & 3] * FFMAX(1, avctx->channels);
+
+if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) {
+*poutbuf  = NULL;
+*poutbuf_size = 0;
+return buf_size;
+}
+
+s1->duration = 240;
+
+*poutbuf  = buf;
+*poutbuf_size = buf_size;
+return next;
+}
+
+AVCodecParser ff_g723_1_parser = {
+.codec_ids  = { AV_CODEC_ID_G723_1 },
+.priv_data_size = sizeof(G723_1ParseContext),
+.parser_parse   = g723_1_parse,
+.parser_close   = ff_parse_close,
+};
diff --git a/libavcodec/parsers.c b/libavcodec/parsers.c
index eca95787ae..33a71de8a0 100644
--- a/libavcodec/parsers.c
+++ b/libavcodec/parsers.c
@@ -40,6 +40,7 @@ extern AVCodecParser ff_dvbsub_parser;
 extern AVCodecParser ff_dvdsub_parser;
 extern AVCodecParser ff_dvd_nav_parser;
 extern AVCodecParser ff_flac_parser;
+extern AVCodecParser ff_g723_1_parser;
 extern AVCodecParser ff_g729_parser;
 extern AVCodecParser ff_gif_parser;
 extern AVCodecParser ff_gsm_parser;
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 2fa811d499..d519b16092 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1599,8 +1599,6 @@ static int get_audio_frame_duration(enum AVCodecID id, 
int sr, int ch, int ba,
 return 256 * (frame_bytes / 64);
 if (id == AV_CODEC_ID_RA_144)
 return 160 * (frame_bytes / 20);
-if (id == AV_CODEC_ID_G723_1)
-return 240 * (frame_bytes / 24);
 
 if (bps > 0) {
 /* calc from frame_bytes and bits_per_coded_sample */

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


[FFmpeg-cvslog] avcodec/g723_1dec: use init_get_bits8()

2018-12-23 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Dec 23 15:40:47 
2018 +0100| [f52dd8a55a98418b6301cce4a56d2b73d08b7eea] | committer: Paul B Mahol

avcodec/g723_1dec: use init_get_bits8()

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

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

diff --git a/libavcodec/g723_1dec.c b/libavcodec/g723_1dec.c
index 028cde0f37..676c4bbac3 100644
--- a/libavcodec/g723_1dec.c
+++ b/libavcodec/g723_1dec.c
@@ -78,8 +78,11 @@ static int unpack_bitstream(G723_1_ChannelContext *p, const 
uint8_t *buf,
 GetBitContext gb;
 int ad_cb_len;
 int temp, info_bits, i;
+int ret;
 
-init_get_bits(&gb, buf, buf_size * 8);
+ret = init_get_bits8(&gb, buf, buf_size);
+if (ret < 0)
+return ret;
 
 /* Extract frame type and rate info */
 info_bits = get_bits(&gb, 2);

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


[FFmpeg-cvslog] avfilter/af_sofalizer: stop using easy API

2018-12-23 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Dec 23 17:56:59 
2018 +0100| [4096c670abefdd361fcfd427e163088979871c6c] | committer: Paul B Mahol

avfilter/af_sofalizer: stop using easy API

Easy API is not flexible enough for our needs.

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

 doc/filters.texi   |  17 +++
 libavfilter/af_sofalizer.c | 117 ++---
 2 files changed, 117 insertions(+), 17 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index aac51bed69..65ce25bc18 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4511,6 +4511,23 @@ Set custom gain for LFE channels. Value is in dB. 
Default is 0.
 Set custom frame size in number of samples. Default is 1024.
 Allowed range is from 1024 to 96000. Only used if option @samp{type}
 is set to @var{freq}.
+
+@item normalize
+Should all IRs be normalized upon importing SOFA file.
+By default is enabled.
+
+@item interpolate
+Should nearest IRs be interpolated with neighbor IRs if exact position
+does not match. By default is disabled.
+
+@item minphase
+Minphase all IRs upon loading of SOFA file. By default is disabled.
+
+@item anglestep
+Set neighbor search angle step. Only used if option @var{interpolate} is 
enabled.
+
+@item radstep
+Set neighbor search radius step. Only used if option @var{interpolate} is 
enabled.
 @end table
 
 @subsection Examples
diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index 94e5b73131..7812e25557 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -42,10 +42,13 @@
 #define FREQUENCY_DOMAIN 1
 
 typedef struct MySofa {  /* contains data of one SOFA file */
-struct MYSOFA_EASY *easy;
+struct MYSOFA_HRTF *hrtf;
+struct MYSOFA_LOOKUP *lookup;
+struct MYSOFA_NEIGHBORHOOD *neighborhood;
 int ir_samples;  /* length of one impulse response (IR) */
 int n_samples;   /* ir_samples to next power of 2 */
 float *lir, *rir;/* IRs (time-domain) */
+float *fir;
 int max_delay;
 } MySofa;
 
@@ -94,6 +97,11 @@ typedef struct SOFAlizerContext {
 float radius;/* distance virtual loudspeakers to listener (in 
metres) */
 int type;/* processing type */
 int framesize;   /* size of buffer */
+int normalize;   /* should all IRs be normalized upon import ? */
+int interpolate; /* should wanted IRs be interpolated from neighbors ? 
*/
+int minphase;/* should all IRs be minphased upon import ? */
+float anglestep; /* neighbor search angle step, in agles */
+float radstep;   /* neighbor search radius step, in meters */
 
 VirtualSpeaker vspkrpos[64];
 
@@ -105,24 +113,62 @@ typedef struct SOFAlizerContext {
 
 static int close_sofa(struct MySofa *sofa)
 {
-mysofa_close(sofa->easy);
-sofa->easy = NULL;
+if (sofa->neighborhood)
+mysofa_neighborhood_free(sofa->neighborhood);
+sofa->neighborhood = NULL;
+if (sofa->lookup)
+mysofa_lookup_free(sofa->lookup);
+sofa->lookup = NULL;
+if (sofa->hrtf)
+mysofa_free(sofa->hrtf);
+sofa->hrtf = NULL;
+av_freep(&sofa->fir);
 
 return 0;
 }
 
 static int preload_sofa(AVFilterContext *ctx, char *filename, int 
*samplingrate)
 {
+struct SOFAlizerContext *s = ctx->priv;
 struct MYSOFA_HRTF *mysofa;
 char *license;
 int ret;
 
 mysofa = mysofa_load(filename, &ret);
+s->sofa.hrtf = mysofa;
 if (ret || !mysofa) {
 av_log(ctx, AV_LOG_ERROR, "Can't find SOFA-file '%s'\n", filename);
 return AVERROR(EINVAL);
 }
 
+ret = mysofa_check(mysofa);
+if (ret != MYSOFA_OK) {
+av_log(ctx, AV_LOG_ERROR, "Selected SOFA file is invalid. Please 
select valid SOFA file.\n");
+return ret;
+}
+
+if (s->normalize)
+mysofa_loudness(s->sofa.hrtf);
+
+if (s->minphase)
+mysofa_minphase(s->sofa.hrtf, 0.01);
+
+mysofa_tocartesian(s->sofa.hrtf);
+
+s->sofa.lookup = mysofa_lookup_init(s->sofa.hrtf);
+if (s->sofa.lookup == NULL)
+return AVERROR(EINVAL);
+
+if (s->interpolate)
+s->sofa.neighborhood = 
mysofa_neighborhood_init_withstepdefine(s->sofa.hrtf,
+   
s->sofa.lookup,
+   
s->anglestep,
+   
s->radstep);
+
+s->sofa.fir = av_calloc(s->sofa.hrtf->N * s->sofa.hrtf->R, 
sizeof(*s->sofa.fir));
+if (!s->sofa.fir)
+return AVERROR(ENOMEM);
+
 if (mysofa->DataSamplingRate.elements != 1)
 return AVERROR(EINVAL);
 av_log(ctx, AV_LOG_DEBUG, "Original IR length: %d.\n", mysofa->N);
@@ -130,7 +176,6 @@ static int preload_sofa(AVFilterContext *ctx, char 
*filename, int *samplingrate)
 license = mysofa_getAttribute(mysofa->attributes,

[FFmpeg-cvslog] avcodec/ivi: Avoid mbs memleak

2018-12-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Dec 13 03:16:04 2018 +0100| [80cce5998c10ff5d93c7b52f303d83ad20fb3a11] | 
committer: Michael Niedermayer

avcodec/ivi: Avoid mbs memleak

Fixes: 
11696/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5740319635668992

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

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

 libavcodec/ivi.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavcodec/ivi.c b/libavcodec/ivi.c
index b23d4af27e..71bf0e6e1c 100644
--- a/libavcodec/ivi.c
+++ b/libavcodec/ivi.c
@@ -437,6 +437,14 @@ av_cold int ff_ivi_init_tiles(IVIPlaneDesc *planes,
 
 for (b = 0; b < planes[p].num_bands; b++) {
 band = &planes[p].bands[b];
+
+if (band->tiles) {
+int t;
+for (t = 0; t < band->num_tiles; t++) {
+av_freep(&band->tiles[t].mbs);
+}
+}
+
 x_tiles = IVI_NUM_TILES(band->width, t_width);
 y_tiles = IVI_NUM_TILES(band->height, t_height);
 band->num_tiles = x_tiles * y_tiles;

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


[FFmpeg-cvslog] avcodec/fic: Fail on invalid slice size/off

2018-12-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Dec 16 21:43:07 2018 +0100| [30a7a81cdc2ee2eac6d3271439c43f11b7327b3e] | 
committer: Michael Niedermayer

avcodec/fic: Fail on invalid slice size/off

Fixes: Timeout
Fixes: 
11486/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5677133863583744

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

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

 libavcodec/fic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index dcf0777674..3e36346358 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -380,6 +380,8 @@ static int fic_decode_frame(AVCodecContext *avctx, void 
*data,
 slice_h  = FFALIGN(avctx->height - ctx->slice_h * (nslices - 
1), 16);
 } else {
 slice_size = AV_RB32(src + tsize + FIC_HEADER_SIZE + slice * 4 + 
4);
+if (slice_size < slice_off)
+return AVERROR_INVALIDDATA;
 }
 
 if (slice_size < slice_off || slice_size > msize)

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


[FFmpeg-cvslog] avcodec/ilbcdec: fix integer overflow in energy

2018-12-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Dec  9 02:26:18 2018 +0100| [fbf409cd91aca2b4738c6b5bc963ae6041f26701] | 
committer: Michael Niedermayer

avcodec/ilbcdec: fix integer overflow in energy

webrtc uses a int32_t like the existing code in ilbcdec

Fixes: signed integer overflow: 2080245063 + 257939661 cannot be represented in 
type 'int'
Fixes: 
11037/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-5682976612941824

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

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

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

diff --git a/libavcodec/ilbcdec.c b/libavcodec/ilbcdec.c
index 8a6dbe0b75..50012c0231 100644
--- a/libavcodec/ilbcdec.c
+++ b/libavcodec/ilbcdec.c
@@ -1303,7 +1303,8 @@ static int xcorr_coeff(int16_t *target, int16_t 
*regressor,
 pos += step;
 
 /* Do a +/- to get the next energy */
-energy += step * ((*rp_end * *rp_end - *rp_beg * *rp_beg) >> shifts);
+energy += (unsigned)step * ((*rp_end * *rp_end - *rp_beg * *rp_beg) >> 
shifts);
+
 rp_beg += step;
 rp_end += step;
 }

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


[FFmpeg-cvslog] avcodec/fic: use init_get_bits8()

2018-12-23 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Dec 23 20:49:19 
2018 +0100| [f89919d4fb7c79f1efa96a2c1b10a3a35941cc40] | committer: Paul B Mahol

avcodec/fic: use init_get_bits8()

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

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

diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index 3e36346358..8833536330 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -173,9 +173,11 @@ static int fic_decode_slice(AVCodecContext *avctx, void 
*tdata)
 int slice_h  = tctx->slice_h;
 int src_size = tctx->src_size;
 int y_off= tctx->y_off;
-int x, y, p;
+int x, y, p, ret;
 
-init_get_bits(&gb, src, src_size * 8);
+ret = init_get_bits8(&gb, src, src_size);
+if (ret < 0)
+return ret;
 
 for (p = 0; p < 3; p++) {
 int stride   = ctx->frame->linesize[p];

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


[FFmpeg-cvslog] avcodec/g722dec: use init_get_bits8()

2018-12-23 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Dec 23 21:01:17 
2018 +0100| [e483606d4455678c9dc301ca7c69a2696c23cbd8] | committer: Paul B Mahol

avcodec/g722dec: use init_get_bits8()

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

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

diff --git a/libavcodec/g722dec.c b/libavcodec/g722dec.c
index 000b591fe6..7c270bc33a 100644
--- a/libavcodec/g722dec.c
+++ b/libavcodec/g722dec.c
@@ -100,7 +100,9 @@ static int g722_decode_frame(AVCodecContext *avctx, void 
*data,
 return ret;
 out_buf = (int16_t *)frame->data[0];
 
-init_get_bits(&gb, avpkt->data, avpkt->size * 8);
+ret = init_get_bits8(&gb, avpkt->data, avpkt->size);
+if (ret < 0)
+return ret;
 
 for (j = 0; j < avpkt->size; j++) {
 int ilow, ihigh, rlow, rhigh, dhigh;

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


[FFmpeg-cvslog] avcodec/wmavoice: use init_get_bits8()

2018-12-23 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Dec 23 21:06:22 
2018 +0100| [c4a05ae65c3903c9be3b187213fd9fa41c660d6d] | committer: Paul B Mahol

avcodec/wmavoice: use init_get_bits8()

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

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

diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 444e303b0d..68bb65986e 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -1906,7 +1906,7 @@ static int wmavoice_decode_packet(AVCodecContext *ctx, 
void *data,
  * in a single "muxer" packet, so we artificially emulate that by
  * capping the packet size at ctx->block_align. */
 for (size = avpkt->size; size > ctx->block_align; size -= 
ctx->block_align);
-init_get_bits(&s->gb, avpkt->data, size << 3);
+init_get_bits8(&s->gb, avpkt->data, size);
 
 /* size == ctx->block_align is used to indicate whether we are dealing with
  * a new packet or a packet of which we already read the packet header

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


[FFmpeg-cvslog] avfilter/af_sofalizer: set delays when interpolation is disabled

2018-12-23 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Dec 23 21:40:07 
2018 +0100| [ee64b64c0227e0e7f231e7d07f4bb2964dd7015d] | committer: Paul B Mahol

avfilter/af_sofalizer: set delays when interpolation is disabled

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

 libavfilter/af_sofalizer.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index 7812e25557..c30f99c810 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -627,6 +627,13 @@ static int getfilter_float(AVFilterContext *ctx, float x, 
float y, float z,
  nearest, neighbors,
  s->sofa.fir, delays);
 } else {
+if (s->sofa.hrtf->DataDelay.elements > s->sofa.hrtf->R) {
+delays[0] = s->sofa.hrtf->DataDelay.values[nearest * 
s->sofa.hrtf->R];
+delays[1] = s->sofa.hrtf->DataDelay.values[nearest * 
s->sofa.hrtf->R + 1];
+} else {
+delays[0] = s->sofa.hrtf->DataDelay.values[0];
+delays[1] = s->sofa.hrtf->DataDelay.values[1];
+}
 res = s->sofa.hrtf->DataIR.values + nearest * s->sofa.hrtf->N * 
s->sofa.hrtf->R;
 }
 

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


[FFmpeg-cvslog] avfilter/af_sofalizer: fix memory leaks

2018-12-23 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Dec 23 21:49:30 
2018 +0100| [7d5bb3a4d34f0cddd300252f8afc37c3d7bf17c8] | committer: Paul B Mahol

avfilter/af_sofalizer: fix memory leaks

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

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

diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c
index c30f99c810..90eb3534a4 100644
--- a/libavfilter/af_sofalizer.c
+++ b/libavfilter/af_sofalizer.c
@@ -738,7 +738,7 @@ static int load_data(AVFilterContext *ctx, int azim, int 
elev, float radius, int
   data_ir_r + n_samples * i,
   &delay_l, &delay_r);
 if (ret < 0)
-return ret;
+goto fail;
 
 s->delay[0][i] = delay_l * sample_rate;
 s->delay[1][i] = delay_r * sample_rate;

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


[FFmpeg-cvslog] avformat/hlsenc: remove duplicate operation at hls_write_header

2018-12-23 Thread Steven Liu
ffmpeg | branch: master | Steven Liu  | Wed Dec 12 
15:37:01 2018 +0800| [cdbf8847ea97a985dfd55432e1384bb7fe5d2d3b] | committer: 
Steven Liu

avformat/hlsenc: remove duplicate operation at hls_write_header

the options have set when avformat_init_output at hls_mux_init

Signed-off-by: Steven Liu 

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

 libavformat/hlsenc.c | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index bdd2a113bd..03a32b65d8 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -787,7 +787,7 @@ static int hls_mux_init(AVFormatContext *s, VariantStream 
*vs)
 
 av_dict_copy(&options, hls->format_options, 0);
 av_dict_set(&options, "fflags", "-autobsf", 0);
-av_dict_set(&options, "movflags", "frag_custom+dash+delay_moov", 0);
+av_dict_set(&options, "movflags", "+frag_custom+dash+delay_moov", 
AV_DICT_APPEND);
 ret = avformat_init_output(oc, &options);
 if (ret < 0)
 return ret;
@@ -2079,15 +2079,9 @@ static int hls_write_header(AVFormatContext *s)
 for (i = 0; i < hls->nb_varstreams; i++) {
 vs = &hls->var_streams[i];
 
-av_dict_copy(&options, hls->format_options, 0);
-ret = avformat_write_header(vs->avf, &options);
-if (av_dict_count(options)) {
-av_log(s, AV_LOG_ERROR, "Some of provided format options in '%s' 
are not recognized\n", hls->format_options_str);
-ret = AVERROR(EINVAL);
-av_dict_free(&options);
-goto fail;
-}
-av_dict_free(&options);
+ret = avformat_write_header(vs->avf, NULL);
+if (ret < 0)
+return ret;
 //av_assert0(s->nb_streams == hls->avf->nb_streams);
 for (j = 0; j < vs->nb_streams; j++) {
 AVStream *inner_st;

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