[FFmpeg-cvslog] avcodec/dvbsub: add support for Display Definition Segment to DVB Subtitle encoder

2019-07-13 Thread Jernej Fijacko
ffmpeg | branch: master | Jernej Fijacko  | Sat Jul 13 
19:33:16 2019 +0200| [f86f213a6d3dd749152a105df839172fe4c772d1] | committer: 
Marton Balint

avcodec/dvbsub: add support for Display Definition Segment to DVB Subtitle 
encoder

Current version of dvbsub encoder doesn't support HD DVB subtitles. The high
resolution bitmaps are muxed into the stream but without the DDS (display 
definition
segment) the players asume that the DVB subtitles are in SD (720x576) resolution
which causes them to either render the subtitles too large and misplaced or 
don't
render them at all. By including the DDS as defined in section 7.7.1 of ETSI EN 
300
743 (V1.3.1) this problem is fixed.

7.2.1 Display definition segment The display definition for a subtitle service 
may
be defined by the display definition segment if present in the stream. Absence 
of a
DDS implies that the stream is coded in accordance with EN 300 743 (V1.2.1) [5] 
and
that a display width of 720 pixels and a display height of 576 lines may be 
assumed.

https://www.etsi.org/deliver/etsi_en/300700_300799/300743/01.03.01_60/en_300743v010301p.pdf

Signed-off-by: Jernej Fijacko 
Signed-off-by: Marton Balint 

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

 libavcodec/dvbsub.c | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/libavcodec/dvbsub.c b/libavcodec/dvbsub.c
index 8cce702a9e..a8d43d81d6 100644
--- a/libavcodec/dvbsub.c
+++ b/libavcodec/dvbsub.c
@@ -247,9 +247,10 @@ static void dvb_encode_rle8(uint8_t **pq,
 *pq = q;
 }
 
-static int encode_dvb_subtitles(DVBSubtitleContext *s,
+static int encode_dvb_subtitles(AVCodecContext *avctx,
 uint8_t *outbuf, const AVSubtitle *h)
 {
+DVBSubtitleContext *s = avctx->priv_data;
 uint8_t *q, *pseg_len;
 int page_id, region_id, clut_id, object_id, i, bpp_index, page_state;
 
@@ -261,6 +262,19 @@ static int encode_dvb_subtitles(DVBSubtitleContext *s,
 if (h->num_rects && !h->rects)
 return -1;
 
+if (avctx->width > 0 && avctx->height > 0) {
+/* display definition segment */
+*q++ = 0x0f; /* sync_byte */
+*q++ = 0x14; /* segment_type */
+bytestream_put_be16(, page_id);
+pseg_len = q;
+q += 2; /* segment length */
+*q++ = 0x00; /* dds version number & display window flag */
+bytestream_put_be16(, avctx->width - 1); /* display width */
+bytestream_put_be16(, avctx->height - 1); /* display height */
+bytestream_put_be16(_len, q - pseg_len - 2);
+}
+
 /* page composition segment */
 
 *q++ = 0x0f; /* sync_byte */
@@ -446,10 +460,9 @@ static int dvbsub_encode(AVCodecContext *avctx,
  unsigned char *buf, int buf_size,
  const AVSubtitle *sub)
 {
-DVBSubtitleContext *s = avctx->priv_data;
 int ret;
 
-ret = encode_dvb_subtitles(s, buf, sub);
+ret = encode_dvb_subtitles(avctx, buf, sub);
 return ret;
 }
 

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avformat: Don't suggest deprecated function

2019-07-13 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Sat Jul 13 18:48:48 2019 +0200| [a2572e3c670db018a414e9c168eef23ec2e3abc4] | 
committer: James Almer

avformat: Don't suggest deprecated function

Signed-off-by: Andreas Rheinhardt 
Signed-off-by: James Almer 

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

 libavformat/avformat.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 734ae54cac..6eb329f13f 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -175,8 +175,8 @@
  * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a
  * static storage somewhere inside the demuxer and the packet is only valid
  * until the next av_read_frame() call or closing the file. If the caller
- * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy
- * of it.
+ * requires a longer lifetime, av_packet_make_refcounted() will ensure that
+ * the data is reference counted, copying the data if necessary.
  * In both cases, the packet must be freed with av_packet_unref() when it is no
  * longer needed.
  *

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/af_aiir: calculate group delay too

2019-07-13 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Jul 13 15:43:17 
2019 +0200| [80dacbedbacfaaed5eeef96a2216921bd84d572c] | committer: Paul B Mahol

avfilter/af_aiir: calculate group delay too

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

 doc/filters.texi  |  2 +-
 libavfilter/af_aiir.c | 33 ++---
 2 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index c92ed8de07..3108ad349e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -1397,7 +1397,7 @@ How much to use filtered signal in output. Default is 1.
 Range is between 0 and 1.
 
 @item response
-Show IR frequency response, magnitude and phase in additional video stream.
+Show IR frequency response, magnitude(magenta), phase(green) and group 
delay(yellow) in additional video stream.
 By default it is disabled.
 
 @item channel
diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c
index b23aa3c868..ffe2606da6 100644
--- a/libavfilter/af_aiir.c
+++ b/libavfilter/af_aiir.c
@@ -721,8 +721,9 @@ static void draw_line(AVFrame *out, int x0, int y0, int x1, 
int y1, uint32_t col
 static void draw_response(AVFilterContext *ctx, AVFrame *out)
 {
 AudioIIRContext *s = ctx->priv;
-float *mag, *phase, min = FLT_MAX, max = FLT_MIN;
-int prev_ymag = -1, prev_yphase = -1;
+float *mag, *phase, *delay, min = FLT_MAX, max = FLT_MIN;
+float min_delay = FLT_MAX, max_delay = FLT_MIN;
+int prev_ymag = -1, prev_yphase = -1, prev_ydelay = -1;
 char text[32];
 int ch, i, x;
 
@@ -730,7 +731,8 @@ static void draw_response(AVFilterContext *ctx, AVFrame 
*out)
 
 phase = av_malloc_array(s->w, sizeof(*phase));
 mag = av_malloc_array(s->w, sizeof(*mag));
-if (!mag || !phase)
+delay = av_malloc_array(s->w, sizeof(*delay));
+if (!mag || !phase || !delay)
 goto end;
 
 ch = av_clip(s->ir_channel, 0, s->channels - 1);
@@ -795,23 +797,39 @@ static void draw_response(AVFilterContext *ctx, AVFrame 
*out)
 max = fmaxf(max, mag[i]);
 }
 
+for (i = 0; i < s->w - 1; i++) {
+float dw =  M_PI / (s->w - 1);
+
+delay[i] = -(phase[i + 1] - phase[i]) / dw;
+min_delay = fminf(min_delay, delay[i]);
+max_delay = fmaxf(max_delay, delay[i]);
+}
+
+delay[i] = delay[i - 1];
+
 for (i = 0; i < s->w; i++) {
 int ymag = mag[i] / max * (s->h - 1);
+int ydelay = (delay[i] - min_delay) / (max_delay - min_delay) * (s->h 
- 1);
 int yphase = (0.5 * (1. + phase[i] / M_PI)) * (s->h - 1);
 
 ymag = s->h - 1 - av_clip(ymag, 0, s->h - 1);
 yphase = s->h - 1 - av_clip(yphase, 0, s->h - 1);
+ydelay = s->h - 1 - av_clip(ydelay, 0, s->h - 1);
 
 if (prev_ymag < 0)
 prev_ymag = ymag;
 if (prev_yphase < 0)
 prev_yphase = yphase;
+if (prev_ydelay < 0)
+prev_ydelay = ydelay;
 
 draw_line(out, i,   ymag, FFMAX(i - 1, 0),   prev_ymag, 0x00FF);
 draw_line(out, i, yphase, FFMAX(i - 1, 0), prev_yphase, 0xFF00FF00);
+draw_line(out, i, ydelay, FFMAX(i - 1, 0), prev_ydelay, 0xFF00);
 
 prev_ymag   = ymag;
 prev_yphase = yphase;
+prev_ydelay = ydelay;
 }
 
 if (s->w > 400 && s->h > 100) {
@@ -822,9 +840,18 @@ static void draw_response(AVFilterContext *ctx, AVFrame 
*out)
 drawtext(out, 2, 12, "Min Magnitude:", 0x);
 snprintf(text, sizeof(text), "%.2f", min);
 drawtext(out, 15 * 8 + 2, 12, text, 0x);
+
+drawtext(out, 2, 22, "Max Delay:", 0x);
+snprintf(text, sizeof(text), "%.2f", max_delay);
+drawtext(out, 11 * 8 + 2, 22, text, 0x);
+
+drawtext(out, 2, 32, "Min Delay:", 0x);
+snprintf(text, sizeof(text), "%.2f", min_delay);
+drawtext(out, 11 * 8 + 2, 32, text, 0x);
 }
 
 end:
+av_free(delay);
 av_free(phase);
 av_free(mag);
 }

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] tools/target_dec_fuzzer: Remove redundant av_free()

2019-07-13 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Jul 11 22:31:57 2019 +0200| [9b5249a441a3581929329e8af1b63e20dc98c3d2] | 
committer: Michael Niedermayer

tools/target_dec_fuzzer: Remove redundant av_free()

Signed-off-by: Michael Niedermayer 

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

 tools/target_dec_fuzzer.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index f456db0e7b..e3ae3fd0ab 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -281,9 +281,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 
 av_frame_free();
 avcodec_free_context();
-av_freep();
 avcodec_free_context(_avctx);
-av_freep(_avctx);
 av_parser_close(parser);
 FDBDesroy();
 return 0;

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/huffyuv: remove gray8a (the format is listed but not supported by the implementation)

2019-07-13 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Jul  3 23:25:07 2019 +0200| [6aaa01afe4fb774d0767684aa00f075b0ee5fca6] | 
committer: Michael Niedermayer

avcodec/huffyuv: remove gray8a (the format is listed but not supported by the 
implementation)

Fixes: null pointer dereference
Fixes: 
15464/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5681391150301184

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

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

 libavcodec/huffyuvdec.c | 3 ---
 libavcodec/huffyuvenc.c | 2 --
 2 files changed, 5 deletions(-)

diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 27f650d7bf..771481fd03 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -418,9 +418,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
 case 0x0F0:
 avctx->pix_fmt = AV_PIX_FMT_GRAY16;
 break;
-case 0x170:
-avctx->pix_fmt = AV_PIX_FMT_GRAY8A;
-break;
 case 0x470:
 avctx->pix_fmt = AV_PIX_FMT_GBRP;
 break;
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index 3662c173ec..a6f0d06445 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -268,7 +268,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
 case AV_PIX_FMT_YUVA420P:
 case AV_PIX_FMT_YUVA422P:
 case AV_PIX_FMT_GBRAP:
-case AV_PIX_FMT_GRAY8A:
 case AV_PIX_FMT_YUV420P9:
 case AV_PIX_FMT_YUV420P10:
 case AV_PIX_FMT_YUV420P12:
@@ -1122,7 +1121,6 @@ AVCodec ff_ffvhuff_encoder = {
 AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
 AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA444P,
 AV_PIX_FMT_GBRAP,
-AV_PIX_FMT_GRAY8A,
 AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P12, 
AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV420P16,
 AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12, 
AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV422P16,
 AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12, 
AV_PIX_FMT_YUV444P14, AV_PIX_FMT_YUV444P16,

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/pngdec: Check that previous_picture has same w/h/format

2019-07-13 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Jul 10 23:02:36 2019 +0200| [18c808ffbed81ea580fe6ddd6524dd7bea3f8d0e] | 
committer: Michael Niedermayer

avcodec/pngdec: Check that previous_picture has same w/h/format

Fixes: out of array access
Fixes: 
15540/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5684905029140480

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

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

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

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 5209e342db..bf5a5191cc 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1391,6 +1391,9 @@ exit_loop:
 if (CONFIG_PNG_DECODER && avctx->codec_id != AV_CODEC_ID_APNG)
 handle_p_frame_png(s, p);
 else if (CONFIG_APNG_DECODER &&
+ s->previous_picture.f->width == p->width  &&
+ s->previous_picture.f->height== p->height &&
+ s->previous_picture.f->format== p->format &&
  avctx->codec_id == AV_CODEC_ID_APNG &&
  (ret = handle_p_frame_apng(avctx, s, p)) < 0)
 goto fail;

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/huffyuvdec: Check vertical subsampling in hymt

2019-07-13 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Jul  4 00:16:49 2019 +0200| [9ffa32b81bede1dbb167dfceb48fe605b27a0890] | 
committer: Michael Niedermayer

avcodec/huffyuvdec: Check vertical subsampling in hymt

Fixes: out of array access
Fixes: 
15484/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5765377054736384
Fixes: 
15559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5710295743332352

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

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

 libavcodec/huffyuvdec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 771481fd03..46dcfa8235 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -1252,6 +1252,7 @@ static int decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame,
 slice_height = AV_RL32(avpkt->data + buf_size - 8);
 nb_slices = AV_RL32(avpkt->data + buf_size - 12);
 if (nb_slices * 8LL + slices_info_offset > buf_size - 16 ||
+s->chroma_v_shift ||
 slice_height <= 0 || nb_slices * (uint64_t)slice_height > height)
 return AVERROR_INVALIDDATA;
 } else {

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/mpc8: Fixes invalid shift in mpc8_decode_frame()

2019-07-13 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Jul 11 20:02:24 2019 +0200| [1dbb67d39b21ed320edd2b1599b502518250cfd3] | 
committer: Michael Niedermayer

avcodec/mpc8: Fixes invalid shift in mpc8_decode_frame()

Fixes: left shift of negative value -456
Fixes: 
15561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPC8_fuzzer-5758130404720640

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

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

 libavcodec/mpc8.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c
index 3be2f79a5a..d7baac2f04 100644
--- a/libavcodec/mpc8.c
+++ b/libavcodec/mpc8.c
@@ -364,8 +364,9 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void 
*data,
 for(j = 0; j < SAMPLES_PER_BAND; j += SAMPLES_PER_BAND / 2){
 cnt = get_vlc2(gb, q1_vlc.table, MPC8_Q1_BITS, 2);
 t = mpc8_get_mask(gb, 18, cnt);
-for(k = 0; k < SAMPLES_PER_BAND / 2; k++, t <<= 1)
-c->Q[ch][off + j + k] = (t & 0x2) ? (get_bits1(gb) 
<< 1) - 1 : 0;
+for(k = 0; k < SAMPLES_PER_BAND / 2; k++)
+c->Q[ch][off + j + k] = t & (1 << (SAMPLES_PER_BAND / 
2 - k - 1))
+? (get_bits1(gb) << 1) - 1 : 0;
 }
 break;
 case 2:

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avfilter/af_aiir: do not ignore k option for audio filtering

2019-07-13 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Jul 13 12:25:54 
2019 +0200| [60e6db2f5bf6136ae4b603c3e5ee6697d47b1ef1] | committer: Paul B Mahol

avfilter/af_aiir: do not ignore k option for audio filtering

Previously it was used only for displaying frequency response.

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

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

diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c
index 5a3b9e849d..b23aa3c868 100644
--- a/libavfilter/af_aiir.c
+++ b/libavfilter/af_aiir.c
@@ -135,6 +135,7 @@ static int iir_ch_## name(AVFilterContext *ctx, void *arg, 
int ch, int nb_jobs)
 const int nb_b = s->iir[ch].nb_ab[1];   \
 const double *a = s->iir[ch].ab[0]; \
 const double *b = s->iir[ch].ab[1]; \
+const double g = s->iir[ch].g;  \
 int *clippings = >iir[ch].clippings; \
 type *dst = (type *)out->extended_data[ch]; \
 int n;  \
@@ -153,7 +154,7 @@ static int iir_ch_## name(AVFilterContext *ctx, void *arg, 
int ch, int nb_jobs)
 sample -= a[x] * oc[x]; \
 \
 oc[0] = sample; \
-sample *= og;   \
+sample *= og * g;   \
 sample = sample * mix + ic[0] * (1. - mix); \
 if (need_clipping && sample < min) {\
 (*clippings)++; \
@@ -186,6 +187,7 @@ static int iir_ch_serial_## name(AVFilterContext *ctx, void 
*arg, int ch, int nb
 const type *src = (const type *)in->extended_data[ch];  \
 type *dst = (type *)out->extended_data[ch]; \
 IIRChannel *iir = >iir[ch];  \
+const double g = iir->g;\
 int *clippings = >clippings;   \
 int nb_biquads = (FFMAX(iir->nb_ab[0], iir->nb_ab[1]) + 1) / 2; \
 int n, i;   \
@@ -209,7 +211,7 @@ static int iir_ch_serial_## name(AVFilterContext *ctx, void 
*arg, int ch, int nb
 i1 = src[n];\
 o2 = o1;\
 o1 = o0;\
-o0 *= og;   \
+o0 *= og * g;   \
 \
 o0 = o0 * mix + (1. - mix) * sample;\
 if (need_clipping && o0 < min) {\

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".