[FFmpeg-cvslog] cbs_h2645: Improve performance of writing slices

2018-11-11 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt 
 | Sun Nov 11 23:43:05 2018 +0100| 
[ee47ac97d7938fc221d1d386e3e520a5521cddfd] | committer: Mark Thompson

cbs_h2645: Improve performance of writing slices

Instead of using a combination of bitreader and -writer for copying data,
one can byte-align the (obsolete and removed) bitreader to improve performance.
With the right alignment one can even use memcpy. The right alignment
normally exists for CABAC and hence for H.265 in general.
For aligned data this reduced the time to copy the slicedata from
776520 decicycles to 33889 with 262144 runs and a 6.5mb/s H.264 video.
For unaligned data the number went down from 279196 to 97739 decicycles.

Signed-off-by: Mark Thompson 

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

 libavcodec/cbs_h2645.c | 118 -
 1 file changed, 68 insertions(+), 50 deletions(-)

diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index e55bd00183..53d9bfed79 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -1050,6 +1050,64 @@ static int cbs_h265_read_nal_unit(CodedBitstreamContext 
*ctx,
 return 0;
 }
 
+static int cbs_h2645_write_slice_data(CodedBitstreamContext *ctx,
+  PutBitContext *pbc, const uint8_t *data,
+  size_t data_size, int data_bit_start)
+{
+size_t rest  = data_size - (data_bit_start + 7) / 8;
+const uint8_t *pos = data + data_bit_start / 8;
+
+av_assert0(data_bit_start >= 0 &&
+   8 * data_size > data_bit_start);
+
+if (data_size * 8 + 8 > put_bits_left(pbc))
+return AVERROR(ENOSPC);
+
+if (!rest)
+goto rbsp_stop_one_bit;
+
+// First copy the remaining bits of the first byte
+// The above check ensures that we do not accidentally
+// copy beyond the rbsp_stop_one_bit.
+if (data_bit_start % 8)
+put_bits(pbc, 8 - data_bit_start % 8,
+ *pos++ & MAX_UINT_BITS(8 - data_bit_start % 8));
+
+if (put_bits_count(pbc) % 8 == 0) {
+// If the writer is aligned at this point,
+// memcpy can be used to improve performance.
+// This happens normally for CABAC.
+flush_put_bits(pbc);
+memcpy(put_bits_ptr(pbc), pos, rest);
+skip_put_bytes(pbc, rest);
+} else {
+// If not, we have to copy manually.
+// rbsp_stop_one_bit forces us to special-case
+// the last byte.
+uint8_t temp;
+int i;
+
+for (; rest > 4; rest -= 4, pos += 4)
+put_bits32(pbc, AV_RB32(pos));
+
+for (; rest > 1; rest--, pos++)
+put_bits(pbc, 8, *pos);
+
+rbsp_stop_one_bit:
+temp = rest ? *pos : *pos & MAX_UINT_BITS(8 - data_bit_start % 8);
+
+av_assert0(temp);
+i = ff_ctz(*pos);
+temp = temp >> i;
+i = rest ? (8 - i) : (8 - i - data_bit_start % 8);
+put_bits(pbc, i, temp);
+if (put_bits_count(pbc) % 8)
+put_bits(pbc, 8 - put_bits_count(pbc) % 8, 0);
+}
+
+return 0;
+}
+
 static int cbs_h264_write_nal_unit(CodedBitstreamContext *ctx,
CodedBitstreamUnit *unit,
PutBitContext *pbc)
@@ -1100,37 +1158,17 @@ static int 
cbs_h264_write_nal_unit(CodedBitstreamContext *ctx,
 case H264_NAL_AUXILIARY_SLICE:
 {
 H264RawSlice *slice = unit->content;
-GetBitContext gbc;
-int bits_left, end, zeroes;
 
 err = cbs_h264_write_slice_header(ctx, pbc, >header);
 if (err < 0)
 return err;
 
 if (slice->data) {
-if (slice->data_size * 8 + 8 > put_bits_left(pbc))
-return AVERROR(ENOSPC);
-
-init_get_bits(, slice->data, slice->data_size * 8);
-skip_bits_long(, slice->data_bit_start);
-
-// Copy in two-byte blocks, but stop before copying the
-// rbsp_stop_one_bit in the final byte.
-while (get_bits_left() > 23)
-put_bits(pbc, 16, get_bits(, 16));
-
-bits_left = get_bits_left();
-end = get_bits(, bits_left);
-
-// rbsp_stop_one_bit must be present here.
-av_assert0(end);
-zeroes = ff_ctz(end);
-if (bits_left > zeroes + 1)
-put_bits(pbc, bits_left - zeroes - 1,
- end >> (zeroes + 1));
-put_bits(pbc, 1, 1);
-while (put_bits_count(pbc) % 8 != 0)
-put_bits(pbc, 1, 0);
+err = cbs_h2645_write_slice_data(ctx, pbc, slice->data,
+ slice->data_size,
+ slice->data_bit_start);
+if (err < 0)

[FFmpeg-cvslog] fate/prores_metadata : fix md5 value

2018-11-11 Thread Martin Vignali
ffmpeg | branch: master | Martin Vignali  | Sun Nov 
11 21:40:08 2018 +0100| [752bf1f64c4c8b7fdfd15068151169578fe561aa] | committer: 
Martin Vignali

fate/prores_metadata : fix md5 value

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

 tests/ref/fate/prores-metadata | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ref/fate/prores-metadata b/tests/ref/fate/prores-metadata
index e34b3bb1b7..7ca177489b 100644
--- a/tests/ref/fate/prores-metadata
+++ b/tests/ref/fate/prores-metadata
@@ -1 +1 @@
-84814393e25b673e8ebd6a94f3d07349
+b4e2c801d594b9614433b284b886be0d

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


[FFmpeg-cvslog] avfilter/af_afftfilt: add more window types

2018-11-11 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Nov 11 21:21:14 
2018 +0100| [d03030c0710995b31b70f9026a6b9f8d0d0deea9] | committer: Paul B Mahol

avfilter/af_afftfilt: add more window types

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

 libavfilter/af_afftfilt.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/libavfilter/af_afftfilt.c b/libavfilter/af_afftfilt.c
index 805866fad0..d5e3b7f500 100644
--- a/libavfilter/af_afftfilt.c
+++ b/libavfilter/af_afftfilt.c
@@ -82,7 +82,22 @@ static const AVOption afftfilt_options[] = {
 { "hann", "Hann", 0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_HANNING},  0, 0, A, "win_func" },
 { "hanning",  "Hanning",  0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_HANNING},  0, 0, A, "win_func" },
 { "hamming",  "Hamming",  0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_HAMMING},  0, 0, A, "win_func" },
+{ "blackman", "Blackman", 0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_BLACKMAN}, 0, 0, A, "win_func" },
+{ "welch","Welch",0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_WELCH},0, 0, A, "win_func" },
+{ "flattop",  "Flat-top", 0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_FLATTOP},  0, 0, A, "win_func" },
+{ "bharris",  "Blackman-Harris",  0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_BHARRIS},  0, 0, A, "win_func" },
+{ "bnuttall", "Blackman-Nuttall", 0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_BNUTTALL}, 0, 0, A, "win_func" },
+{ "bhann","Bartlett-Hann",0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_BHANN},0, 0, A, "win_func" },
 { "sine", "Sine", 0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_SINE}, 0, 0, A, "win_func" },
+{ "nuttall",  "Nuttall",  0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_NUTTALL},  0, 0, A, "win_func" },
+{ "lanczos",  "Lanczos",  0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_LANCZOS},  0, 0, A, "win_func" },
+{ "gauss","Gauss",0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_GAUSS},0, 0, A, "win_func" },
+{ "tukey","Tukey",0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_TUKEY},0, 0, A, "win_func" },
+{ "dolph","Dolph-Chebyshev",  0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_DOLPH},0, 0, A, "win_func" },
+{ "cauchy",   "Cauchy",   0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_CAUCHY},   0, 0, A, "win_func" },
+{ "parzen",   "Parzen",   0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_PARZEN},   0, 0, A, "win_func" },
+{ "poisson",  "Poisson",  0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_POISSON},  0, 0, A, "win_func" },
+{ "bohman",   "Bohman",   0, AV_OPT_TYPE_CONST, 
{.i64=WFUNC_BOHMAN},   0, 0, A, "win_func" },
 { "overlap", "set window overlap", OFFSET(overlap), AV_OPT_TYPE_FLOAT, 
{.dbl=0.75}, 0,  1, A },
 { NULL },
 };

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


[FFmpeg-cvslog] avfilter/af_afftfilt: extend filter functionality

2018-11-11 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Nov 11 21:11:30 
2018 +0100| [bdc66c50dd6974a12a2881a9b5d43f41629fa67c] | committer: Paul B Mahol

avfilter/af_afftfilt: extend filter functionality

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

 doc/filters.texi  | 16 --
 libavfilter/af_afftfilt.c | 75 +--
 2 files changed, 74 insertions(+), 17 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index fb1dd8f353..0d9ff43ef0 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -1082,7 +1082,7 @@ Set frequency domain imaginary expression for each 
separate channel
 separated by '|'. If not set, @var{real} option is used.
 
 Each expression in @var{real} and @var{imag} can contain the following
-constants:
+constants and functions:
 
 @table @option
 @item sr
@@ -1102,6 +1102,18 @@ number of channels
 
 @item pts
 current frame pts
+
+@item re
+current real part of frequency bin
+
+@item im
+current imaginary part of frequency bin
+
+@item real(b, ch)
+Return the value of real part of frequency bin at location 
(@var{bin},@var{channel})
+
+@item imag(b, ch)
+Return the value of imaginary part of frequency bin at location 
(@var{bin},@var{channel})
 @end table
 
 @item win_size
@@ -1139,7 +1151,7 @@ window function will be picked. Default is @code{0.75}.
 @item
 Leave almost only low frequencies in audio:
 @example
-afftfilt="1-clip((b/nb)*b,0,1)"
+afftfilt="'real=re * (1-clip((b/nb)*b,0,1))':imag='im * 
(1-clip((b/nb)*b,0,1))'"
 @end example
 @end itemize
 
diff --git a/libavfilter/af_afftfilt.c b/libavfilter/af_afftfilt.c
index 7f28e1f77b..805866fad0 100644
--- a/libavfilter/af_afftfilt.c
+++ b/libavfilter/af_afftfilt.c
@@ -36,6 +36,7 @@ typedef struct AFFTFiltContext {
 
 FFTContext *fft, *ifft;
 FFTComplex **fft_data;
+FFTComplex **fft_temp;
 int nb_exprs;
 int window_size;
 AVExpr **real;
@@ -51,15 +52,15 @@ typedef struct AFFTFiltContext {
 float *window_func_lut;
 } AFFTFiltContext;
 
-static const char *const var_names[] = {"sr", "b",   "nb", 
   "ch","chs",   "pts",NULL };
-enum   { VAR_SAMPLE_RATE, VAR_BIN, VAR_NBBINS, 
VAR_CHANNEL, VAR_CHANNELS, VAR_PTS, VAR_VARS_NB };
+static const char *const var_names[] = {"sr", "b",   "nb", 
   "ch","chs",   "pts", "re", "im", NULL };
+enum   { VAR_SAMPLE_RATE, VAR_BIN, VAR_NBBINS, 
VAR_CHANNEL, VAR_CHANNELS, VAR_PTS, VAR_REAL, VAR_IMAG, VAR_VARS_NB };
 
 #define OFFSET(x) offsetof(AFFTFiltContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption afftfilt_options[] = {
-{ "real", "set channels real expressions",   OFFSET(real_str), 
AV_OPT_TYPE_STRING, {.str = "1" }, 0, 0, A },
-{ "imag",  "set channels imaginary expressions", OFFSET(img_str),  
AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, A },
+{ "real", "set channels real expressions",   OFFSET(real_str), 
AV_OPT_TYPE_STRING, {.str = "re" }, 0, 0, A },
+{ "imag", "set channels imaginary expressions",  OFFSET(img_str),  
AV_OPT_TYPE_STRING, {.str = "im" }, 0, 0, A },
 { "win_size", "set window size", OFFSET(fft_bits), AV_OPT_TYPE_INT, 
{.i64=12}, 4, 17, A, "fft" },
 { "w16",0, 0, AV_OPT_TYPE_CONST, {.i64=4},  0, 0, A, "fft" },
 { "w32",0, 0, AV_OPT_TYPE_CONST, {.i64=5},  0, 0, A, "fft" },
@@ -88,6 +89,34 @@ static const AVOption afftfilt_options[] = {
 
 AVFILTER_DEFINE_CLASS(afftfilt);
 
+static inline double getreal(void *priv, double x, double ch)
+{
+AFFTFiltContext *s = priv;
+int ich, ix;
+
+ich = av_clip(ch, 0, s->nb_exprs - 1);
+ix = av_clip(x, 0, s->window_size / 2);
+
+return s->fft_data[ich][ix].re;
+}
+
+static inline double getimag(void *priv, double x, double ch)
+{
+AFFTFiltContext *s = priv;
+int ich, ix;
+
+ich = av_clip(ch, 0, s->nb_exprs - 1);
+ix = av_clip(x, 0, s->window_size / 2);
+
+return s->fft_data[ich][ix].im;
+}
+
+static double realf(void *priv, double x, double ch) { return getreal(priv, x, 
ch); }
+static double imagf(void *priv, double x, double ch) { return getimag(priv, x, 
ch); }
+
+static const char *const func2_names[]= { "real", "imag", NULL };
+double (*func2[])(void *, double, double) = {  realf,  imagf, NULL };
+
 static int config_input(AVFilterLink *inlink)
 {
 AVFilterContext *ctx = inlink->dst;
@@ -109,12 +138,22 @@ static int config_input(AVFilterLink *inlink)
 if (!s->fft_data)
 return AVERROR(ENOMEM);
 
+s->fft_temp = av_calloc(inlink->channels, sizeof(*s->fft_temp));
+if (!s->fft_temp)
+return AVERROR(ENOMEM);
+
 for (ch = 0; ch < inlink->channels; ch++) {
 s->fft_data[ch] = av_calloc(s->window_size, sizeof(**s->fft_data));
 if (!s->fft_data[ch])
 return 

[FFmpeg-cvslog] fate/prores_metadata_bsf : add test for setting color property

2018-11-11 Thread Martin Vignali
ffmpeg | branch: master | Martin Vignali  | Sun Oct 
28 12:54:18 2018 +0100| [679ad3146972c7af7a996106c3cddcf58208b6fa] | committer: 
Martin Vignali

fate/prores_metadata_bsf : add test for setting color property

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

 tests/fate/prores.mak  | 6 ++
 tests/ref/fate/prores-metadata | 1 +
 2 files changed, 7 insertions(+)

diff --git a/tests/fate/prores.mak b/tests/fate/prores.mak
index f7f52ca7fc..dd52d68f70 100644
--- a/tests/fate/prores.mak
+++ b/tests/fate/prores.mak
@@ -20,3 +20,9 @@ fate-prores-alpha_skip: CMD = framecrc -flags +bitexact 
-skip_alpha 1 -i $(TARGE
 fate-prores-transparency: CMD = framecrc -flags +bitexact -i 
$(TARGET_SAMPLES)/prores/prores_with_transparency.mov -pix_fmt yuva444p10le
 fate-prores-transparency_skip: CMD = framecrc -flags +bitexact -skip_alpha 1 
-i $(TARGET_SAMPLES)/prores/prores_with_transparency.mov -pix_fmt 
yuv444p10le
 fate-prores-gray:  CMD = framecrc -flags +bitexact -c:a aac_fixed -i 
$(TARGET_SAMPLES)/prores/gray.mov -pix_fmt yuv422p10le
+
+#Test bsf prores-metadata
+FATE_PRORES_METADATA_BSF += fate-prores-metadata
+fate-prores-metadata: CMD = md5 -i 
$(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_Proxy.mov -c:v copy -bsf:v 
prores_metadata=color_primaries=bt470bg:color_trc=bt709:colorspace=smpte170m -f 
mov
+
+FATE_SAMPLES_FFMPEG-$(call ALLYES, MOV_DEMUXER PRORES_METADATA_BSF) += 
$(FATE_PRORES_METADATA_BSF)
diff --git a/tests/ref/fate/prores-metadata b/tests/ref/fate/prores-metadata
new file mode 100644
index 00..e34b3bb1b7
--- /dev/null
+++ b/tests/ref/fate/prores-metadata
@@ -0,0 +1 @@
+84814393e25b673e8ebd6a94f3d07349

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


[FFmpeg-cvslog] avcodec : add prores_metadata bsf for set the color property of each prores frame

2018-11-11 Thread Martin Vignali
ffmpeg | branch: master | Martin Vignali  | Sun Oct 
28 12:53:25 2018 +0100| [0aba92d42d5194aee335f623bcb70831cd71b0af] | committer: 
Martin Vignali

avcodec : add prores_metadata bsf for set the color property of each prores 
frame

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

 doc/bitstream_filters.texi   |  66 +++
 libavcodec/Makefile  |   1 +
 libavcodec/bitstream_filters.c   |   1 +
 libavcodec/prores_metadata_bsf.c | 172 +++
 4 files changed, 240 insertions(+)

diff --git a/doc/bitstream_filters.texi b/doc/bitstream_filters.texi
index 53470c01ec..655a2c1e63 100644
--- a/doc/bitstream_filters.texi
+++ b/doc/bitstream_filters.texi
@@ -530,6 +530,72 @@ ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
 @section null
 This bitstream filter passes the packets through unchanged.
 
+@section prores_metadata
+
+Modify color property metadata embedded in prores stream.
+
+@table @option
+@item color_primaries
+Set the color primaries.
+Available values are:
+
+@table @samp
+@item auto
+Keep the same color primaries property (default).
+
+@item unknown
+@item bt709
+@item bt470bg
+BT601 625
+
+@item smpte170m
+BT601 525
+
+@item bt2020
+@item smpte431
+DCI P3
+
+@item smpte432
+P3 D65
+
+@end table
+
+@item transfer_characteristics
+Set the color transfert.
+Available values are:
+
+@table @samp
+@item auto
+Keep the same transfer characteristics property (default).
+
+@item unknown
+@item bt709
+BT 601, BT 709, BT 2020
+@end table
+
+
+@item matrix_coefficients
+Set the matrix coefficient.
+Available values are:
+
+@table @samp
+@item auto
+Keep the same transfer characteristics property (default).
+
+@item unknown
+@item bt709
+@item smpte170m
+BT 601
+
+@item bt2020nc
+@end table
+@end table
+
+Set Rec709 colorspace for each frame of the file
+@example
+ffmpeg -i INPUT -c copy -bsf:v 
prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 
output.mov
+@end example
+
 @section remove_extra
 
 Remove extradata from packets.
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 8643da8f2b..05be02ec7d 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1081,6 +1081,7 @@ OBJS-$(CONFIG_MP3_HEADER_DECOMPRESS_BSF)  += 
mp3_header_decompress_bsf.o \
 OBJS-$(CONFIG_MPEG2_METADATA_BSF) += mpeg2_metadata_bsf.o
 OBJS-$(CONFIG_NOISE_BSF)  += noise_bsf.o
 OBJS-$(CONFIG_NULL_BSF)   += null_bsf.o
+OBJS-$(CONFIG_PRORES_METADATA_BSF)+= prores_metadata_bsf.o
 OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)   += remove_extradata_bsf.o
 OBJS-$(CONFIG_TEXT2MOVSUB_BSF)+= movsub_bsf.o
 OBJS-$(CONFIG_TRACE_HEADERS_BSF)  += trace_headers_bsf.o
diff --git a/libavcodec/bitstream_filters.c b/libavcodec/bitstream_filters.c
index 96b1746a75..2a8598bac2 100644
--- a/libavcodec/bitstream_filters.c
+++ b/libavcodec/bitstream_filters.c
@@ -47,6 +47,7 @@ extern const AVBitStreamFilter ff_mpeg4_unpack_bframes_bsf;
 extern const AVBitStreamFilter ff_mov2textsub_bsf;
 extern const AVBitStreamFilter ff_noise_bsf;
 extern const AVBitStreamFilter ff_null_bsf;
+extern const AVBitStreamFilter ff_prores_metadata_bsf;
 extern const AVBitStreamFilter ff_remove_extradata_bsf;
 extern const AVBitStreamFilter ff_text2movsub_bsf;
 extern const AVBitStreamFilter ff_trace_headers_bsf;
diff --git a/libavcodec/prores_metadata_bsf.c b/libavcodec/prores_metadata_bsf.c
new file mode 100644
index 00..cc7a2b89f4
--- /dev/null
+++ b/libavcodec/prores_metadata_bsf.c
@@ -0,0 +1,172 @@
+/*
+ * Prores Metadata bitstream filter
+ * Copyright (c) 2018 Jokyo Images
+ *
+ * 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
+ * Prores Metadata bitstream filter
+ * set frame colorspace property
+ */
+
+#include "libavutil/common.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/opt.h"
+#include "bsf.h"
+
+typedef struct ProresMetadataContext {
+const AVClass *class;
+
+int color_primaries;
+int transfer_characteristics;
+int matrix_coefficients;
+} ProresMetadataContext;
+
+static int prores_metadata(AVBSFContext *bsf, AVPacket *pkt)
+{
+ProresMetadataContext *ctx = bsf->priv_data;
+int ret = 0;

[FFmpeg-cvslog] avfilter/vf_select: use common scene sad functions

2018-11-11 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Thu Apr  5 01:47:32 
2018 +0200| [7748f395de88b72d82f7dc5e39bca49df665252b] | committer: Marton 
Balint

avfilter/vf_select: use common scene sad functions

Signed-off-by: Marton Balint 

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

 configure  |  2 +-
 libavfilter/f_select.c | 26 +++---
 2 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/configure b/configure
index 52a9bd63d7..55fc25e538 100755
--- a/configure
+++ b/configure
@@ -3445,7 +3445,7 @@ sab_filter_deps="gpl swscale"
 scale2ref_filter_deps="swscale"
 scale_filter_deps="swscale"
 scale_qsv_filter_deps="libmfx"
-select_filter_select="pixelutils"
+select_filter_select="scene_sad"
 sharpness_vaapi_filter_deps="vaapi"
 showcqt_filter_deps="avcodec avformat swscale"
 showcqt_filter_suggest="libfontconfig libfreetype"
diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index b1b2cbc21a..d67849bf26 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -28,12 +28,12 @@
 #include "libavutil/fifo.h"
 #include "libavutil/internal.h"
 #include "libavutil/opt.h"
-#include "libavutil/pixelutils.h"
 #include "avfilter.h"
 #include "audio.h"
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
+#include "scene_sad.h"
 
 static const char *const var_names[] = {
 "TB",///< timebase
@@ -145,7 +145,7 @@ typedef struct SelectContext {
 AVExpr *expr;
 double var_values[VAR_VARS_NB];
 int do_scene_detect;///< 1 if the expression requires scene 
detection variables, 0 otherwise
-av_pixelutils_sad_fn sad;   ///< Sum of the absolute difference 
function (scene detect only)
+ff_scene_sad_fn sad;///< Sum of the absolute difference 
function (scene detect only)
 double prev_mafd;   ///< previous MAFD 
  (scene detect only)
 AVFrame *prev_picref;   ///< previous frame
  (scene detect only)
 double select;
@@ -242,7 +242,7 @@ static int config_input(AVFilterLink *inlink)
 inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;
 
 if (select->do_scene_detect) {
-select->sad = av_pixelutils_get_sad_fn(3, 3, 2, select); // 8x8 both 
sources aligned
+select->sad = ff_scene_sad_get_fn(8);
 if (!select->sad)
 return AVERROR(EINVAL);
 }
@@ -258,24 +258,12 @@ static double get_scene_score(AVFilterContext *ctx, 
AVFrame *frame)
 if (prev_picref &&
 frame->height == prev_picref->height &&
 frame->width  == prev_picref->width) {
-int x, y, nb_sad = 0;
-int64_t sad = 0;
+uint64_t sad;
 double mafd, diff;
-uint8_t *p1 =  frame->data[0];
-uint8_t *p2 = prev_picref->data[0];
-const int p1_linesize =   frame->linesize[0];
-const int p2_linesize = prev_picref->linesize[0];
-
-for (y = 0; y < frame->height - 7; y += 8) {
-for (x = 0; x < frame->width*3 - 7; x += 8) {
-sad += select->sad(p1 + x, p1_linesize, p2 + x, p2_linesize);
-nb_sad += 8 * 8;
-}
-p1 += 8 * p1_linesize;
-p2 += 8 * p2_linesize;
-}
+
+select->sad(prev_picref->data[0], prev_picref->linesize[0], 
frame->data[0], frame->linesize[0], frame->width * 3, frame->height, );
 emms_c();
-mafd = nb_sad ? (double)sad / nb_sad : 0;
+mafd = (double)sad / (frame->width * 3 * frame->height);
 diff = fabs(mafd - select->prev_mafd);
 ret  = av_clipf(FFMIN(mafd, diff) / 100., 0, 1);
 select->prev_mafd = mafd;

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


[FFmpeg-cvslog] avfilter/vf_minterpolate: use common scene sad functions

2018-11-11 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Sun Oct  7 18:55:47 
2018 +0200| [936d18fb42bb1776f1b25e16b9d6a72846ee33ac] | committer: Marton 
Balint

avfilter/vf_minterpolate: use common scene sad functions

Signed-off-by: Marton Balint 

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

 configure |  1 +
 libavfilter/vf_minterpolate.c | 17 +++--
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/configure b/configure
index 55fc25e538..b02b4ccb2e 100755
--- a/configure
+++ b/configure
@@ -3417,6 +3417,7 @@ mcdeint_filter_deps="avcodec gpl"
 movie_filter_deps="avcodec avformat"
 mpdecimate_filter_deps="gpl"
 mpdecimate_filter_select="pixelutils"
+minterpolate_filter_select="scene_sad"
 mptestsrc_filter_deps="gpl"
 negate_filter_deps="lut_filter"
 nnedi_filter_deps="gpl"
diff --git a/libavfilter/vf_minterpolate.c b/libavfilter/vf_minterpolate.c
index c6a5e63f90..532f5ed235 100644
--- a/libavfilter/vf_minterpolate.c
+++ b/libavfilter/vf_minterpolate.c
@@ -26,11 +26,11 @@
 #include "libavutil/motion_vector.h"
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
-#include "libavutil/pixelutils.h"
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
+#include "scene_sad.h"
 
 #define ME_MODE_BIDIR 0
 #define ME_MODE_BILAT 1
@@ -188,7 +188,7 @@ typedef struct MIContext {
 
 int scd_method;
 int scene_changed;
-av_pixelutils_sad_fn sad;
+ff_scene_sad_fn sad;
 double prev_mafd;
 double scd_threshold;
 
@@ -383,7 +383,7 @@ static int config_input(AVFilterLink *inlink)
 }
 
 if (mi_ctx->scd_method == SCD_METHOD_FDIFF) {
-mi_ctx->sad = av_pixelutils_get_sad_fn(3, 3, 2, mi_ctx);
+mi_ctx->sad = ff_scene_sad_get_fn(8);
 if (!mi_ctx->sad)
 return AVERROR(EINVAL);
 }
@@ -827,18 +827,15 @@ static int detect_scene_change(MIContext *mi_ctx)
 {
 AVMotionEstContext *me_ctx = _ctx->me_ctx;
 int x, y;
-int linesize = me_ctx->linesize;
 uint8_t *p1 = mi_ctx->frames[1].avf->data[0];
+ptrdiff_t linesize1 = mi_ctx->frames[1].avf->linesize[0];
 uint8_t *p2 = mi_ctx->frames[2].avf->data[0];
+ptrdiff_t linesize2 = mi_ctx->frames[2].avf->linesize[0];
 
 if (mi_ctx->scd_method == SCD_METHOD_FDIFF) {
 double ret = 0, mafd, diff;
-int64_t sad;
-
-for (sad = y = 0; y < me_ctx->height; y += 8)
-for (x = 0; x < linesize; x += 8)
-sad += mi_ctx->sad(p1 + x + y * linesize, linesize, p2 + x + y 
* linesize, linesize);
-
+uint64_t sad;
+mi_ctx->sad(p1, linesize1, p2, linesize2, me_ctx->width, 
me_ctx->height, );
 emms_c();
 mafd = (double) sad / (me_ctx->height * me_ctx->width * 3);
 diff = fabs(mafd - mi_ctx->prev_mafd);

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


[FFmpeg-cvslog] avfilter/vf_framerate: factorize SAD functions which compute SAD for a whole frame

2018-11-11 Thread Marton Balint
ffmpeg | branch: master | Marton Balint  | Thu Apr  5 01:37:25 
2018 +0200| [6c2a7a8e9a3698f37913d3f24723fbb8fa895798] | committer: Marton 
Balint

avfilter/vf_framerate: factorize SAD functions which compute SAD for a whole 
frame

Also add SIMD which works on lines because it is faster then calculating it on
8x8 blocks using pixelutils.

Signed-off-by: Marton Balint 

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

 configure|  3 +-
 libavfilter/Makefile |  1 +
 libavfilter/framerate.h  |  4 +--
 libavfilter/scene_sad.c  | 72 ++
 libavfilter/scene_sad.h  | 44 
 libavfilter/vf_framerate.c   | 61 -
 libavfilter/x86/Makefile |  4 +++
 libavfilter/x86/scene_sad.asm| 74 
 libavfilter/x86/scene_sad_init.c | 52 
 9 files changed, 257 insertions(+), 58 deletions(-)

diff --git a/configure b/configure
index 00b5d9795e..52a9bd63d7 100755
--- a/configure
+++ b/configure
@@ -2337,6 +2337,7 @@ CONFIG_EXTRA="
 rtpdec
 rtpenc_chain
 rv34dsp
+scene_sad
 sinewin
 snappy
 srtp
@@ -3400,7 +3401,7 @@ find_rect_filter_deps="avcodec avformat gpl"
 firequalizer_filter_deps="avcodec"
 firequalizer_filter_select="rdft"
 flite_filter_deps="libflite"
-framerate_filter_select="pixelutils"
+framerate_filter_select="scene_sad"
 frei0r_filter_deps="frei0r libdl"
 frei0r_src_filter_deps="frei0r libdl"
 fspp_filter_deps="gpl"
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 79a89a1ab1..7c6fc836e5 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -28,6 +28,7 @@ OBJS-$(HAVE_THREADS) += pthread.o
 OBJS-$(CONFIG_QSVVPP)+= qsvvpp.o
 DNN-OBJS-$(CONFIG_LIBTENSORFLOW) += dnn_backend_tf.o
 OBJS-$(CONFIG_DNN)   += dnn_interface.o 
dnn_backend_native.o $(DNN-OBJS-yes)
+OBJS-$(CONFIG_SCENE_SAD) += scene_sad.o
 
 # audio filters
 OBJS-$(CONFIG_ABENCH_FILTER) += f_bench.o
diff --git a/libavfilter/framerate.h b/libavfilter/framerate.h
index a42d5af68a..8048dfa36a 100644
--- a/libavfilter/framerate.h
+++ b/libavfilter/framerate.h
@@ -19,7 +19,7 @@
 #ifndef AVFILTER_FRAMERATE_H
 #define AVFILTER_FRAMERATE_H
 
-#include "libavutil/pixelutils.h"
+#include "scene_sad.h"
 #include "avfilter.h"
 
 #define BLEND_FUNC_PARAMS const uint8_t *src1, ptrdiff_t src1_linesize, \
@@ -48,7 +48,7 @@ typedef struct FrameRateContext {
 AVRational srce_time_base;  ///< timebase of source
 AVRational dest_time_base;  ///< timebase of destination
 
-av_pixelutils_sad_fn sad;   ///< Sum of the absolute difference 
function (scene detect only)
+ff_scene_sad_fn sad;///< Sum of the absolute difference 
function (scene detect only)
 double prev_mafd;   ///< previous MAFD 
  (scene detect only)
 
 int blend_factor_max;
diff --git a/libavfilter/scene_sad.c b/libavfilter/scene_sad.c
new file mode 100644
index 00..fa57a25961
--- /dev/null
+++ b/libavfilter/scene_sad.c
@@ -0,0 +1,72 @@
+/*
+ * 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
+ * Scene SAD funtions
+ */
+
+#include "scene_sad.h"
+
+void ff_scene_sad16_c(SCENE_SAD_PARAMS)
+{
+uint64_t sad = 0;
+const uint16_t *src1w = (const uint16_t *)src1;
+const uint16_t *src2w = (const uint16_t *)src2;
+int x, y;
+
+stride1 /= 2;
+stride2 /= 2;
+
+for (y = 0; y < height; y++) {
+for (x = 0; x < width; x++)
+sad += FFABS(src1w[x] - src2w[x]);
+src1w += stride1;
+src2w += stride2;
+}
+*sum = sad;
+}
+
+void ff_scene_sad_c(SCENE_SAD_PARAMS)
+{
+uint64_t sad = 0;
+int x, y;
+
+for (y = 0; y < height; y++) {
+for (x = 0; x < width; x++)
+sad += FFABS(src1[x] - src2[x]);
+src1 += stride1;
+src2 += stride2;
+}
+*sum = sad;
+}
+
+ff_scene_sad_fn ff_scene_sad_get_fn(int depth)
+{
+ff_scene_sad_fn sad = NULL;
+

[FFmpeg-cvslog] cbs_mpeg2: Improve performance of writing slices

2018-11-11 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt 
 | Sun Nov  4 05:48:40 2018 +0100| 
[6df9020f45eaff66ba2c2bac98cda9ddaacb03f3] | committer: Mark Thompson

cbs_mpeg2: Improve performance of writing slices

Instead of using a combination of bitreader and -writer for copying data,
one can byte-align the (obsolete and removed) bitreader to improve performance.
One can even use memcpy in the normal case.
This improved the time needed for writing the slicedata from 33618 to
2370 decicycles when tested on a video originating from a DVD (4194394
runs).

Signed-off-by: Andreas Rheinhardt 
Signed-off-by: Mark Thompson 

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

 libavcodec/cbs_mpeg2.c | 39 +++
 1 file changed, 27 insertions(+), 12 deletions(-)

diff --git a/libavcodec/cbs_mpeg2.c b/libavcodec/cbs_mpeg2.c
index 0df4234b12..8b8b266563 100644
--- a/libavcodec/cbs_mpeg2.c
+++ b/libavcodec/cbs_mpeg2.c
@@ -264,8 +264,6 @@ static int cbs_mpeg2_write_slice(CodedBitstreamContext *ctx,
  PutBitContext *pbc)
 {
 MPEG2RawSlice *slice = unit->content;
-GetBitContext gbc;
-size_t bits_left;
 int err;
 
 err = cbs_mpeg2_write_slice_header(ctx, pbc, >header);
@@ -273,21 +271,38 @@ static int cbs_mpeg2_write_slice(CodedBitstreamContext 
*ctx,
 return err;
 
 if (slice->data) {
+size_t rest = slice->data_size - (slice->data_bit_start + 7) / 8;
+uint8_t *pos = slice->data + slice->data_bit_start / 8;
+
+av_assert0(slice->data_bit_start >= 0 &&
+   8 * slice->data_size > slice->data_bit_start);
+
 if (slice->data_size * 8 + 8 > put_bits_left(pbc))
 return AVERROR(ENOSPC);
 
-init_get_bits(, slice->data, slice->data_size * 8);
-skip_bits_long(, slice->data_bit_start);
-
-while (get_bits_left() > 15)
-put_bits(pbc, 16, get_bits(, 16));
+// First copy the remaining bits of the first byte
+if (slice->data_bit_start % 8)
+put_bits(pbc, 8 - slice->data_bit_start % 8,
+ *pos++ & MAX_UINT_BITS(8 - slice->data_bit_start % 8));
+
+if (put_bits_count(pbc) % 8 == 0) {
+// If the writer is aligned at this point,
+// memcpy can be used to improve performance.
+// This is the normal case.
+flush_put_bits(pbc);
+memcpy(put_bits_ptr(pbc), pos, rest);
+skip_put_bytes(pbc, rest);
+} else {
+// If not, we have to copy manually:
+for (; rest > 3; rest -= 4, pos += 4)
+put_bits32(pbc, AV_RB32(pos));
 
-bits_left = get_bits_left();
-put_bits(pbc, bits_left, get_bits(, bits_left));
+for (; rest; rest--, pos++)
+put_bits(pbc, 8, *pos);
 
-// Align with zeroes.
-while (put_bits_count(pbc) % 8 != 0)
-put_bits(pbc, 1, 0);
+// Align with zeros
+put_bits(pbc, 8 - put_bits_count(pbc) % 8, 0);
+}
 }
 
 return 0;

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


[FFmpeg-cvslog] cbs_h265: Add PTL parsing for sublayers

2018-11-11 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sat Oct 27 22:01:16 
2018 +0100| [252e79663de802d8d0b38fbfdfeeda2d86b4e611] | committer: Mark 
Thompson

cbs_h265: Add PTL parsing for sublayers

With fate test using the SLPPLP_A_VIDYO_2 conformance file, which contains
two sublayers with full PTL information.

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

 libavcodec/cbs_h265.h| 26 +-
 libavcodec/cbs_h265_syntax_template.c| 60 ++--
 tests/fate/cbs.mak   |  3 +-
 tests/ref/fate/cbs-hevc-SLPPLP_A_VIDYO_2 |  1 +
 4 files changed, 85 insertions(+), 5 deletions(-)

diff --git a/libavcodec/cbs_h265.h b/libavcodec/cbs_h265.h
index cca1d7590b..97c9444cb4 100644
--- a/libavcodec/cbs_h265.h
+++ b/libavcodec/cbs_h265.h
@@ -71,7 +71,31 @@ typedef struct H265RawProfileTierLevel {
 uint8_t sub_layer_profile_present_flag[HEVC_MAX_SUB_LAYERS];
 uint8_t sub_layer_level_present_flag[HEVC_MAX_SUB_LAYERS];
 
-// TODO: much of that again for each sub-layer.
+uint8_t sub_layer_profile_space[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_tier_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_profile_idc[HEVC_MAX_SUB_LAYERS];
+
+uint8_t sub_layer_profile_compatibility_flag[HEVC_MAX_SUB_LAYERS][32];
+
+uint8_t sub_layer_progressive_source_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_interlaced_source_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_non_packed_constraint_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_frame_only_constraint_flag[HEVC_MAX_SUB_LAYERS];
+
+uint8_t sub_layer_max_12bit_constraint_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_max_10bit_constraint_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_max_8bit_constraint_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_max_422chroma_constraint_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_max_420chroma_constraint_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_max_monochrome_constraint_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_intra_constraint_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_one_picture_only_constraint_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_lower_bit_rate_constraint_flag[HEVC_MAX_SUB_LAYERS];
+uint8_t sub_layer_max_14bit_constraint_flag[HEVC_MAX_SUB_LAYERS];
+
+uint8_t sub_layer_inbld_flag[HEVC_MAX_SUB_LAYERS];
+
+uint8_t sub_layer_level_idc[HEVC_MAX_SUB_LAYERS];
 } H265RawProfileTierLevel;
 
 typedef struct H265RawSubLayerHRDParameters {
diff --git a/libavcodec/cbs_h265_syntax_template.c 
b/libavcodec/cbs_h265_syntax_template.c
index e43f3caf99..b8a9bab971 100644
--- a/libavcodec/cbs_h265_syntax_template.c
+++ b/libavcodec/cbs_h265_syntax_template.c
@@ -163,10 +163,64 @@ static int FUNC(profile_tier_level)(CodedBitstreamContext 
*ctx, RWContext *rw,
 }
 
 for (i = 0; i < max_num_sub_layers_minus1; i++) {
-if (current->sub_layer_profile_present_flag[i])
-return AVERROR_PATCHWELCOME;
+if (current->sub_layer_profile_present_flag[i]) {
+us(2, sub_layer_profile_space[i], 0, 0, 1, i);
+flags(sub_layer_tier_flag[i],   1, i);
+us(5, sub_layer_profile_idc[i], 0, 31,  1, i);
+
+for (j = 0; j < 32; j++)
+flags(sub_layer_profile_compatibility_flag[i][j], 2, i, j);
+
+flags(sub_layer_progressive_source_flag[i],1, i);
+flags(sub_layer_interlaced_source_flag[i], 1, i);
+flags(sub_layer_non_packed_constraint_flag[i], 1, i);
+flags(sub_layer_frame_only_constraint_flag[i], 1, i);
+
+#define profile_compatible(x) (current->sub_layer_profile_idc[i] == (x) ||   \
+   
current->sub_layer_profile_compatibility_flag[i][x])
+if (profile_compatible(4) || profile_compatible(5) ||
+profile_compatible(6) || profile_compatible(7) ||
+profile_compatible(8) || profile_compatible(9) ||
+profile_compatible(10)) {
+flags(sub_layer_max_12bit_constraint_flag[i],1, i);
+flags(sub_layer_max_10bit_constraint_flag[i],1, i);
+flags(sub_layer_max_8bit_constraint_flag[i], 1, i);
+flags(sub_layer_max_422chroma_constraint_flag[i],1, i);
+flags(sub_layer_max_420chroma_constraint_flag[i],1, i);
+flags(sub_layer_max_monochrome_constraint_flag[i],   1, i);
+flags(sub_layer_intra_constraint_flag[i],1, i);
+flags(sub_layer_one_picture_only_constraint_flag[i], 1, i);
+flags(sub_layer_lower_bit_rate_constraint_flag[i],   1, i);
+
+if (profile_compatible(5)) {
+flags(sub_layer_max_14bit_constraint_flag[i], 1, i);
+fixed(24, sub_layer_reserved_zero_33bits, 0);
+fixed( 9, 

[FFmpeg-cvslog] fate/libavcodec: Fix config dependency of h264-levels test

2018-11-11 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sat Oct 27 23:19:49 
2018 +0100| [fd1d735c0b98bad99c9084d5a16935d96aa37297] | committer: Mark 
Thompson

fate/libavcodec: Fix config dependency of h264-levels test

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

 tests/fate/libavcodec.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/fate/libavcodec.mak b/tests/fate/libavcodec.mak
index aa4c36b112..5dde1243fa 100644
--- a/tests/fate/libavcodec.mak
+++ b/tests/fate/libavcodec.mak
@@ -46,7 +46,7 @@ fate-dct8x8: libavcodec/tests/dct$(EXESUF)
 fate-dct8x8: CMD = run libavcodec/tests/dct
 fate-dct8x8: CMP = null
 
-FATE_LIBAVCODEC-$(CONFIG_H264_VAAPI_ENCODER) += fate-h264-levels
+FATE_LIBAVCODEC-$(CONFIG_H264_METADATA_BSF) += fate-h264-levels
 fate-h264-levels: libavcodec/tests/h264_levels$(EXESUF)
 fate-h264-levels: CMD = run libavcodec/tests/h264_levels
 fate-h264-levels: REF = /dev/null

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


[FFmpeg-cvslog] avfilter/vf_lut3d: ignore last whitespace when comparing LUT size string

2018-11-11 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sun Nov 11 13:36:45 
2018 +0100| [8860d307311aec5e0f97b12405da8f8b3d2e0c60] | committer: Paul B Mahol

avfilter/vf_lut3d: ignore last whitespace when comparing LUT size string

In some situations it might be tab character and in others normal space.

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

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

diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index 1beaf5ac4e..e7601a05ac 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -384,7 +384,7 @@ static int parse_cube(AVFilterContext *ctx, FILE *f)
 float max[3] = {1.0, 1.0, 1.0};
 
 while (fgets(line, sizeof(line), f)) {
-if (!strncmp(line, "LUT_3D_SIZE ", 12)) {
+if (!strncmp(line, "LUT_3D_SIZE", 11)) {
 int i, j, k;
 const int size = strtol(line + 12, NULL, 0);
 
@@ -1027,7 +1027,7 @@ static int parse_cube_1d(AVFilterContext *ctx, FILE *f)
 float max[3] = {1.0, 1.0, 1.0};
 
 while (fgets(line, sizeof(line), f)) {
-if (!strncmp(line, "LUT_1D_SIZE ", 12)) {
+if (!strncmp(line, "LUT_1D_SIZE", 11)) {
 const int size = strtol(line + 12, NULL, 0);
 int i;
 

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