[FFmpeg-cvslog] doc/filters: mention required compile options for some filters

2018-06-04 Thread Lou Logan
ffmpeg | branch: master | Lou Logan  | Mon Jun  4 16:38:20 2018 
-0800| [1f75756c719442280590b97bf17f3eed7d6aa93d] | committer: Lou Logan

doc/filters: mention required compile options for some filters

Signed-off-by: Lou Logan 

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

 doc/filters.texi | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 9f8fb74090..256ab42b00 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -3893,6 +3893,9 @@ not meant to be used directly.
 @section rubberband
 Apply time-stretching and pitch-shifting with librubberband.
 
+To enable compilation of this filter, you need to configure FFmpeg with
+@code{--enable-librubberband}.
+
 The filter accepts the following options:
 
 @table @option
@@ -11739,7 +11742,9 @@ Pass the video source unchanged to the output.
 @section ocr
 Optical Character Recognition
 
-This filter uses Tesseract for optical character recognition.
+This filter uses Tesseract for optical character recognition. To enable
+compilation of this filter, you need to configure FFmpeg with
+@code{--enable-libtesseract}.
 
 It accepts the following options:
 
@@ -17143,7 +17148,8 @@ 
zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih
 @anchor{zscale}
 @section zscale
 Scale (resize) the input video, using the z.lib library:
-https://github.com/sekrit-twc/zimg.
+@url{https://github.com/sekrit-twc/zimg}. To enable compilation of this
+filter, you need to configure FFmpeg with @code{--enable-libzimg}.
 
 The zscale filter forces the output display aspect ratio to be the same
 as the input, by changing the output sample aspect ratio.

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


[FFmpeg-cvslog] avcodec/amrwbdec: Fix division by 0 in find_hb_gain()

2018-06-04 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Jun  3 00:48:06 2018 +0200| [dce80a4b47efaba97707bda781a9ee57f5a26974] | 
committer: Michael Niedermayer

avcodec/amrwbdec: Fix division by 0 in find_hb_gain()

This restructures the code slightly toward D_UTIL_dec_synthesis()

Fixes: 
7420/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AMRWB_fuzzer-6577305112543232

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=dce80a4b47efaba97707bda781a9ee57f5a26974
---

 libavcodec/amrwbdec.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 7f2874d35f..47fe7eb55e 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -862,15 +862,20 @@ static float find_hb_gain(AMRWBContext *ctx, const float 
*synth,
 {
 int wsp = (vad > 0);
 float tilt;
+float tmp;
 
 if (ctx->fr_cur_mode == MODE_23k85)
 return qua_hb_gain[hb_idx] * (1.0f / (1 << 14));
 
-tilt = ctx->celpm_ctx.dot_productf(synth, synth + 1, AMRWB_SFR_SIZE - 1) /
-   ctx->celpm_ctx.dot_productf(synth, synth, AMRWB_SFR_SIZE);
+tmp = ctx->celpm_ctx.dot_productf(synth, synth + 1, AMRWB_SFR_SIZE - 1);
+
+if (tmp > 0) {
+tilt = tmp / ctx->celpm_ctx.dot_productf(synth, synth, AMRWB_SFR_SIZE);
+} else
+tilt = 0;
 
 /* return gain bounded by [0.1, 1.0] */
-return av_clipf((1.0 - FFMAX(0.0, tilt)) * (1.25 - 0.25 * wsp), 0.1, 1.0);
+return av_clipf((1.0 - tilt) * (1.25 - 0.25 * wsp), 0.1, 1.0);
 }
 
 /**

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


[FFmpeg-cvslog] avcodec/opus_silk: Change silk_lsf2lpc() slightly toward silk/NLSF2A.c

2018-06-04 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
Jun  3 01:33:54 2018 +0200| [e7dda51150b73e5fbdccf4c2d3a72e356980fba3] | 
committer: Michael Niedermayer

avcodec/opus_silk: Change silk_lsf2lpc() slightly toward silk/NLSF2A.c

Fixes: runtime error: signed integer overflow: -1440457022 - 785819492 cannot 
be represented in type 'int'
Fixes: 
7700/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OPUS_fuzzer-6595838684954624

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=e7dda51150b73e5fbdccf4c2d3a72e356980fba3
---

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

diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c
index 344333cc18..2fcbf3b9d3 100644
--- a/libavcodec/opus_silk.c
+++ b/libavcodec/opus_silk.c
@@ -239,8 +239,10 @@ static void silk_lsf2lpc(const int16_t nlsf[16], float 
lpcf[16], int order)
 
 /* reconstruct A(z) */
 for (k = 0; k < order>>1; k++) {
-lpc32[k] = -p[k + 1] - p[k] - q[k + 1] + q[k];
-lpc32[order-k-1] = -p[k + 1] - p[k] + q[k + 1] - q[k];
+int32_t p_tmp = p[k + 1] + p[k];
+int32_t q_tmp = q[k + 1] - q[k];
+lpc32[k] = -q_tmp - p_tmp;
+lpc32[order-k-1] =  q_tmp - p_tmp;
 }
 
 /* limit the range of the LPC coefficients to each fit within an int16_t */

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


[FFmpeg-cvslog] fftools/ffmpeg: fix for all forced key frames when 'copyts' is enabled

2018-06-04 Thread Vishwanath Dixit
ffmpeg | branch: master | Vishwanath Dixit  | Sun May  6 
22:56:59 2018 +0530| [146cdf7e4bb029c9e457742d82d00d3b396b9ff4] | committer: 
Michael Niedermayer

fftools/ffmpeg: fix for all forced key frames when 'copyts' is enabled

Forced key frames generation functionality was assuming the first PTS
value as zero, but, when 'copyts' is enabled, the first PTS can be any
big number. This was eventually forcing all the frames as key frames.
To resolve this issue, update has been made to use first input pts as
reference pts.

Signed-off-by: Michael Niedermayer 

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

 fftools/ffmpeg.c | 6 +-
 fftools/ffmpeg.h | 1 +
 fftools/ffmpeg_opt.c | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 5a19a09d9a..10f3012cdc 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1236,8 +1236,12 @@ static void do_video_out(OutputFile *of,
 in_picture->quality = enc->global_quality;
 in_picture->pict_type = 0;
 
+if (ost->forced_kf_ref_pts == AV_NOPTS_VALUE &&
+in_picture->pts != AV_NOPTS_VALUE)
+ost->forced_kf_ref_pts = in_picture->pts;
+
 pts_time = in_picture->pts != AV_NOPTS_VALUE ?
-in_picture->pts * av_q2d(enc->time_base) : NAN;
+(in_picture->pts - ost->forced_kf_ref_pts) * 
av_q2d(enc->time_base) : NAN;
 if (ost->forced_kf_index < ost->forced_kf_count &&
 in_picture->pts >= ost->forced_kf_pts[ost->forced_kf_index]) {
 ost->forced_kf_index++;
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index d44b7a5c72..eb1eaf6363 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -484,6 +484,7 @@ typedef struct OutputStream {
 AVRational frame_aspect_ratio;
 
 /* forced key frames */
+int64_t forced_kf_ref_pts;
 int64_t *forced_kf_pts;
 int forced_kf_count;
 int forced_kf_index;
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 8ae68aec0e..36bce4465a 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -1324,6 +1324,7 @@ static OutputStream *new_output_stream(OptionsContext *o, 
AVFormatContext *oc, e
 ost->file_index = nb_output_files - 1;
 ost->index  = idx;
 ost->st = st;
+ost->forced_kf_ref_pts = AV_NOPTS_VALUE;
 st->codecpar->codec_type = type;
 
 ret = choose_encoder(o, oc, ost);

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


[FFmpeg-cvslog] avcodec/vc1: fix out-of-bounds reference pixel replication

2018-06-04 Thread Jerome Borsboom
ffmpeg | branch: master | Jerome Borsboom  | Tue 
May 29 14:26:17 2018 +0200| [f56a0b02cdbf8d5820de400e584a72b002cd461a] | 
committer: Carl Eugen Hoyos

avcodec/vc1: fix out-of-bounds reference pixel replication

Out-of-bounds reference pixel replication should take into account the frame
coding mode of the reference frame(s), not the frame coding mode of the
current frame.

Signed-off-by: Jerome Borsboom 

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

 libavcodec/vc1_mc.c | 668 ++--
 1 file changed, 385 insertions(+), 283 deletions(-)

diff --git a/libavcodec/vc1_mc.c b/libavcodec/vc1_mc.c
index 04b359204c..1b8d8799b3 100644
--- a/libavcodec/vc1_mc.c
+++ b/libavcodec/vc1_mc.c
@@ -179,12 +179,17 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir)
 int i;
 uint8_t (*luty)[256], (*lutuv)[256];
 int use_ic;
+int interlace;
+int linesize, uvlinesize;
 
 if ((!v->field_mode ||
  (v->ref_field_type[dir] == 1 && v->cur_field_type == 1)) &&
 !v->s.last_picture.f->data[0])
 return;
 
+linesize = s->current_picture_ptr->f->linesize[0];
+uvlinesize = s->current_picture_ptr->f->linesize[1];
+
 mx = s->mv[dir][0][0];
 my = s->mv[dir][0][1];
 
@@ -220,6 +225,7 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir)
 luty  = v->curr_luty;
 lutuv = v->curr_lutuv;
 use_ic = *v->curr_use_ic;
+interlace = 1;
 } else {
 srcY = s->last_picture.f->data[0];
 srcU = s->last_picture.f->data[1];
@@ -227,6 +233,7 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir)
 luty  = v->last_luty;
 lutuv = v->last_lutuv;
 use_ic = v->last_use_ic;
+interlace = s->last_picture.f->interlaced_frame;
 }
 } else {
 srcY = s->next_picture.f->data[0];
@@ -235,6 +242,7 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir)
 luty  = v->next_luty;
 lutuv = v->next_lutuv;
 use_ic = v->next_use_ic;
+interlace = s->next_picture.f->interlaced_frame;
 }
 
 if (!srcY || !srcU) {
@@ -269,9 +277,9 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir)
 srcV += uvsrc_y * s->uvlinesize + uvsrc_x;
 
 if (v->field_mode && v->ref_field_type[dir]) {
-srcY += s->current_picture_ptr->f->linesize[0];
-srcU += s->current_picture_ptr->f->linesize[1];
-srcV += s->current_picture_ptr->f->linesize[2];
+srcY += linesize;
+srcU += uvlinesize;
+srcV += uvlinesize;
 }
 
 /* for grayscale we should not try to read from unknown area */
@@ -289,112 +297,105 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir)
 const int k = 17 + s->mspel * 2;
 
 srcY -= s->mspel * (1 + s->linesize);
-if (v->fcm == ILACE_FRAME) {
-if (src_y - s->mspel & 1) {
-s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer,
- srcY,
- 2 * s->linesize,
- 2 * s->linesize,
- k,
- k + 1 >> 1,
- src_x - s->mspel,
- src_y - s->mspel >> 1,
- s->h_edge_pos,
- v_edge_pos + 1 >> 1);
-s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer + s->linesize,
- srcY + s->linesize,
- 2 * s->linesize,
- 2 * s->linesize,
- k,
- k >> 1,
- src_x - s->mspel,
- src_y - s->mspel + 1 >> 1,
- s->h_edge_pos,
- v_edge_pos >> 1);
-} else {
-s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer,
- srcY,
- 2 * s->linesize,
- 2 * s->linesize,
- k,
- k + 1 >> 1,
- src_x - s->mspel,
- src_y - s->mspel >> 1,
- s->h_edge_pos,
- v_edge_pos >> 1);
-s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer + s->linesize,
- srcY + s->linesize,
- 2 * s->linesize,
- 2 * s->linesize,
+if (interlace) {
+s->vdsp.e