[FFmpeg-cvslog] avfilter/vf_tinterlace: fix mergex2, first frame is always considered odd

2020-07-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Jul 11 13:20:45 
2020 +0200| [d363afb30e9ccd4e9b7c139185ade9be65927d7b] | committer: Paul B Mahol

avfilter/vf_tinterlace: fix mergex2, first frame is always considered odd

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

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

diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index d145e35520..542b66898e 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -396,12 +396,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*picref)
 copy_picture_field(tinterlace, out->data, out->linesize,
(const uint8_t **)cur->data, cur->linesize,
inlink->format, inlink->w, inlink->h,
-   FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == 
MODE_MERGEX2 ? inlink->frame_count_out & 1 ? FIELD_LOWER : FIELD_UPPER : 
FIELD_UPPER, tinterlace->flags);
+   FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == 
MODE_MERGEX2 ? (1 + inlink->frame_count_out) & 1 ? FIELD_LOWER : FIELD_UPPER : 
FIELD_UPPER, tinterlace->flags);
 /* write even frame lines into the lower field of the new frame */
 copy_picture_field(tinterlace, out->data, out->linesize,
(const uint8_t **)next->data, next->linesize,
inlink->format, inlink->w, inlink->h,
-   FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == 
MODE_MERGEX2 ? inlink->frame_count_out & 1 ? FIELD_UPPER : FIELD_LOWER : 
FIELD_LOWER, tinterlace->flags);
+   FIELD_UPPER_AND_LOWER, 1, tinterlace->mode == 
MODE_MERGEX2 ? (1 + inlink->frame_count_out) & 1 ? FIELD_UPPER : FIELD_LOWER : 
FIELD_LOWER, tinterlace->flags);
 if (tinterlace->mode != MODE_MERGEX2)
 av_frame_free(&tinterlace->next);
 break;

___
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/vf_bilateral: stop using sigmaS as percent of width/height

2020-07-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Fri Jul 17 13:45:16 
2020 +0200| [241cdded0fc72102f32429cb3f8c0361c518f993] | committer: Paul B Mahol

avfilter/vf_bilateral: stop using sigmaS as percent of width/height

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

 doc/filters.texi   | 2 +-
 libavfilter/vf_bilateral.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 12d40029dc..74d1026bdf 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -6581,7 +6581,7 @@ The filter accepts the following options:
 @table @option
 @item sigmaS
 Set sigma of gaussian function to calculate spatial weight.
-Allowed range is 0 to 10. Default is 0.1.
+Allowed range is 0 to 512. Default is 0.1.
 
 @item sigmaR
 Set sigma of gaussian function to calculate range weight.
diff --git a/libavfilter/vf_bilateral.c b/libavfilter/vf_bilateral.c
index 3c9d8006d9..47959afdad 100644
--- a/libavfilter/vf_bilateral.c
+++ b/libavfilter/vf_bilateral.c
@@ -57,7 +57,7 @@ typedef struct BilateralContext {
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption bilateral_options[] = {
-{ "sigmaS", "set spatial sigma",OFFSET(sigmaS), AV_OPT_TYPE_FLOAT, 
{.dbl=0.1}, 0.0,  10, FLAGS },
+{ "sigmaS", "set spatial sigma",OFFSET(sigmaS), AV_OPT_TYPE_FLOAT, 
{.dbl=0.1}, 0.0, 512, FLAGS },
 { "sigmaR", "set range sigma",  OFFSET(sigmaR), AV_OPT_TYPE_FLOAT, 
{.dbl=0.1}, 0.0,   1, FLAGS },
 { "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT,   
{.i64=1}, 0, 0xF, FLAGS },
 { NULL }
@@ -145,7 +145,7 @@ static void bilateral_##name(BilateralContext *s, const 
uint8_t *ssrc, uint8_t *
 float *slice_factor_a = s->slice_factor_a, *slice_factor_b = 
s->slice_factor_b; \
 float *line_factor_a = s->line_factor_a, *line_factor_b = 
s->line_factor_b; \
 float *range_table = s->range_table;   
 \
-float alpha = expf(-sqrtf(2.f) / (sigma_spatial * width)); 
 \
+float alpha = expf(-sqrtf(2.f) / sigma_spatial);   
 \
 float ypr, ycr, *ycy, *ypy, *xcy, fp, fc;  
 \
 float inv_alpha_ = 1 - alpha;  
 \
 float *ycf, *ypf, *xcf, *in_factor;
 \
@@ -206,7 +206,7 @@ static void bilateral_##name(BilateralContext *s, const 
uint8_t *ssrc, uint8_t *
 }  
   \
 memcpy(img_out_f, img_temp, sizeof(float) * width);
   \

   \
-alpha = expf(-sqrtf(2.f) / (sigma_spatial * height));  
   \
+alpha = expf(-sqrtf(2.f) / sigma_spatial); 
   \
 inv_alpha_ = 1 - alpha;
   \
 in_factor = map_factor_a;  
   \
 memcpy(map_factor_b, in_factor, sizeof(float) * width);
   \

___
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/vf_bilateral: remove useless memcpy

2020-07-17 Thread leozhang
ffmpeg | branch: master | leozhang  | Wed Oct 30 11:07:12 
2019 +0800| [fe591393cd9f0fa130631ac7695420d4cac60d46] | committer: Paul B Mahol

avfilter/vf_bilateral: remove useless memcpy

Signed-off-by: leozhang 

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

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

diff --git a/libavfilter/vf_bilateral.c b/libavfilter/vf_bilateral.c
index 47959afdad..3025b49ae5 100644
--- a/libavfilter/vf_bilateral.c
+++ b/libavfilter/vf_bilateral.c
@@ -277,8 +277,8 @@ static void bilateral_##name(BilateralContext *s, const 
uint8_t *ssrc, uint8_t *
 factor_++; 
   \
 }  
   \

   \
-memcpy(ypy, ycy, sizeof(float) * width);   
   \
-memcpy(ypf, ycf, sizeof(float) * width);   
   \
+ypy = ycy; 
   \
+ypf = ycf; 
   \
 }  
   \

   \
 for (int i = 0; i < height; i++)   
   \

___
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/vf_tinterlace: use frame counter from lavfi

2020-07-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Jul 11 13:20:02 
2020 +0200| [24fea4d09b6f90df28c0cd9aaadb9a1020642837] | committer: Paul B Mahol

avfilter/vf_tinterlace: use frame counter from lavfi

Remove internal counter.

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

 libavfilter/tinterlace.h| 1 -
 libavfilter/vf_tinterlace.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h
index 020887ff34..4059ebf81a 100644
--- a/libavfilter/tinterlace.h
+++ b/libavfilter/tinterlace.h
@@ -67,7 +67,6 @@ typedef struct TInterlaceContext {
 AVRational preout_time_base;
 int flags;  ///< flags affecting interlacing algorithm
 int lowpass;///< legacy interlace filter lowpass mode
-int frame;  ///< number of the output frame
 int vsub;   ///< chroma vertical subsampling
 AVFrame *cur;
 AVFrame *next;
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index a77753775c..d145e35520 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -423,7 +423,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*picref)
 out->height = outlink->h;
 out->sample_aspect_ratio = av_mul_q(cur->sample_aspect_ratio, 
av_make_q(2, 1));
 
-field = (1 + tinterlace->frame) & 1 ? FIELD_UPPER : FIELD_LOWER;
+field = (1 + outlink->frame_count_in) & 1 ? FIELD_UPPER : FIELD_LOWER;
 /* copy upper and lower fields */
 copy_picture_field(tinterlace, out->data, out->linesize,
(const uint8_t **)cur->data, cur->linesize,
@@ -517,7 +517,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*picref)
 
 out->pts = av_rescale_q(out->pts, tinterlace->preout_time_base, 
outlink->time_base);
 ret = ff_filter_frame(outlink, out);
-tinterlace->frame++;
 
 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] avfilter/avf_showwavespic: add filter mode

2020-07-17 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Fri Jul 17 14:25:13 
2020 +0200| [3a37aa597fab22f321da94dccfa3ad61cc94f1f4] | committer: Paul B Mahol

avfilter/avf_showwavespic: add filter mode

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

 doc/filters.texi| 14 ++
 libavfilter/avf_showwaves.c | 25 ++---
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 74d1026bdf..9c49009465 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -25483,6 +25483,20 @@ Draw every sample directly.
 @end table
 
 Default value is @code{scale}.
+
+@item filter
+Set the filter mode.
+
+Available values are:
+@table @samp
+@item average
+Use average samples values for each drawn sample.
+
+@item peak
+Use peak samples values for each drawn sample.
+@end table
+
+Default value is @code{average}.
 @end table
 
 @subsection Examples
diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c
index afe05fb504..cf784604d9 100644
--- a/libavfilter/avf_showwaves.c
+++ b/libavfilter/avf_showwaves.c
@@ -57,6 +57,12 @@ enum ShowWavesDrawMode {
 DRAW_NB,
 };
 
+enum ShowWavesFilterMode {
+FILTER_AVERAGE,
+FILTER_PEAK,
+FILTER_NB,
+};
+
 struct frame_node {
 AVFrame *frame;
 struct frame_node *next;
@@ -77,6 +83,7 @@ typedef struct ShowWavesContext {
 int scale;  ///< ShowWavesScale
 int draw_mode;  ///< ShowWavesDrawMode
 int split_channels;
+int filter_mode;
 uint8_t *fg;
 
 int (*get_h)(int16_t sample, int height);
@@ -590,12 +597,21 @@ static int push_single_pic(AVFilterLink *outlink)
 int64_t max_samples = col == outlink->w - 1 ? last_column_samples: 
column_max_samples;
 int ch;
 
-for (ch = 0; ch < nb_channels; ch++)
-sum[ch] += abs(p[ch + i*nb_channels]) << 1;
+switch (showwaves->filter_mode) {
+case FILTER_AVERAGE:
+for (ch = 0; ch < nb_channels; ch++)
+sum[ch] += abs(p[ch + i*nb_channels]) << 1;
+break;
+case FILTER_PEAK:
+for (ch = 0; ch < nb_channels; ch++)
+sum[ch] = FFMAX(sum[ch], abs(p[ch + i*nb_channels]));
+break;
+}
+
 n++;
 if (n == max_samples) {
 for (ch = 0; ch < nb_channels; ch++) {
-int16_t sample = sum[ch] / max_samples;
+int16_t sample = sum[ch] / (showwaves->filter_mode == 
FILTER_AVERAGE ? max_samples : 1);
 uint8_t *buf = out->data[0] + col * pixstep;
 int h;
 
@@ -792,6 +808,9 @@ static const AVOption showwavespic_options[] = {
 { "draw", "set draw mode", OFFSET(draw_mode), AV_OPT_TYPE_INT, {.i64 = 
DRAW_SCALE}, 0, DRAW_NB-1, FLAGS, .unit="draw" },
 { "scale", "scale pixel values for each drawn sample", 0, 
AV_OPT_TYPE_CONST, {.i64=DRAW_SCALE}, .flags=FLAGS, .unit="draw"},
 { "full",  "draw every pixel for sample directly", 0, 
AV_OPT_TYPE_CONST, {.i64=DRAW_FULL},  .flags=FLAGS, .unit="draw"},
+{ "filter", "set filter mode", OFFSET(filter_mode), AV_OPT_TYPE_INT, {.i64 
= FILTER_AVERAGE}, 0, FILTER_NB-1, FLAGS, .unit="filter" },
+{ "average", "use average samples", 0, AV_OPT_TYPE_CONST, 
{.i64=FILTER_AVERAGE}, .flags=FLAGS, .unit="filter"},
+{ "peak","use peak samples",0, AV_OPT_TYPE_CONST, 
{.i64=FILTER_PEAK},.flags=FLAGS, .unit="filter"},
 { NULL }
 };
 

___
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] x86/yuv2rgb: fix crashes when storing data on unaligned buffers

2020-07-17 Thread James Almer
ffmpeg | branch: release/4.3 | James Almer  | Sun Jul 12 
21:32:01 2020 -0300| [799fc4d732fc2515911b75fe816da2bbd20221d9] | committer: 
James Almer

x86/yuv2rgb: fix crashes when storing data on unaligned buffers

Regression since fc6a5883d6af8cae0e96af84dda0ad74b360a084 on SSSE3 enabled
CPUs.

Fixes ticket #8747

Signed-off-by: James Almer 
(cherry picked from commit ba3e771a42c29ee02c34e7769cfc1b2dbc5c760a)

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

 libswscale/x86/yuv_2_rgb.asm | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libswscale/x86/yuv_2_rgb.asm b/libswscale/x86/yuv_2_rgb.asm
index 575a84d921..003dff1f25 100644
--- a/libswscale/x86/yuv_2_rgb.asm
+++ b/libswscale/x86/yuv_2_rgb.asm
@@ -268,9 +268,9 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters
 porm2, m7
 porm1, m6  ; g5  b5  r6  g6  b6  r7  g7  b7  r8  g8  b8  r9  
g9  b9  r10 g10
 porm2, m3  ; b10 r11 g11 b11 r12 g12 b12 r13 g13 b13 r14 g14 
b14 r15 g15 b15
-mova [imageq], m0
-mova [imageq + 16], m1
-mova [imageq + 32], m2
+movu [imageq], m0
+movu [imageq + 16], m1
+movu [imageq + 32], m2
 %endif ; mmsize = 16
 %else ; PACK RGB15/16/32
 packuswb m0, m1
@@ -300,10 +300,10 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters
 punpckhwd m_green, m_red
 punpcklwd m5, m6
 punpckhwd m_alpha, m6
-mova [imageq + 0], m_blue
-mova [imageq + 8  * time_num], m_green
-mova [imageq + 16 * time_num], m5
-mova [imageq + 24 * time_num], m_alpha
+movu [imageq + 0], m_blue
+movu [imageq + 8  * time_num], m_green
+movu [imageq + 16 * time_num], m5
+movu [imageq + 24 * time_num], m_alpha
 %else ; PACK RGB15/16
 %define depth 2
 %if cpuflag(ssse3)
@@ -342,8 +342,8 @@ cglobal %1_420_%2%3, GPR_num, GPR_num, reg_num, parameters
 mova m2, m0
 punpcklbw m0, m1
 punpckhbw m2, m1
-mova [imageq], m0
-mova [imageq + 8 * time_num], m2
+movu [imageq], m0
+movu [imageq + 8 * time_num], m2
 %endif ; PACK RGB15/16
 %endif ; PACK RGB15/16/32
 

___
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/libx264: use a function to parse x264opts

2020-07-17 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Jul 10 17:10:33 
2020 -0300| [d1bd079d1144d1d882cf9a1ec8883388526e4604] | committer: James Almer

avcodec/libx264: use a function to parse x264opts

This is needed for the following patch.

Signed-off-by: James Almer 

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

 libavcodec/libx264.c | 44 
 1 file changed, 28 insertions(+), 16 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index d4b1fd0d53..4a82e1ba25 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -519,19 +519,25 @@ static av_cold int X264_close(AVCodecContext *avctx)
 return 0;
 }
 
-#define OPT_STR(opt, param)   \
-do {  \
-int ret;  \
-if ((ret = x264_param_parse(&x4->params, opt, param)) < 0) { \
-if(ret == X264_PARAM_BAD_NAME)\
-av_log(avctx, AV_LOG_ERROR,   \
-"bad option '%s': '%s'\n", opt, param);   \
-else  \
-av_log(avctx, AV_LOG_ERROR,   \
-"bad value for '%s': '%s'\n", opt, param);\
-return -1;\
-} \
-} while (0)
+static int parse_opts(AVCodecContext *avctx, const char *opt, const char 
*param)
+{
+X264Context *x4 = avctx->priv_data;
+int ret;
+
+if ((ret = x264_param_parse(&x4->params, opt, param)) < 0) {
+if (ret == X264_PARAM_BAD_NAME) {
+av_log(avctx, AV_LOG_ERROR,
+   "bad option '%s': '%s'\n", opt, param);
+ret = AVERROR(EINVAL);
+} else {
+av_log(avctx, AV_LOG_ERROR,
+   "bad value for '%s': '%s'\n", opt, param);
+ret = AVERROR(EINVAL);
+}
+}
+
+return ret;
+}
 
 static int convert_pix_fmt(enum AVPixelFormat pix_fmt)
 {
@@ -581,6 +587,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
 X264Context *x4 = avctx->priv_data;
 AVCPBProperties *cpb_props;
 int sw,sh;
+int ret;
 
 if (avctx->global_quality > 0)
 av_log(avctx, AV_LOG_WARNING, "-qscale is ignored, -crf is 
recommended.\n");
@@ -890,9 +897,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
 while(p){
 char param[4096]={0}, val[4096]={0};
 if(sscanf(p, "%4095[^:=]=%4095[^:]", param, val) == 1){
-OPT_STR(param, "1");
-}else
-OPT_STR(param, val);
+ret = parse_opts(avctx, param, "1");
+if (ret < 0)
+return ret;
+} else {
+ret = parse_opts(avctx, param, val);
+if (ret < 0)
+return ret;
+}
 p= strchr(p, ':');
 p+=!!p;
 }

___
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/libx264: check for param allocation failure error code

2020-07-17 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Jul 10 17:16:49 
2020 -0300| [03ad76794e23bbbc2a9aafeef631efcc5f91435e] | committer: James Almer

avcodec/libx264: check for param allocation failure error code

And return the proper AVERROR value.

Signed-off-by: James Almer 

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

 libavcodec/libx264.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4a82e1ba25..479dfe323c 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -529,6 +529,12 @@ static int parse_opts(AVCodecContext *avctx, const char 
*opt, const char *param)
 av_log(avctx, AV_LOG_ERROR,
"bad option '%s': '%s'\n", opt, param);
 ret = AVERROR(EINVAL);
+#if X264_BUILD >= 161
+} else if (ret == X264_PARAM_ALLOC_FAILED) {
+av_log(avctx, AV_LOG_ERROR,
+   "out of memory parsing option '%s': '%s'\n", opt, param);
+ret = AVERROR(ENOMEM);
+#endif
 } else {
 av_log(avctx, AV_LOG_ERROR,
"bad value for '%s': '%s'\n", opt, param);
@@ -914,10 +920,15 @@ FF_ENABLE_DEPRECATION_WARNINGS
 {
 AVDictionaryEntry *en = NULL;
 while (en = av_dict_get(x4->x264_params, "", en, 
AV_DICT_IGNORE_SUFFIX)) {
-   if (x264_param_parse(&x4->params, en->key, en->value) < 0)
+   if ((ret = x264_param_parse(&x4->params, en->key, en->value)) < 0) {
av_log(avctx, AV_LOG_WARNING,
   "Error parsing option '%s = %s'.\n",
en->key, en->value);
+#if X264_BUILD >= 161
+   if (ret == X264_PARAM_ALLOC_FAILED)
+   return AVERROR(ENOMEM);
+#endif
+   }
 }
 }
 

___
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/libx264: call x264_param_cleanup() if available

2020-07-17 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Jul 10 17:47:57 
2020 -0300| [890f2e960ac67af102c0a98af1e5c45ff3274ae5] | committer: James Almer

avcodec/libx264: call x264_param_cleanup() if available

The documentation states it should be used to free any memory allocated
by x264_param_parse().

Signed-off-by: James Almer 

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

 libavcodec/libx264.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 479dfe323c..7bbeab7d4c 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -511,6 +511,10 @@ static av_cold int X264_close(AVCodecContext *avctx)
 av_freep(&x4->sei);
 av_freep(&x4->reordered_opaque);
 
+#if X264_BUILD >= 161
+x264_param_cleanup(&x4->params);
+#endif
+
 if (x4->enc) {
 x264_encoder_close(x4->enc);
 x4->enc = NULL;

___
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] MAINTAINERS: add myself and gpg fingerprint

2020-07-17 Thread Zane van Iperen
ffmpeg | branch: master | Zane van Iperen  | Tue Jul  7 
15:26:38 2020 +| [dabac26fa56ecd6d1ae381091182c300afa1995c] | committer: 
Michael Niedermayer

MAINTAINERS: add myself and gpg fingerprint

Signed-off-by: Zane van Iperen 
Signed-off-by: Michael Niedermayer 

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

 MAINTAINERS | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 02af52101e..30c2ec59e6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -393,7 +393,10 @@ Muxers/Demuxers:
   afc.c Paul B Mahol
   aiffdec.c Baptiste Coudurier, Matthieu Bouron
   aiffenc.c Baptiste Coudurier, Matthieu Bouron
+  alp.c Zane van Iperen
+  apm.c Zane van Iperen
   apngdec.c Benoit Fouet
+  argo_asf.cZane van Iperen
   ass*  Aurelien Jacobs
   astdec.c  Paul B Mahol
   astenc.c  James Almer
@@ -431,6 +434,7 @@ Muxers/Demuxers:
   ircam*Paul B Mahol
   iss.c Stefan Gehrer
   jvdec.c   Peter Ross
+  kvag.cZane van Iperen
   libmodplug.c  Clément Bœsch
   libopenmpt.c  Josh de Kock
   lmlm4.c   Ivo van Poorten
@@ -463,6 +467,7 @@ Muxers/Demuxers:
   oggparse*.c   David Conrad
   oma.c Maxim Poliakovski
   paf.c Paul B Mahol
+  pp_bnk.c  Zane van Iperen
   psxstr.c  Mike Melanson
   pva.c Ivo van Poorten
   pvfdec.c  Paul B Mahol
@@ -629,3 +634,4 @@ Tiancheng "Timothy" Gu9456 AFC0 814A 8139 E994 8351 
7FE6 B095 B582 B0D4
 Tim Nicholson 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
 Tomas Härdin (thardin)A79D 4E3D F38F 763F 91F5 8B33 A01E 8AE0 41BB 2551
 Wei Gao   4269 7741 857A 0E60 9EC5 08D2 4744 4EFA 62C1 87B9
+Zane van Iperen (zane)61AE D40F 368B 6F26 9DAE 3892 6861 6B2D 8AC4 DCC5

___
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] libaomenc: enable 8, 10 and 12 bit RGB encoding

2020-07-17 Thread Lynne
ffmpeg | branch: master | Lynne  | Thu Jul 16 11:39:05 2020 
+0100| [6a2f3f60ae02c8c3c62645b1d54ecc86bb21080d] | committer: Lynne

libaomenc: enable 8, 10 and 12 bit RGB encoding

RGB pixel formats are one occasion where by pixel format we mean
pixel format, primaries, transfer characteristic, and matrix coeffs,
so we have to manually set them as they're set to unspecified by
default, despite there only being a single possible combination.

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

 libavcodec/libaomenc.c | 26 +-
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 2ecb3de3a7..0d6a376ef0 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -310,6 +310,7 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
 *img_fmt = AOM_IMG_FMT_I422;
 return 0;
 case AV_PIX_FMT_YUV444P:
+case AV_PIX_FMT_GBRP:
 enccfg->g_profile = FF_PROFILE_AV1_HIGH;
 *img_fmt = AOM_IMG_FMT_I444;
 return 0;
@@ -338,9 +339,13 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
 break;
 case AV_PIX_FMT_YUV444P10:
 case AV_PIX_FMT_YUV444P12:
+case AV_PIX_FMT_GBRP10:
+case AV_PIX_FMT_GBRP12:
 if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
-enccfg->g_bit_depth = enccfg->g_input_bit_depth =
-avctx->pix_fmt == AV_PIX_FMT_YUV444P10 ? 10 : 12;
+enccfg->g_bit_depth = enccfg->g_input_bit_depth = 10;
+if (avctx->pix_fmt == AV_PIX_FMT_YUV444P12 ||
+avctx->pix_fmt == AV_PIX_FMT_GBRP12)
+enccfg->g_bit_depth = enccfg->g_input_bit_depth = 12;
 enccfg->g_profile =
 enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_HIGH : 
FF_PROFILE_AV1_PROFESSIONAL;
 *img_fmt = AOM_IMG_FMT_I44416;
@@ -749,9 +754,16 @@ static av_cold int aom_init(AVCodecContext *avctx,
 if (ctx->tune >= 0)
 codecctl_int(avctx, AOME_SET_TUNING, ctx->tune);
 
-codecctl_int(avctx, AV1E_SET_COLOR_PRIMARIES, avctx->color_primaries);
-codecctl_int(avctx, AV1E_SET_MATRIX_COEFFICIENTS, avctx->colorspace);
-codecctl_int(avctx, AV1E_SET_TRANSFER_CHARACTERISTICS, avctx->color_trc);
+if (avctx->pix_fmt == AV_PIX_FMT_GBRP || avctx->pix_fmt == 
AV_PIX_FMT_GBRP10 ||
+avctx->pix_fmt == AV_PIX_FMT_GBRP12) {
+codecctl_int(avctx, AV1E_SET_COLOR_PRIMARIES, AVCOL_PRI_BT709);
+codecctl_int(avctx, AV1E_SET_MATRIX_COEFFICIENTS, AVCOL_SPC_RGB);
+codecctl_int(avctx, AV1E_SET_TRANSFER_CHARACTERISTICS, 
AVCOL_TRC_IEC61966_2_1);
+} else {
+codecctl_int(avctx, AV1E_SET_COLOR_PRIMARIES, avctx->color_primaries);
+codecctl_int(avctx, AV1E_SET_MATRIX_COEFFICIENTS, avctx->colorspace);
+codecctl_int(avctx, AV1E_SET_TRANSFER_CHARACTERISTICS, 
avctx->color_trc);
+}
 if (ctx->aq_mode >= 0)
 codecctl_int(avctx, AV1E_SET_AQ_MODE, ctx->aq_mode);
 if (ctx->frame_parallel >= 0)
@@ -1077,6 +1089,7 @@ static const enum AVPixelFormat av1_pix_fmts[] = {
 AV_PIX_FMT_YUV420P,
 AV_PIX_FMT_YUV422P,
 AV_PIX_FMT_YUV444P,
+AV_PIX_FMT_GBRP,
 AV_PIX_FMT_NONE
 };
 
@@ -1084,12 +1097,15 @@ static const enum AVPixelFormat av1_pix_fmts_highbd[] = 
{
 AV_PIX_FMT_YUV420P,
 AV_PIX_FMT_YUV422P,
 AV_PIX_FMT_YUV444P,
+AV_PIX_FMT_GBRP,
 AV_PIX_FMT_YUV420P10,
 AV_PIX_FMT_YUV422P10,
 AV_PIX_FMT_YUV444P10,
 AV_PIX_FMT_YUV420P12,
 AV_PIX_FMT_YUV422P12,
 AV_PIX_FMT_YUV444P12,
+AV_PIX_FMT_GBRP10,
+AV_PIX_FMT_GBRP12,
 AV_PIX_FMT_NONE
 };
 

___
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/libaomenc: use pix_fmt descriptors where useful

2020-07-17 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri Jul 17 17:46:32 
2020 -0300| [36e51c190bb9cca4bb846e7dae4aebc6570ff258] | committer: James Almer

avcodec/libaomenc: use pix_fmt descriptors where useful

Reviewed-by: Lynne 
Signed-off-by: James Almer 

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

 libavcodec/libaomenc.c | 15 ---
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index 0d6a376ef0..b65e491824 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -299,7 +299,8 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
aom_img_fmt_t *img_fmt)
 {
 AOMContext av_unused *ctx = avctx->priv_data;
-enccfg->g_bit_depth = enccfg->g_input_bit_depth = 8;
+const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
+enccfg->g_bit_depth = enccfg->g_input_bit_depth = desc->comp[0].depth;
 switch (avctx->pix_fmt) {
 case AV_PIX_FMT_YUV420P:
 enccfg->g_profile = FF_PROFILE_AV1_MAIN;
@@ -317,8 +318,6 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
 case AV_PIX_FMT_YUV420P10:
 case AV_PIX_FMT_YUV420P12:
 if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
-enccfg->g_bit_depth = enccfg->g_input_bit_depth =
-avctx->pix_fmt == AV_PIX_FMT_YUV420P10 ? 10 : 12;
 enccfg->g_profile =
 enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_MAIN : 
FF_PROFILE_AV1_PROFESSIONAL;
 *img_fmt = AOM_IMG_FMT_I42016;
@@ -329,8 +328,6 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
 case AV_PIX_FMT_YUV422P10:
 case AV_PIX_FMT_YUV422P12:
 if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
-enccfg->g_bit_depth = enccfg->g_input_bit_depth =
-avctx->pix_fmt == AV_PIX_FMT_YUV422P10 ? 10 : 12;
 enccfg->g_profile = FF_PROFILE_AV1_PROFESSIONAL;
 *img_fmt = AOM_IMG_FMT_I42216;
 *flags |= AOM_CODEC_USE_HIGHBITDEPTH;
@@ -342,10 +339,6 @@ static int set_pix_fmt(AVCodecContext *avctx, 
aom_codec_caps_t codec_caps,
 case AV_PIX_FMT_GBRP10:
 case AV_PIX_FMT_GBRP12:
 if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
-enccfg->g_bit_depth = enccfg->g_input_bit_depth = 10;
-if (avctx->pix_fmt == AV_PIX_FMT_YUV444P12 ||
-avctx->pix_fmt == AV_PIX_FMT_GBRP12)
-enccfg->g_bit_depth = enccfg->g_input_bit_depth = 12;
 enccfg->g_profile =
 enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_HIGH : 
FF_PROFILE_AV1_PROFESSIONAL;
 *img_fmt = AOM_IMG_FMT_I44416;
@@ -543,6 +536,7 @@ static av_cold int aom_init(AVCodecContext *avctx,
 const struct aom_codec_iface *iface)
 {
 AOMContext *ctx = avctx->priv_data;
+const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
 struct aom_codec_enc_cfg enccfg = { 0 };
 #ifdef AOM_FRAME_IS_INTRAONLY
 aom_codec_flags_t flags =
@@ -754,8 +748,7 @@ static av_cold int aom_init(AVCodecContext *avctx,
 if (ctx->tune >= 0)
 codecctl_int(avctx, AOME_SET_TUNING, ctx->tune);
 
-if (avctx->pix_fmt == AV_PIX_FMT_GBRP || avctx->pix_fmt == 
AV_PIX_FMT_GBRP10 ||
-avctx->pix_fmt == AV_PIX_FMT_GBRP12) {
+if (desc->flags & AV_PIX_FMT_FLAG_RGB) {
 codecctl_int(avctx, AV1E_SET_COLOR_PRIMARIES, AVCOL_PRI_BT709);
 codecctl_int(avctx, AV1E_SET_MATRIX_COEFFICIENTS, AVCOL_SPC_RGB);
 codecctl_int(avctx, AV1E_SET_TRANSFER_CHARACTERISTICS, 
AVCOL_TRC_IEC61966_2_1);

___
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".