Re: [FFmpeg-devel] [PATCH 1/2] diracdec: Split DWTPlane struct from Plane

2016-02-07 Thread Rostislav Pehlivanov
On 7 February 2016 at 14:53, Timothy Gu  wrote:

> ---
>  libavcodec/dirac_dwt.h |  9 +
>  libavcodec/diracdec.c  | 47
> +--
>  2 files changed, 30 insertions(+), 26 deletions(-)


LGTM, the decoder could definitely use some clean-ups

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


Re: [FFmpeg-devel] [PATCH 2/2] diracdec: Pass DWTPlane to dwt init

2016-02-07 Thread Rostislav Pehlivanov
On 7 February 2016 at 14:53, Timothy Gu  wrote:

> ---
>  libavcodec/dirac_dwt.c | 15 +++
>  libavcodec/dirac_dwt.h |  5 ++---
>  libavcodec/diracdec.c  |  4 ++--
>  3 files changed, 11 insertions(+), 13 deletions(-)
>
>
LGTM

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


[FFmpeg-devel] [PATCHv2 06/12] avformat/ffmenc: use ff_parse_creation_time_metadata

2016-02-07 Thread Marton Balint
FYI this muxer bails out on parse error and not just warn the user.

Signed-off-by: Marton Balint 
---
 libavformat/ffmenc.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c
index f0b5743..0f23b79 100644
--- a/libavformat/ffmenc.c
+++ b/libavformat/ffmenc.c
@@ -221,17 +221,13 @@ static int ffm_write_recommended_config(AVIOContext *pb, 
AVCodecContext *ctx, un
 static int ffm_write_header(AVFormatContext *s)
 {
 FFMContext *ffm = s->priv_data;
-AVDictionaryEntry *t;
 AVStream *st;
 AVIOContext *pb = s->pb;
 AVCodecContext *codec;
 int bit_rate, i, ret;
 
-if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) {
-ret = av_parse_time(>start_time, t->value, 0);
-if (ret < 0)
-return ret;
-}
+if ((ret = ff_parse_creation_time_metadata(s, >start_time, 0)) < 0)
+return ret;
 
 ffm->packet_size = FFM_PACKET_SIZE;
 
-- 
2.6.2

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


[FFmpeg-devel] List of FFmpeg API changes

2016-02-07 Thread Ponomarenko Andrey
Hello,

I continue maintaining list of API changes in FFmpeg here: 
http://abi-laboratory.pro/tracker/timeline/ffmpeg/

Please fix the link on this page: https://trac.ffmpeg.org/ (List of FFmpeg API 
changes/compatibility test results). The domain upstream-tracker dot org was 
sold by my old employer and contains inappropriate content for now.

Thank you.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCHv2 02/12] avutil/parseutils: accept everything in av_parse_time that ff_iso8601_to_unix_time accepts

2016-02-07 Thread Marton Balint
Also parse timezone information previously ignored in ff_iso8601_to_unix_time.

Signed-off-by: Marton Balint 
---
 libavutil/parseutils.c| 32 ++--
 tests/ref/fate/parseutils |  3 +++
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
index fd8cf2b..16c8b6a 100644
--- a/libavutil/parseutils.c
+++ b/libavutil/parseutils.c
@@ -565,13 +565,18 @@ int av_parse_time(int64_t *timeval, const char *timestr, 
int duration)
 int today = 0, negative = 0, microseconds = 0;
 int i;
 static const char * const date_fmt[] = {
-"%Y-%m-%d",
+"%Y - %m - %d",
 "%Y%m%d",
 };
 static const char * const time_fmt[] = {
 "%H:%M:%S",
 "%H%M%S",
 };
+static const char * const tz_fmt[] = {
+"%H:%M",
+"%H%M",
+"%H",
+};
 
 p = timestr;
 q = NULL;
@@ -600,8 +605,11 @@ int av_parse_time(int64_t *timeval, const char *timestr, 
int duration)
 }
 p = q;
 
-if (*p == 'T' || *p == 't' || *p == ' ')
+if (*p == 'T' || *p == 't')
 p++;
+else
+while (av_isspace(*p))
+p++;
 
 /* parse the hour-minute-second part */
 for (i = 0; i < FF_ARRAY_ELEMS(time_fmt); i++) {
@@ -655,7 +663,23 @@ int av_parse_time(int64_t *timeval, const char *timestr, 
int duration)
 t = dt.tm_hour * 3600 + dt.tm_min * 60 + dt.tm_sec;
 } else {
 int is_utc = *q == 'Z' || *q == 'z';
+int tzoffset = 0;
 q += is_utc;
+if (!today && !is_utc && (*q == '+' || *q == '-')) {
+struct tm tz = { 0 };
+int sign = (*q == '+' ? -1 : 1);
+q++;
+p = q;
+for (i = 0; i < FF_ARRAY_ELEMS(tz_fmt); i++) {
+q = av_small_strptime(p, tz_fmt[i], );
+if (q)
+break;
+}
+if (!q)
+return AVERROR(EINVAL);
+tzoffset = sign * (tz.tm_hour * 60 + tz.tm_min) * 60;
+is_utc = 1;
+}
 if (today) { /* fill in today's date */
 struct tm dt2 = is_utc ? *gmtime_r(, ) : 
*localtime_r(, );
 dt2.tm_hour = dt.tm_hour;
@@ -664,6 +688,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, 
int duration)
 dt = dt2;
 }
 t = is_utc ? av_timegm() : mktime();
+t += tzoffset;
 }
 
 /* Check that we are at the end of the string */
@@ -860,7 +885,10 @@ int main(void)
 "now",
 "12:35:46",
 "2000-12-20 0:02:47.5z",
+"2012 - 02-22  17:44:07",
 "2000-12-20T010247.6",
+"2000-12-12 1:35:46+05:30",
+"2112-12-12 22:30:40-02",
 };
 static const char * const duration_string[] = {
 "2:34:56.79",
diff --git a/tests/ref/fate/parseutils b/tests/ref/fate/parseutils
index 176140c..e9855ce 100644
--- a/tests/ref/fate/parseutils
+++ b/tests/ref/fate/parseutils
@@ -74,7 +74,10 @@ Testing av_parse_time()
 now  -> 1331972053.20 = 2012-03-17T08:14:13Z
 12:35:46 -> 1331984146.00 = 2012-03-17T11:35:46Z
 2000-12-20 0:02:47.5z->  977270567.50 = 2000-12-20T00:02:47Z
+2012 - 02-22  17:44:07   -> 1329929047.00 = 2012-02-22T16:44:07Z
 2000-12-20T010247.6  ->  977270567.60 = 2000-12-20T00:02:47Z
+2000-12-12 1:35:46+05:30 ->  976565146.00 = 2000-12-11T20:05:46Z
+2112-12-12 22:30:40-02   -> 4511032240.00 = 2112-12-13T00:30:40Z
 2:34:56.79   ->   +929679
 -1:23:45.67  ->   -502567
 42.1729  -> +42172900
-- 
2.6.2

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


[FFmpeg-devel] [PATCH 1/2] diracdec: Split DWTPlane struct from Plane

2016-02-07 Thread Timothy Gu
---
 libavcodec/dirac_dwt.h |  9 +
 libavcodec/diracdec.c  | 47 +--
 2 files changed, 30 insertions(+), 26 deletions(-)

diff --git a/libavcodec/dirac_dwt.h b/libavcodec/dirac_dwt.h
index 1a899b3..63302ae 100644
--- a/libavcodec/dirac_dwt.h
+++ b/libavcodec/dirac_dwt.h
@@ -34,6 +34,15 @@ typedef struct DWTCompose {
 int y;
 } DWTCompose;
 
+typedef struct DWTPlane {
+int width;
+int height;
+int stride;
+uint8_t *buf;
+uint8_t *buf_base;
+uint8_t *tmp;
+} DWTPlane;
+
 struct DWTContext;
 
 // Possible prototypes for vertical_compose functions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index f3a3bbf..473dbec 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -101,17 +101,12 @@ typedef struct SubBand {
 } SubBand;
 
 typedef struct Plane {
+DWTPlane idwt;
+
 int width;
 int height;
 ptrdiff_t stride;
 
-int idwt_width;
-int idwt_height;
-int idwt_stride;
-uint8_t *idwt_buf;
-uint8_t *idwt_buf_base;
-uint8_t *idwt_tmp;
-
 /* block length */
 uint8_t xblen;
 uint8_t yblen;
@@ -290,10 +285,10 @@ static int alloc_sequence_buffers(DiracContext *s)
 w = FFALIGN(CALC_PADDING(w, MAX_DWT_LEVELS), 8); /* FIXME: Should this 
be 16 for SSE??? */
 h = top_padding + CALC_PADDING(h, MAX_DWT_LEVELS) + max_yblen/2;
 
-s->plane[i].idwt_buf_base = av_mallocz_array((w+max_xblen), h * (2 << 
s->pshift));
-s->plane[i].idwt_tmp  = av_malloc_array((w+16), 2 << s->pshift);
-s->plane[i].idwt_buf  = s->plane[i].idwt_buf_base + 
(top_padding*w)*(2 << s->pshift);
-if (!s->plane[i].idwt_buf_base || !s->plane[i].idwt_tmp)
+s->plane[i].idwt.buf_base = av_mallocz_array((w+max_xblen), h * (2 << 
s->pshift));
+s->plane[i].idwt.tmp  = av_malloc_array((w+16), 2 << s->pshift);
+s->plane[i].idwt.buf  = s->plane[i].idwt.buf_base + 
(top_padding*w)*(2 << s->pshift);
+if (!s->plane[i].idwt.buf_base || !s->plane[i].idwt.tmp)
 return AVERROR(ENOMEM);
 }
 
@@ -354,8 +349,8 @@ static void free_sequence_buffers(DiracContext *s)
 memset(s->delay_frames, 0, sizeof(s->delay_frames));
 
 for (i = 0; i < 3; i++) {
-av_freep(>plane[i].idwt_buf_base);
-av_freep(>plane[i].idwt_tmp);
+av_freep(>plane[i].idwt.buf_base);
+av_freep(>plane[i].idwt.tmp);
 }
 
 s->buffer_stride = 0;
@@ -939,9 +934,9 @@ static void init_planes(DiracContext *s)
 
 p->width   = s->seq.width  >> (i ? s->chroma_x_shift : 0);
 p->height  = s->seq.height >> (i ? s->chroma_y_shift : 0);
-p->idwt_width  = w = CALC_PADDING(p->width , s->wavelet_depth);
-p->idwt_height = h = CALC_PADDING(p->height, s->wavelet_depth);
-p->idwt_stride = FFALIGN(p->idwt_width, 8) << (1 + s->pshift);
+p->idwt.width  = w = CALC_PADDING(p->width , s->wavelet_depth);
+p->idwt.height = h = CALC_PADDING(p->height, s->wavelet_depth);
+p->idwt.stride = FFALIGN(p->idwt.width, 8) << (1 + s->pshift);
 
 for (level = s->wavelet_depth-1; level >= 0; level--) {
 w = w>>1;
@@ -950,9 +945,9 @@ static void init_planes(DiracContext *s)
 SubBand *b = >band[level][orientation];
 
 b->pshift = s->pshift;
-b->ibuf   = p->idwt_buf;
+b->ibuf   = p->idwt.buf;
 b->level  = level;
-b->stride = p->idwt_stride << (s->wavelet_depth - level);
+b->stride = p->idwt.stride << (s->wavelet_depth - level);
 b->width  = w;
 b->height = h;
 b->orientation = orientation;
@@ -1734,7 +1729,7 @@ static int dirac_decode_frame_internal(DiracContext *s)
 /* [DIRAC_STD] 13.5.1 low_delay_transform_data() */
 for (comp = 0; comp < 3; comp++) {
 Plane *p = >plane[comp];
-memset(p->idwt_buf, 0, p->idwt_stride * p->idwt_height);
+memset(p->idwt.buf, 0, p->idwt.stride * p->idwt.height);
 }
 if (!s->zero_res) {
 if ((ret = decode_lowdelay(s)) < 0)
@@ -1752,11 +1747,11 @@ static int dirac_decode_frame_internal(DiracContext *s)
 
 if (!s->zero_res && !s->low_delay)
 {
-memset(p->idwt_buf, 0, p->idwt_stride * p->idwt_height);
+memset(p->idwt.buf, 0, p->idwt.stride * p->idwt.height);
 decode_component(s, comp); /* [DIRAC_STD] 13.4.1 
core_transform_data() */
 }
-ret = ff_spatial_idwt_init(, p->idwt_buf, p->idwt_width, 
p->idwt_height, p->idwt_stride,
-   s->wavelet_idx+2, s->wavelet_depth, 
p->idwt_tmp, s->bit_depth);
+ret = ff_spatial_idwt_init(, p->idwt.buf, p->idwt.width, 
p->idwt.height, p->idwt.stride,
+   s->wavelet_idx+2, s->wavelet_depth, 
p->idwt.tmp, s->bit_depth);
 if (ret 

[FFmpeg-devel] [PATCH 2/2] diracdec: Pass DWTPlane to dwt init

2016-02-07 Thread Timothy Gu
---
 libavcodec/dirac_dwt.c | 15 +++
 libavcodec/dirac_dwt.h |  5 ++---
 libavcodec/diracdec.c  |  4 ++--
 3 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/libavcodec/dirac_dwt.c b/libavcodec/dirac_dwt.c
index 4f04112..cc08f88 100644
--- a/libavcodec/dirac_dwt.c
+++ b/libavcodec/dirac_dwt.c
@@ -33,18 +33,17 @@
 #define TEMPLATE_12bit
 #include "dirac_dwt_template.c"
 
-int ff_spatial_idwt_init(DWTContext *d, uint8_t *buffer, int width, int height,
- int stride, enum dwt_type type, int 
decomposition_count,
- uint8_t *temp, int bit_depth)
+int ff_spatial_idwt_init(DWTContext *d, DWTPlane *p, enum dwt_type type,
+ int decomposition_count, int bit_depth)
 {
 int ret = 0;
 
-d->buffer = buffer;
-d->width  = width;
-d->height = height;
-d->stride = stride;
+d->buffer = p->buf;
+d->width  = p->width;
+d->height = p->height;
+d->stride = p->stride;
+d->temp   = p->tmp;
 d->decomposition_count = decomposition_count;
-d->temp   = temp;
 
 if (bit_depth == 8)
 ret = ff_spatial_idwt_init_8bit(d, type);
diff --git a/libavcodec/dirac_dwt.h b/libavcodec/dirac_dwt.h
index 63302ae..4d33865 100644
--- a/libavcodec/dirac_dwt.h
+++ b/libavcodec/dirac_dwt.h
@@ -85,9 +85,8 @@ enum dwt_type {
 };
 
 // -1 if an error occurred, e.g. the dwt_type isn't recognized
-int ff_spatial_idwt_init(DWTContext *d, uint8_t *buffer, int width, int height,
- int stride, enum dwt_type type, int 
decomposition_count,
- uint8_t *temp, int bit_depth);
+int ff_spatial_idwt_init(DWTContext *d, DWTPlane *p, enum dwt_type type,
+ int decomposition_count, int bit_depth);
 void ff_spatial_idwt_init_x86(DWTContext *d, enum dwt_type type);
 
 void ff_spatial_idwt_slice2(DWTContext *d, int y);
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 473dbec..e530a05 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1750,8 +1750,8 @@ static int dirac_decode_frame_internal(DiracContext *s)
 memset(p->idwt.buf, 0, p->idwt.stride * p->idwt.height);
 decode_component(s, comp); /* [DIRAC_STD] 13.4.1 
core_transform_data() */
 }
-ret = ff_spatial_idwt_init(, p->idwt.buf, p->idwt.width, 
p->idwt.height, p->idwt.stride,
-   s->wavelet_idx+2, s->wavelet_depth, 
p->idwt.tmp, s->bit_depth);
+ret = ff_spatial_idwt_init(, >idwt, s->wavelet_idx+2,
+   s->wavelet_depth, s->bit_depth);
 if (ret < 0)
 return ret;
 
-- 
2.1.4

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


[FFmpeg-devel] [PATCH] avcodec/mjpegdec: remove usage of YUVJ pixel formats

2016-02-07 Thread Paul B Mahol
Hi,

patch attached.
From 9906feda3445d7474ac8d88bfbbe7250e6e14ec4 Mon Sep 17 00:00:00 2001
From: Paul B Mahol 
Date: Sun, 7 Feb 2016 14:49:14 +0100
Subject: [PATCH] avcodec/mjpegdec: remove usage of YUVJ pixel formats

They have been deprecated long ago.

Signed-off-by: Paul B Mahol 
---
 libavcodec/mjpegdec.c | 29 +++--
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 69c9cf3..94293e6 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -445,7 +445,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A') {
 s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_GBRP : AV_PIX_FMT_GBRP16;
 } else {
-if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV444P ;
 else  s->avctx->pix_fmt = AV_PIX_FMT_YUV444P16;
 s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
 }
@@ -487,7 +487,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 case 0x22122100:
 case 0x21211100:
 case 0x22211200:
-if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
 else
 goto unk_pixfmt;
 s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -495,7 +495,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 case 0x1100:
 case 0x22112200:
 case 0x1100:
-if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
 else
 goto unk_pixfmt;
 s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -527,7 +527,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 } else {
 if (pix_fmt_id == 0x1400)
 s->upscale_v[1] = s->upscale_v[2] = 1;
-if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P;
+if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV440P;
 else
 goto unk_pixfmt;
 s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -540,7 +540,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 goto unk_pixfmt;
 s->upscale_h[0] = s->upscale_h[1] = 1;
 } else {
-if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
+if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
 else  s->avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
 s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
 }
@@ -548,13 +548,13 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 case 0x3100:
 if (s->bits > 8)
 goto unk_pixfmt;
-s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+s->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
 s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
 s->upscale_h[1] = s->upscale_h[2] = 2;
 break;
 case 0x22121100:
 case 0x22111200:
-if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
+if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
 else
 goto unk_pixfmt;
 s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -562,7 +562,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 case 0x2200:
 case 0x4200:
 case 0x2400:
-if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P;
+if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV420P;
 else  s->avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
 s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
 if (pix_fmt_id == 0x4200) {
@@ -576,7 +576,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 }
 break;
 case 0x4100:
-if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV411P : AV_PIX_FMT_YUVJ411P;
+if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV411P;
 else
 goto unk_pixfmt;
 s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -2250,12 +2250,9 @@ the_end:
 
 if (AV_RB32(s->upscale_h)) {
 int p;
-av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
-   avctx->pix_fmt == 

Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: remove usage of YUVJ pixel formats

2016-02-07 Thread wm4
On Sun, 7 Feb 2016 14:51:30 +0100
Paul B Mahol  wrote:

> From 9906feda3445d7474ac8d88bfbbe7250e6e14ec4 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol 
> Date: Sun, 7 Feb 2016 14:49:14 +0100
> Subject: [PATCH] avcodec/mjpegdec: remove usage of YUVJ pixel formats
> 
> They have been deprecated long ago.
> 

I'm all for it.

Last time we discussed this, it was a problem because libavfilter
doesn't use the color range as part of format negotiation, and some
filters require limited or unlimited range (or something like this).
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: remove usage of YUVJ pixel formats

2016-02-07 Thread Paul B Mahol
On 2/7/16, wm4  wrote:
> On Sun, 7 Feb 2016 14:51:30 +0100
> Paul B Mahol  wrote:
>
>> From 9906feda3445d7474ac8d88bfbbe7250e6e14ec4 Mon Sep 17 00:00:00 2001
>> From: Paul B Mahol 
>> Date: Sun, 7 Feb 2016 14:49:14 +0100
>> Subject: [PATCH] avcodec/mjpegdec: remove usage of YUVJ pixel formats
>>
>> They have been deprecated long ago.
>>
>
> I'm all for it.
>
> Last time we discussed this, it was a problem because libavfilter
> doesn't use the color range as part of format negotiation, and some
> filters require limited or unlimited range (or something like this).

I see currently only lut filter that needs but ignores color_range completely.
Will post patch later for it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] dirac_dwt: Don't pass information in context as arguments

2016-02-07 Thread Timothy Gu
On Sat, Feb 06, 2016 at 11:08:16AM +, Rostislav Pehlivanov wrote:
> On 6 February 2016 at 03:37, Timothy Gu  wrote:
> 
> > ---
> >  libavcodec/dirac_dwt.c  | 13 ++---
> >  libavcodec/dirac_dwt_template.c | 25 +
> >  2 files changed, 19 insertions(+), 19 deletions(-)
> >
> >
> LGTM

Thanks, pushed.

> 
> d->temp = (uint8_t *)(((TYPE *)d->temp) + 8); might appear confusing
> to someone as it modifies the actual pointer but that's okay since the
> pointer itself is supplied upon DWT init which happens on every single
> frame (since the wavelet transforms can differ between frames).

I think that's clear enough since the actual modification happens in the init
function as well.

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


Re: [FFmpeg-devel] [PATCH 2/2] dirac_dwt: Rename init2 to init

2016-02-07 Thread Timothy Gu
On Sat, Feb 06, 2016 at 11:10:10AM +, Rostislav Pehlivanov wrote:
> On 6 February 2016 at 03:37, Timothy Gu  wrote:
> 
> > The functions are all private.
> > ---
> >  libavcodec/dirac_dwt.c  | 12 ++--
> >  libavcodec/dirac_dwt.h  |  6 +++---
> >  libavcodec/dirac_dwt_template.c | 10 +-
> >  libavcodec/diracdec.c   |  4 ++--
> >  4 files changed, 16 insertions(+), 16 deletions(-)
> 
> 
> LGTM

Thanks, pushed.

> 
> This probably happened because the unmerged encoder and the decoder were
> developed at the same time and shared the same file for the transforms (at
> least initially).

Okay.

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


[FFmpeg-devel] [PATCH v6 1/6] libavcodec: VAAPI support infrastructure

2016-02-07 Thread Mark Thompson

---
 configure  |   5 +
 libavcodec/Makefile|   1 +
 libavcodec/vaapi_support.c | 852 +
 libavcodec/vaapi_support.h | 284 +++
 4 files changed, 1142 insertions(+)
 create mode 100644 libavcodec/vaapi_support.c
 create mode 100644 libavcodec/vaapi_support.h

diff --git a/configure b/configure
index 1000cb1..0880569 100755
--- a/configure
+++ b/configure
@@ -2037,6 +2037,7 @@ CONFIG_EXTRA="
 texturedsp
 texturedspenc
 tpeldsp
+vaapi_recent
 videodsp
 vp3dsp
 vp56dsp
@@ -5770,6 +5771,10 @@ enabled vaapi &&
 check_lib va/va.h vaInitialize -lva ||
 disable vaapi

+enabled vaapi &&
+check_code cc va/va.h "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" &&
+enable vaapi_recent
+
 enabled vaapi && enabled xlib &&
 check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
 enable vaapi_x11
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 941057b..64c68b7 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -719,6 +719,7 @@ OBJS-$(CONFIG_ADPCM_YAMAHA_ENCODER)   += adpcmenc.o 
adpcm_data.o
 OBJS-$(CONFIG_D3D11VA)+= dxva2.o
 OBJS-$(CONFIG_DXVA2)  += dxva2.o
 OBJS-$(CONFIG_VAAPI)  += vaapi.o
+OBJS-$(CONFIG_VAAPI_RECENT)   += vaapi_support.o
 OBJS-$(CONFIG_VDA)+= vda.o videotoolbox.o
 OBJS-$(CONFIG_VIDEOTOOLBOX)   += videotoolbox.o
 OBJS-$(CONFIG_VDPAU)  += vdpau.o
diff --git a/libavcodec/vaapi_support.c b/libavcodec/vaapi_support.c
new file mode 100644
index 000..6be4669
--- /dev/null
+++ b/libavcodec/vaapi_support.c
@@ -0,0 +1,852 @@
+/*
+ * VAAPI helper functions.
+ *
+ * Copyright (C) 2016 Mark Thompson 
+ *
+ * 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
+ */
+
+#include "vaapi_support.h"
+
+#include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/pixfmt.h"
+
+#define AV_VAAPI_MAX_SURFACES 64
+
+
+static const AVClass vaapi_class = {
+.class_name = "vaapi",
+.item_name  = av_default_item_name,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
+AVVAAPIHardwareContext *av_vaapi_alloc_hardware_context(void)
+{
+AVVAAPIHardwareContext *hw_ctx =
+av_mallocz(sizeof(AVVAAPIHardwareContext));
+if(!hw_ctx)
+return NULL;
+
+hw_ctx->class = _class;
+return hw_ctx;
+}
+
+void av_vaapi_lock_hardware_context(AVVAAPIHardwareContext *ctx)
+{
+if(ctx->lock)
+ctx->lock(ctx->lock_user_context);
+}
+
+void av_vaapi_unlock_hardware_context(AVVAAPIHardwareContext *ctx)
+{
+if(ctx->unlock)
+ctx->unlock(ctx->lock_user_context);
+}
+
+
+typedef struct AVVAAPISurfacePool {
+AVVAAPIHardwareContext *hardware_context;
+
+int frame_count;
+AVFrame *frames[AV_VAAPI_MAX_SURFACES];
+} AVVAAPISurfacePool;
+
+AVVAAPISurfacePool *av_vaapi_alloc_surface_pool(AVVAAPIHardwareContext *hw_ctx)
+{
+AVVAAPISurfacePool *pool = av_mallocz(sizeof(AVVAAPISurfacePool));
+if(!pool)
+return NULL;
+
+pool->hardware_context = hw_ctx;
+return pool;
+}
+
+
+typedef struct AVVAAPIPipelineContext {
+const AVClass *class;
+
+AVVAAPIHardwareContext *hardware_context;
+
+VAConfigID config_id;
+VAContextID context_id;
+} AVVAAPIPipelineContext;
+
+AVVAAPIPipelineContext *av_vaapi_alloc_pipeline_context(AVVAAPIHardwareContext 
*hw_ctx)
+{
+AVVAAPIPipelineContext *ctx =
+av_mallocz(sizeof(AVVAAPIPipelineContext));
+if(!ctx)
+return NULL;
+
+ctx->class = _class;
+ctx->hardware_context = hw_ctx;
+return ctx;
+}
+
+
+typedef struct AVVAAPISurface {
+VASurfaceID id;
+AVVAAPIHardwareContext *hardware_context;
+
+VAImage image;
+int derive_doesnt_work;
+int mapping_flags;
+void *mapped_address;
+} AVVAAPISurface;
+
+static AVVAAPISurface *vaapi_get_surface(const AVFrame *frame)
+{
+av_assert0(frame);
+av_assert0(frame->buf[0]);
+av_assert0(frame->buf[0]->data);
+return (AVVAAPISurface*)frame->buf[0]->data;
+}
+
+static AVVAAPISurfaceConfig *vaapi_get_surface_config(const AVFrame *frame)
+{
+av_assert0(frame);
+av_assert0(frame->buf[1]);
+

[FFmpeg-devel] [PATCH v3] avcodec: implement a native VC-2 HQ profile encoder

2016-02-07 Thread Rostislav Pehlivanov
Changes from last version:
-use ptrdiff_t for strides

Signed-off-by: Rostislav Pehlivanov 
---
 libavcodec/Makefile |1 +
 libavcodec/allcodecs.c  |1 +
 libavcodec/vc2enc.c | 1194 +++
 libavcodec/vc2enc_dwt.c |  234 ++
 libavcodec/vc2enc_dwt.h |   54 +++
 5 files changed, 1484 insertions(+)
 create mode 100644 libavcodec/vc2enc.c
 create mode 100644 libavcodec/vc2enc_dwt.c
 create mode 100644 libavcodec/vc2enc_dwt.h

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 941057b..f6a4fbb 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -543,6 +543,7 @@ OBJS-$(CONFIG_VC1_DECODER) += vc1dec.o 
vc1_block.o vc1_loopfilter.o
   wmv2dsp.o
 OBJS-$(CONFIG_VC1_MMAL_DECODER)+= mmaldec.o
 OBJS-$(CONFIG_VC1_QSV_DECODER) += qsvdec_vc1.o
+OBJS-$(CONFIG_VC2_ENCODER) += vc2enc.o vc2enc_dwt.o diractab.o
 OBJS-$(CONFIG_VCR1_DECODER)+= vcr1.o
 OBJS-$(CONFIG_VMDAUDIO_DECODER)+= vmdaudio.o
 OBJS-$(CONFIG_VMDVIDEO_DECODER)+= vmdvideo.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index c7c1af5..2097db0 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -336,6 +336,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(VC1IMAGE,  vc1image);
 REGISTER_DECODER(VC1_MMAL,  vc1_mmal);
 REGISTER_DECODER(VC1_QSV,   vc1_qsv);
+REGISTER_ENCODER(VC2,   vc2);
 REGISTER_DECODER(VCR1,  vcr1);
 REGISTER_DECODER(VMDVIDEO,  vmdvideo);
 REGISTER_DECODER(VMNC,  vmnc);
diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
new file mode 100644
index 000..dbcde0f
--- /dev/null
+++ b/libavcodec/vc2enc.c
@@ -0,0 +1,1194 @@
+/*
+ * Copyright (C) 2016 Open Broadcast Systems Ltd.
+ * Author(C) 2016 Rostislav Pehlivanov 
+ *
+ * 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
+ */
+
+#include "libavutil/ffversion.h"
+#include "libavutil/pixdesc.h"
+#include "libavutil/opt.h"
+#include "dirac.h"
+#include "put_bits.h"
+#include "internal.h"
+
+#include "vc2enc_dwt.h"
+#include "diractab.h"
+
+/* Quantizations above this usually zero coefficients and lower the quality */
+#define MAX_QUANT_INDEX 49
+
+#define COEF_LUT_TAB 2048
+
+enum VC2_QM {
+VC2_QM_DEF = 0,
+VC2_QM_COL,
+VC2_QM_FLAT,
+
+VC2_QM_NB
+};
+
+typedef struct SubBand {
+dwtcoef *buf;
+ptrdiff_t stride;
+int width;
+int height;
+} SubBand;
+
+typedef struct Plane {
+SubBand band[MAX_DWT_LEVELS][4];
+dwtcoef *coef_buf;
+int width;
+int height;
+int dwt_width;
+int dwt_height;
+ptrdiff_t coef_stride;
+} Plane;
+
+typedef struct SliceArgs {
+PutBitContext pb;
+void *ctx;
+int x;
+int y;
+int quant_idx;
+int bits_ceil;
+int bytes;
+} SliceArgs;
+
+typedef struct TransformArgs {
+void *ctx;
+Plane *plane;
+void *idata;
+ptrdiff_t istride;
+int field;
+VC2TransformContext t;
+} TransformArgs;
+
+typedef struct VC2EncContext {
+AVClass *av_class;
+PutBitContext pb;
+Plane plane[3];
+AVCodecContext *avctx;
+DiracVersionInfo ver;
+
+SliceArgs *slice_args;
+TransformArgs transform_args[3];
+
+/* For conversion from unsigned pixel values to signed */
+int diff_offset;
+int bpp;
+
+/* Picture number */
+uint32_t picture_number;
+
+/* Base video format */
+int base_vf;
+int level;
+int profile;
+
+/* Quantization matrix */
+uint8_t quant[MAX_DWT_LEVELS][4];
+
+/* Coefficient LUT */
+uint32_t *coef_lut_val;
+uint8_t  *coef_lut_len;
+
+int num_x; /* #slices horizontally */
+int num_y; /* #slices vertically */
+int prefix_bytes;
+int size_scaler;
+int chroma_x_shift;
+int chroma_y_shift;
+
+/* Rate control stuff */
+int slice_max_bytes;
+int q_ceil;
+int q_start;
+
+/* Options */
+double tolerance;
+int wavelet_idx;
+int wavelet_depth;
+int strict_compliance;
+int slice_height;
+int slice_width;
+int interlaced;
+enum VC2_QM quant_matrix;
+
+/* Parse code state */

[FFmpeg-devel] [PATCH] avformat/asfenc: write group_mutual_exclusion_objects on multiple languages

2016-02-07 Thread Marton Balint
Improves streaming compatibility with Windows Media Services. Also tested for
compatilbility in Windows Media Player, Windows Media ASF Viewer and VLC.

Signed-off-by: Marton Balint 
---
 libavformat/asf.c|  8 
 libavformat/asf.h|  2 ++
 libavformat/asfenc.c | 15 +++
 3 files changed, 25 insertions(+)

diff --git a/libavformat/asf.c b/libavformat/asf.c
index 455ca4d..719cae9 100644
--- a/libavformat/asf.c
+++ b/libavformat/asf.c
@@ -147,6 +147,14 @@ const ff_asf_guid ff_asf_extended_stream_properties_object 
= {
 0xcb, 0xa5, 0xe6, 0x14, 0x72, 0xc6, 0x32, 0x43, 0x83, 0x99, 0xa9, 0x69, 
0x52, 0x06, 0x5b, 0x5a
 };
 
+const ff_asf_guid ff_asf_group_mutual_exclusion_object = {
+0x40, 0x5a, 0x46, 0xd1, 0x79, 0x5a, 0x38, 0x43, 0xb7, 0x1b, 0xe3, 0x6b, 
0x8f, 0xd6, 0xc2, 0x49
+};
+
+const ff_asf_guid ff_asf_mutex_language = {
+0x00, 0x2a, 0xe2, 0xd6, 0xda, 0x35, 0xd1, 0x11, 0x90, 0x34, 0x00, 0xa0, 
0xc9, 0x03, 0x49, 0xbe
+};
+
 /* List of official tags at 
http://msdn.microsoft.com/en-us/library/dd743066(VS.85).aspx */
 const AVMetadataConv ff_asf_metadata_conv[] = {
 { "WM/AlbumArtist",  "album_artist" },
diff --git a/libavformat/asf.h b/libavformat/asf.h
index 914ddef..43288dd 100644
--- a/libavformat/asf.h
+++ b/libavformat/asf.h
@@ -100,6 +100,8 @@ extern const ff_asf_guid ff_asf_content_encryption;
 extern const ff_asf_guid ff_asf_ext_content_encryption;
 extern const ff_asf_guid ff_asf_digital_signature;
 extern const ff_asf_guid ff_asf_extended_stream_properties_object;
+extern const ff_asf_guid ff_asf_group_mutual_exclusion_object;
+extern const ff_asf_guid ff_asf_mutex_language;
 
 extern const AVMetadataConv ff_asf_metadata_conv[];
 
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index a6a8242..3317133 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -396,6 +396,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t 
file_size,
 int64_t header_offset, cur_pos, hpos;
 int bit_rate;
 int64_t duration;
+int language_counts[128] = { 0 };
 
 ff_metadata_conv(>metadata, ff_asf_metadata_conv, NULL);
 
@@ -447,6 +448,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t 
file_size,
 asf->streams[n].stream_language_index = asf->nb_languages;
 asf->nb_languages++;
 }
+language_counts[asf->streams[n].stream_language_index]++;
 }
 } else {
 asf->streams[n].stream_language_index = 128;
@@ -496,6 +498,19 @@ static int asf_write_header1(AVFormatContext *s, int64_t 
file_size,
 }
 end_header(pb, hpos2);
 
+if (asf->nb_languages > 1) {
+hpos2 = put_header(pb, _asf_group_mutual_exclusion_object);
+ff_put_guid(pb, _asf_mutex_language);
+avio_wl16(pb, asf->nb_languages);
+for (i = 0; i < asf->nb_languages; i++) {
+avio_wl16(pb, language_counts[i]);
+for (n = 0; n < s->nb_streams; n++)
+if (asf->streams[n].stream_language_index == i)
+avio_wl16(pb, n + 1);
+}
+end_header(pb, hpos2);
+}
+
 for (n = 0; n < s->nb_streams; n++) {
 int64_t es_pos;
 if (asf->streams[n].stream_language_index > 127)
-- 
2.6.2

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


Re: [FFmpeg-devel] List of FFmpeg API changes

2016-02-07 Thread Paul B Mahol
On 2/7/16, Ponomarenko Andrey  wrote:
> Hello,
>
> I continue maintaining list of API changes in FFmpeg here:
> http://abi-laboratory.pro/tracker/timeline/ffmpeg/
>
> Please fix the link on this page: https://trac.ffmpeg.org/ (List of FFmpeg
> API changes/compatibility test results). The domain upstream-tracker dot org
> was sold by my old employer and contains inappropriate content for now.
>

Everybody can edit it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: remove usage of YUVJ pixel formats

2016-02-07 Thread Michael Niedermayer
On Sun, Feb 07, 2016 at 02:51:30PM +0100, Paul B Mahol wrote:
> Hi,
> 
> patch attached.

>  mjpegdec.c |   29 +++--
>  1 file changed, 11 insertions(+), 18 deletions(-)
> f96182fe8e6d732d95d178e739e0c76bfde98670  
> 0001-avcodec-mjpegdec-remove-usage-of-YUVJ-pixel-formats.patch
> From 9906feda3445d7474ac8d88bfbbe7250e6e14ec4 Mon Sep 17 00:00:00 2001
> From: Paul B Mahol 
> Date: Sun, 7 Feb 2016 14:49:14 +0100
> Subject: [PATCH] avcodec/mjpegdec: remove usage of YUVJ pixel formats
> 
> They have been deprecated long ago.
> 
> Signed-off-by: Paul B Mahol 

breaks fate
make: *** [fate-api-mjpeg-codec-param] Error 1
make: *** [fate-vsynth1-amv] Error 1
make: *** [fate-vsynth1-mjpeg] Error 1
make: *** [fate-vsynth1-mjpeg-trell] Error 1
make: *** [fate-vsynth2-amv] Error 1
make: *** [fate-vsynth2-mjpeg] Error 1
make: *** [fate-vsynth2-mjpeg-trell] Error 1
make: *** [fate-vsynth3-amv] Error 1
make: *** [fate-vsynth3-mjpeg] Error 1
make: *** [fate-vsynth3-mjpeg-trell] Error 1
make: *** [fate-vsynth_lena-amv] Error 1
make: *** [fate-vsynth_lena-mjpeg] Error 1
make: *** [fate-vsynth_lena-mjpeg-trell] Error 1
make: *** [fate-tdsc] Error 1
make: *** [fate-exif-image-jpg] Error 1
make: *** [fate-exif-image-embedded] Error 1

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libvpxenc: Allow setting tune parameter

2016-02-07 Thread Timothy Gu
On Tue, Feb 02, 2016 at 06:20:39PM -0800, James Zern wrote:
> On Tue, Feb 2, 2016 at 6:10 PM, Timothy Gu  wrote:
> > ---
> >  doc/encoders.texi  | 6 ++
> >  libavcodec/libvpxenc.c | 8 
> >  2 files changed, 14 insertions(+)
> >
> 
> lgtm

Pushed. Thanks.

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


Re: [FFmpeg-devel] Fwd: Questionable libav code

2016-02-07 Thread Hendrik Leppkes
On Sun, Feb 7, 2016 at 6:38 PM, Ratin  wrote:
> On Tue, Feb 2, 2016 at 11:41 PM, wm4  wrote:
>
>> On Tue, 2 Feb 2016 14:31:20 -0800
>> Ratin  wrote:
>>
>> > libavcodec has codes like this one (utils.c):
>> >
>> > static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket
>> *pkt,
>> >AVPacketList **plast_pktl)
>> > {
>> > AVPacketList *pktl = av_mallocz(sizeof(AVPacketList));
>> > if (!pktl)
>> > return NULL;
>> >
>> > if (*packet_buffer)
>> > (*plast_pktl)->next = pktl;
>> > else
>> > *packet_buffer = pktl;
>> >
>> > /* Add the packet in the buffered packet list. */
>> > *plast_pktl = pktl;
>> > pktl->pkt   = *pkt; <===
>> > return >pkt;
>> > }
>> >
>> > Here a struct variable is meant to be copied over via assignment, is that
>> > 100% correct to always work the way was intended?  Given that the struct
>> > pkt is a big struct which has raw bytes that are malloc'd. I was always
>> > trained to avoid such struct assignment operations. What do people think?
>>
>> There is no problem at all here.
>>
>
>  Sorry a bit confused, what happens when second argument is not malloc'ed,
> somebody uses
>
> AVPacket pkt;
> add_to_pktbuf(packet_list, , plastpkt)
>

add_to_pktbuf is private internal API, if it would be used like this
it would be a bug, but its not used like that, so there is no problem.

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


[FFmpeg-devel] [PATCH] avfilter/vaf_spectrumsynth: Move "break" up

2016-02-07 Thread Michael Niedermayer
Fixes CID1351347

Signed-off-by: Michael Niedermayer 
---
 libavfilter/vaf_spectrumsynth.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vaf_spectrumsynth.c b/libavfilter/vaf_spectrumsynth.c
index ab9a69b..ba14d8d 100644
--- a/libavfilter/vaf_spectrumsynth.c
+++ b/libavfilter/vaf_spectrumsynth.c
@@ -442,11 +442,11 @@ static int try_push_frames(AVFilterContext *ctx)
 case SCROLL:
 s->xpos = s->xend - 1;
 ret = try_push_frame(ctx, s->xpos);
+break;
 case RSCROLL:
 s->xpos = 0;
 ret = try_push_frame(ctx, s->xpos);
 break;
-break;
 case FULLFRAME:
 for (x = 0; x < s->xend; x++) {
 ret = try_push_frame(ctx, x);
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [FFmpeg-cvslog] build: use a link instead of changing current directory when compiling

2016-02-07 Thread Andreas Cadhalpun
On 06.02.2016 21:49, Clément Bœsch wrote:
> On Sat, Feb 06, 2016 at 04:26:43PM +0100, Andreas Cadhalpun wrote:
>> On 03.02.2016 00:41, Andreas Cadhalpun wrote:
>>> I see, it passes '-b $(SRC_PATH)' to lcov, which is now unnecessary/harmful
>>> for out-of-tree builds using the src link.
>>> The first attached patch changes it to simply use the current directory in
>>> that case.
>>> The second patch was necessary to fix the following error:
>>> lcov: ERROR: cannot write to coverage.info!
>>>
>>> Does it work for you without that patch?
>>
>> I'd still be interested in an answer, but I've pushed the patches now to
>> unbreak coverage.ffmpeg.org.
>>
> 
> I'm really sorry, I didn't have time to try out this week. Thanks for the
> fix, coverage.ffmpeg.org is up again.

No problem. Thanks for following up now.

> About providing more information than a 404 when there is an error, that
> would indeed be better, but I lack time currently, and this is really not
> a priority for me.

OK. It's just something to add to the ever growing TODO list, I guess.

On 06.02.2016 22:43, Clément Bœsch wrote:
>> The second patch was necessary to fix the following error:
>> > lcov: ERROR: cannot write to coverage.info!
>> > 
>> > Does it work for you without that patch?
>> > 
> I confirm it fails the same way as you without the second patch.

Thanks for confirming that. I find it a bit strange, as I don't see why it
doesn't work as previously. But since it was easy to work around, I won't dig
deeper.

Best regards,
Andreas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v6 2/6] ffmpeg: VAAPI hwaccel helper and related initialisation

2016-02-07 Thread Mark Thompson

---
 Makefile   |   1 +
 configure  |   5 +
 ffmpeg.c   |   6 +
 ffmpeg.h   |   9 +
 ffmpeg_opt.c   |  38 +++-
 ffmpeg_vaapi.c | 630 +
 6 files changed, 688 insertions(+), 1 deletion(-)
 create mode 100644 ffmpeg_vaapi.c

diff --git a/Makefile b/Makefile
index 87a9869..cbab50e 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,7 @@ OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_videotoolbox.o
 endif
 OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += ffmpeg_videotoolbox.o
 OBJS-ffmpeg-$(CONFIG_LIBMFX)  += ffmpeg_qsv.o
+OBJS-ffmpeg-$(CONFIG_VAAPI_RECENT) += ffmpeg_vaapi.o
 OBJS-ffserver += ffserver_config.o

 TESTTOOLS   = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
diff --git a/configure b/configure
index 0880569..f8267d1 100755
--- a/configure
+++ b/configure
@@ -1965,6 +1965,7 @@ HAVE_LIST="
 section_data_rel_ro
 texi2html
 threads
+vaapi_drm
 vaapi_x11
 vdpau_x11
 winrt
@@ -5779,6 +5780,10 @@ enabled vaapi && enabled xlib &&
 check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
 enable vaapi_x11

+enabled vaapi &&
+check_lib2 "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm &&
+enable vaapi_drm
+
 enabled vdpau &&
 check_cpp_condition vdpau/vdpau.h "defined 
VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
 disable vdpau
diff --git a/ffmpeg.c b/ffmpeg.c
index a5ec3c3..6616a07 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2603,6 +2603,12 @@ static int init_output_stream(OutputStream *ost, char 
*error, int error_len)
 !av_dict_get(ost->encoder_opts, "ab", NULL, 0))
 av_dict_set(>encoder_opts, "b", "128000", 0);

+#if CONFIG_VAAPI_RECENT
+if(ost->enc->type == AVMEDIA_TYPE_VIDEO &&
+   strstr(ost->enc->name, "vaapi"))
+vaapi_hardware_set_options(>encoder_opts);
+#endif
+
 if ((ret = avcodec_open2(ost->enc_ctx, codec, >encoder_opts)) < 
0) {
 if (ret == AVERROR_EXPERIMENTAL)
 abort_codec_experimental(codec, 1);
diff --git a/ffmpeg.h b/ffmpeg.h
index 20322b0..85173a8 100644
--- a/ffmpeg.h
+++ b/ffmpeg.h
@@ -65,6 +65,7 @@ enum HWAccelID {
 HWACCEL_VDA,
 HWACCEL_VIDEOTOOLBOX,
 HWACCEL_QSV,
+HWACCEL_VAAPI,
 };

 typedef struct HWAccel {
@@ -126,6 +127,8 @@ typedef struct OptionsContext {
 intnb_hwaccels;
 SpecifierOpt *hwaccel_devices;
 intnb_hwaccel_devices;
+SpecifierOpt *hwaccel_output_formats;
+intnb_hwaccel_output_formats;
 SpecifierOpt *autorotate;
 intnb_autorotate;

@@ -325,6 +328,7 @@ typedef struct InputStream {
 /* hwaccel options */
 enum HWAccelID hwaccel_id;
 char  *hwaccel_device;
+enum AVPixelFormat hwaccel_output_format;

 /* hwaccel context */
 enum HWAccelID active_hwaccel_id;
@@ -540,6 +544,7 @@ extern AVIOContext *progress_avio;
 extern float max_error_rate;
 extern int vdpau_api_ver;
 extern char *videotoolbox_pixfmt;
+extern int hwaccel_lax_profile_check;

 extern const AVIOInterruptCB int_cb;

@@ -577,5 +582,9 @@ int vda_init(AVCodecContext *s);
 int videotoolbox_init(AVCodecContext *s);
 int qsv_init(AVCodecContext *s);
 int qsv_transcode_init(OutputStream *ost);
+int vaapi_decode_init(AVCodecContext *s);
+
+int vaapi_hardware_init(const char *device);
+int vaapi_hardware_set_options(AVDictionary **dict);

 #endif /* FFMPEG_H */
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 669976b..d65293e 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -82,8 +82,12 @@ const HWAccel hwaccels[] = {
 #if CONFIG_LIBMFX
 { "qsv",   qsv_init,   HWACCEL_QSV,   AV_PIX_FMT_QSV },
 #endif
+#if CONFIG_VAAPI_RECENT
+{ "vaapi", vaapi_decode_init, HWACCEL_VAAPI, AV_PIX_FMT_VAAPI },
+#endif
 { 0 },
 };
+int hwaccel_lax_profile_check = 0;

 char *vstats_filename;
 char *sdp_filename;
@@ -442,6 +446,15 @@ static int opt_sdp_file(void *optctx, const char *opt, 
const char *arg)
 return 0;
 }

+#if CONFIG_VAAPI_RECENT
+static int opt_vaapi(void *optctx, const char *opt, const char *arg)
+{
+if(vaapi_hardware_init(arg))
+exit_program(1);
+return 0;
+}
+#endif
+
 /**
  * Parse a metadata specifier passed as 'arg' parameter.
  * @param arg  metadata string to parse
@@ -633,7 +646,8 @@ static void add_input_streams(OptionsContext *o, 
AVFormatContext *ic)
 AVStream *st = ic->streams[i];
 AVCodecContext *dec = st->codec;
 InputStream *ist = av_mallocz(sizeof(*ist));
-char *framerate = NULL, *hwaccel = NULL, *hwaccel_device = NULL;
+char *framerate = NULL;
+char *hwaccel = NULL, *hwaccel_device = NULL, *hwaccel_output_format = 
NULL;
 char *codec_tag = NULL;
 char *next;
 char *discard_str = NULL;
@@ -753,6 +767,18 @@ static void add_input_streams(OptionsContext *o, 
AVFormatContext *ic)
 if (!ist->hwaccel_device)
 exit_program(1);
 }
+
+

Re: [FFmpeg-devel] [PATCH] avfilter/vaf_spectrumsynth: Move "break" up

2016-02-07 Thread Michael Niedermayer
On Sun, Feb 07, 2016 at 10:37:20PM +0100, Paul B Mahol wrote:
> On 2/7/16, Michael Niedermayer  wrote:
> > Fixes CID1351347
> >
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavfilter/vaf_spectrumsynth.c |2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavfilter/vaf_spectrumsynth.c
> > b/libavfilter/vaf_spectrumsynth.c
> > index ab9a69b..ba14d8d 100644
> > --- a/libavfilter/vaf_spectrumsynth.c
> > +++ b/libavfilter/vaf_spectrumsynth.c
> > @@ -442,11 +442,11 @@ static int try_push_frames(AVFilterContext *ctx)
> >  case SCROLL:
> >  s->xpos = s->xend - 1;
> >  ret = try_push_frame(ctx, s->xpos);
> > +break;
> >  case RSCROLL:
> >  s->xpos = 0;
> >  ret = try_push_frame(ctx, s->xpos);
> >  break;
> > -break;
> >  case FULLFRAME:
> >  for (x = 0; x < s->xend; x++) {
> >  ret = try_push_frame(ctx, x);
> > --
> > 1.7.9.5
> >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> LGTM, silly mistake.

applied

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vaf_spectrumsynth: Move "break" up

2016-02-07 Thread Paul B Mahol
On 2/7/16, Michael Niedermayer  wrote:
> Fixes CID1351347
>
> Signed-off-by: Michael Niedermayer 
> ---
>  libavfilter/vaf_spectrumsynth.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavfilter/vaf_spectrumsynth.c
> b/libavfilter/vaf_spectrumsynth.c
> index ab9a69b..ba14d8d 100644
> --- a/libavfilter/vaf_spectrumsynth.c
> +++ b/libavfilter/vaf_spectrumsynth.c
> @@ -442,11 +442,11 @@ static int try_push_frames(AVFilterContext *ctx)
>  case SCROLL:
>  s->xpos = s->xend - 1;
>  ret = try_push_frame(ctx, s->xpos);
> +break;
>  case RSCROLL:
>  s->xpos = 0;
>  ret = try_push_frame(ctx, s->xpos);
>  break;
> -break;
>  case FULLFRAME:
>  for (x = 0; x < s->xend; x++) {
>  ret = try_push_frame(ctx, x);
> --
> 1.7.9.5
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

LGTM, silly mistake.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v6 0/6] VAAPI support infrastructure

2016-02-07 Thread Mark Thompson
Hi all,

More VAAPI following.  This is only parts one and two (infrastructure), the 
other parts have not changed beyond what is needed to support changes to these 
two.


Changes:

* Made some more structures user-opaque, added allocation functions for them.  
Log classes around them also more consistent.

* Surface mapping can now explicitly request direct access, and if possible 
will get it by default for write-only mapping.

* Documentation (doxygen) added for all public interfaces.

* Format handling is improved; the surface configuration can now make RGB 
surfaces correctly.  (User visibility of RT_FORMAT is removed.)


Outstanding:

* Interaction (or not) with other patches.

* There is still no way to get a hardware context through the filter graph.


Thanks,

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


Re: [FFmpeg-devel] [PATCH 1/2] diracdec: Split DWTPlane struct from Plane

2016-02-07 Thread Timothy Gu
On Sun, Feb 07, 2016 at 03:34:58PM +, Rostislav Pehlivanov wrote:
> On 7 February 2016 at 14:53, Timothy Gu  wrote:
> 
> > ---
> >  libavcodec/dirac_dwt.h |  9 +
> >  libavcodec/diracdec.c  | 47
> > +--
> >  2 files changed, 30 insertions(+), 26 deletions(-)
> 
> 
> LGTM, the decoder could definitely use some clean-ups
> 
> Thanks

Pushed. Thanks.

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


Re: [FFmpeg-devel] [PATCH 2/2] diracdec: Pass DWTPlane to dwt init

2016-02-07 Thread Timothy Gu
On Sun, Feb 07, 2016 at 03:35:31PM +, Rostislav Pehlivanov wrote:
> On 7 February 2016 at 14:53, Timothy Gu  wrote:
> 
> > ---
> >  libavcodec/dirac_dwt.c | 15 +++
> >  libavcodec/dirac_dwt.h |  5 ++---
> >  libavcodec/diracdec.c  |  4 ++--
> >  3 files changed, 11 insertions(+), 13 deletions(-)
> >
> >
> LGTM
> 
> Thanks

Pushed. Thanks.

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


Re: [FFmpeg-devel] [PATCH] x86/cpu: set avxslow cpuflag on bdver4 and btver2 CPUs

2016-02-07 Thread Hendrik Leppkes
On Sun, Feb 7, 2016 at 4:05 AM, James Almer  wrote:
> They are also slow when using 256 bit wide registers
>
> Signed-off-by: James Almer 
> ---
> See 
> https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=3a33f4ce8ea1efdebec7f7138d00e9be9a12d630
>  libavutil/x86/cpu.c | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c
> index f57d72d..bb63daa 100644
> --- a/libavutil/x86/cpu.c
> +++ b/libavutil/x86/cpu.c
> @@ -182,13 +182,11 @@ int ff_get_cpu_flags_x86(void)
>
>  /* Similar to the above but for AVX functions on AMD processors.
> This is necessary only for functions using YMM registers on 
> Bulldozer
> -   based CPUs as they lack 256-bits execution units. SSE/AVX 
> functions
> -   using XMM registers are always faster on them.
> +   and Jaguar based CPUs as they lack 256-bits execution units. 
> SSE/AVX
> +   functions using XMM registers are always faster on them.
> AV_CPU_FLAG_AVX and AV_CPU_FLAG_AVXSLOW are both set so that AVX 
> is
> -   used unless explicitly disabled by checking AV_CPU_FLAG_AVXSLOW.
> -   TODO: Confirm if Excavator is affected or not by this once it's
> - released, and update the check if necessary. Same for 
> btver2. */
> -if (family == 0x15 && (rval & AV_CPU_FLAG_AVX))
> +   used unless explicitly disabled by checking AV_CPU_FLAG_AVXSLOW. 
> */
> +if ((family == 0x15 || family == 0x16) && (rval & 
> AV_CPU_FLAG_AVX))
>  rval |= AV_CPU_FLAG_AVXSLOW;
>  }
>


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


Re: [FFmpeg-devel] Fwd: Questionable libav code

2016-02-07 Thread Ratin
On Tue, Feb 2, 2016 at 11:41 PM, wm4  wrote:

> On Tue, 2 Feb 2016 14:31:20 -0800
> Ratin  wrote:
>
> > libavcodec has codes like this one (utils.c):
> >
> > static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket
> *pkt,
> >AVPacketList **plast_pktl)
> > {
> > AVPacketList *pktl = av_mallocz(sizeof(AVPacketList));
> > if (!pktl)
> > return NULL;
> >
> > if (*packet_buffer)
> > (*plast_pktl)->next = pktl;
> > else
> > *packet_buffer = pktl;
> >
> > /* Add the packet in the buffered packet list. */
> > *plast_pktl = pktl;
> > pktl->pkt   = *pkt; <===
> > return >pkt;
> > }
> >
> > Here a struct variable is meant to be copied over via assignment, is that
> > 100% correct to always work the way was intended?  Given that the struct
> > pkt is a big struct which has raw bytes that are malloc'd. I was always
> > trained to avoid such struct assignment operations. What do people think?
>
> There is no problem at all here.
>

 Sorry a bit confused, what happens when second argument is not malloc'ed,
somebody uses

AVPacket pkt;
add_to_pktbuf(packet_list, , plastpkt)


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


[FFmpeg-devel] [PATCH] LICENSE: Thorough editing

2016-02-07 Thread Timothy Gu
---
 LICENSE.md | 41 +++--
 1 file changed, 23 insertions(+), 18 deletions(-)

diff --git a/LICENSE.md b/LICENSE.md
index 0c53d0f..b50430f 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,4 +1,4 @@
-#FFmpeg:
+# License
 
 Most files in FFmpeg are under the GNU Lesser General Public License version 
2.1
 or later (LGPL v2.1+). Read the file `COPYING.LGPLv2.1` for details. Some other
@@ -14,15 +14,18 @@ Specifically, the GPL parts of FFmpeg are:
 
 - libpostproc
 - optional x86 optimizations in the files
-  - `libavcodec/x86/flac_dsp_gpl.asm`
-  - `libavcodec/x86/idct_mmx.c`
-  - `libavfilter/x86/vf_removegrain.asm`
-- libutvideo encoding/decoding wrappers in
-  `libavcodec/libutvideo*.cpp`
+- `libavcodec/x86/flac_dsp_gpl.asm`
+- `libavcodec/x86/idct_mmx.c`
+- `libavfilter/x86/vf_removegrain.asm`
+- libutvideo encoding/decoding wrappers in `libavcodec/libutvideo*.cpp`
 - the X11 grabber in `libavdevice/x11grab.c`
-- the swresample test app in
-  `libswresample/swresample-test.c`
-- the `texi2pod.pl` tool
+- the following building and testing tools
+- `compat/solaris/make_sunver.pl`
+- `doc/t2h.pm`
+- `doc/texi2pod.pl`
+- `libswresample/swresample-test.c`
+- `tests/checkasm/*`
+- `tests/tiny_ssim.c`
 - the following filters in libavfilter:
 - `f_ebur128.c`
 - `vf_blackframe.c`
@@ -47,9 +50,9 @@ Specifically, the GPL parts of FFmpeg are:
 - `vf_pp.c`
 - `vf_pp7.c`
 - `vf_pullup.c`
+- `vf_repeatfields.c`
 - `vf_sab.c`
 - `vf_smartblur.c`
-- `vf_repeatfields.c`
 - `vf_spp.c`
 - `vf_stereo3d.c`
 - `vf_super2xsai.c`
@@ -73,14 +76,12 @@ There are a handful of files under other licensing terms, 
namely:
 * `tests/reference.pnm` is under the expat license.
 
 
-external libraries
-==
+## External libraries
 
 FFmpeg can be combined with a number of external libraries, which sometimes
 affect the licensing of binaries resulting from the combination.
 
-compatible libraries
-
+### Compatible libraries
 
 The following libraries are under GPL:
 - frei0r
@@ -101,13 +102,17 @@ license is incompatible with the LGPL v2.1 and the GPL 
v2, but not with
 version 3 of those licenses. So to combine these libraries with FFmpeg, the
 license version needs to be upgraded by passing `--enable-version3` to 
configure.
 
-incompatible libraries
---
+### Incompatible libraries
 
-The Fraunhofer AAC library and FAAC are under licenses which
+The FAAC and Fraunhofer AAC libraries are under licenses which
 are incompatible with the GPLv2 and v3. We do not know for certain if their
 licenses are compatible with the LGPL.
-If you wish to enable these libraries, pass `--enable-nonfree` to configure.
+
+The OpenSSL library is under a license which is incompatible with the GPL but
+may be compatible with the LGPL.
+
+If you wish to enable these libraries, even in circumstances that their
+license may be incompatible, pass `--enable-nonfree` to configure.
 But note that if you enable any of these libraries the resulting binary will
 be under a complex license mix that is more restrictive than the LGPL and that
 may result in additional obligations. It is possible that these
-- 
2.1.4

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


[FFmpeg-devel] [PATCH] avutil: Remove x86_cpu.h

2016-02-07 Thread Timothy Gu
It is private (uninstalled) and unused.
---
 libavutil/x86_cpu.h | 1 -
 1 file changed, 1 deletion(-)
 delete mode 100644 libavutil/x86_cpu.h

diff --git a/libavutil/x86_cpu.h b/libavutil/x86_cpu.h
deleted file mode 100644
index bec1c77..000
--- a/libavutil/x86_cpu.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "libavutil/x86/asm.h"
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH] rtpdec: support for VC-2 HQ RTP payload format (draft v1)

2016-02-07 Thread Thomas Volkert



On 02/03/2016 10:21 AM, si...@gmx.net wrote:

From: Thomas Volkert 

---
  Changelog|   1 +
  libavformat/Makefile |   1 +
  libavformat/rtpdec.c |   1 +
  libavformat/rtpdec_formats.h |   1 +
  libavformat/rtpdec_vc2hq.c   | 225 +++
  libavformat/version.h|   4 +-
  6 files changed, 231 insertions(+), 2 deletions(-)
  create mode 100644 libavformat/rtpdec_vc2hq.c

[..]


Are there any objections on this?

Best regards,
Thomas.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] rtpdec: support for VC-2 HQ RTP payload format (draft v1)

2016-02-07 Thread Thomas Volkert



On 02/07/2016 07:54 PM, Paul B Mahol wrote:

On 2/7/16, Thomas Volkert  wrote:


On 02/03/2016 10:21 AM, si...@gmx.net wrote:

From: Thomas Volkert 

---
   Changelog|   1 +
   libavformat/Makefile |   1 +
   libavformat/rtpdec.c |   1 +
   libavformat/rtpdec_formats.h |   1 +
   libavformat/rtpdec_vc2hq.c   | 225
+++
   libavformat/version.h|   4 +-
   6 files changed, 231 insertions(+), 2 deletions(-)
   create mode 100644 libavformat/rtpdec_vc2hq.c

[..]

Are there any objections on this?


I guess it can be tested and works?



Yes, it can be tested with the packetizer from the draft author - this 
works for me.

Source code is here: https://github.com/bbc/gstrtpvc2

Best regards,
Thomas.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Check av_dup_packet() return code

2016-02-07 Thread Michael Niedermayer
On Wed, Feb 03, 2016 at 11:27:00PM +0100, Andreas Cadhalpun wrote:
> On 03.02.2016 19:05, Michael Niedermayer wrote:
> > Fixes: CID1338320
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/frame_thread_encoder.c |4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/frame_thread_encoder.c 
> > b/libavcodec/frame_thread_encoder.c
> > index 04c9a0e..27ae356 100644
> > --- a/libavcodec/frame_thread_encoder.c
> > +++ b/libavcodec/frame_thread_encoder.c
> > @@ -89,7 +89,9 @@ static void * attribute_align_arg worker(void *v){
> >  pthread_mutex_unlock(>buffer_mutex);
> >  av_frame_free();
> >  if(got_packet) {
> > -av_dup_packet(pkt);
> > +int ret2 = av_dup_packet(pkt);
> > +if (ret >= 0 && ret2 < 0)
> > +ret = ret2;
> >  } else {
> >  pkt->data = NULL;
> >  pkt->size = 0;
> > 
> 
> Checking the return code this way is probably OK, but maybe you can also 
> replace the
> deprecated av_dup_packet with av_packet_ref while at it?

what exactly do you suggest ?

av_packet_ref() creates a reference, av_dup_packet() turns "reusable"
packets into ref counted ones
av_dup_packet() does nothing if the packet is already a ref counted
one.

i can not see a efficient and clean way to replace av_dup_packet()
by av_packet_ref()

if its ref counted already nothing needs to be done, if its not
ref counted i would have to litterally reimplement av_dup_packet()
and i dont even have a testcase for that, all cases seem to return
ref counted packets

i can remove av_dup_packet and put an assert there assuming that
all packets will always be already ref counted (this might be true
currently, i dont know, i also dont know if we always want this to
be true in the future)

I dont really want to always run av_packet_ref() over it just to
unref it in the next line, which probably would work too

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship: All citizens are under surveillance, all their steps and
actions recorded, for the politicians to enforce control.
Democracy: All politicians are under surveillance, all their steps and
actions recorded, for the citizens to enforce control.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] configure: add direct detection of libopencv

2016-02-07 Thread wm4
On Sun, 7 Feb 2016 23:25:53 +0100
Andreas Cadhalpun  wrote:

> The pkg-config file contains all opencv libraries, not only the
> neccessary ones.
> 
> This change makes it possible to use the libopencv-imgproc-dev Debian
> package instead of libopencv-dev, saving about 200 MB of useless
> build-dependencies.
> 
> In particular one doesn't need to install the parts of opencv that
> depend on ffmpeg libraries.
> 
> Signed-off-by: Andreas Cadhalpun 
> ---
>  configure | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 1000cb1..36ab7e5 100755
> --- a/configure
> +++ b/configure
> @@ -5488,7 +5488,8 @@ enabled libnut&& require libnut libnut.h 
> nut_demuxer_init -lnut
>  enabled libopencore_amrnb && require libopencore_amrnb 
> opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
>  enabled libopencore_amrwb && require libopencore_amrwb 
> opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
>  enabled libopencv && { check_header opencv2/core/core_c.h &&
> -   require_pkg_config opencv 
> opencv2/core/core_c.h cvCreateImageHeader ||
> +   { use_pkg_config opencv opencv2/core/core_c.h 
> cvCreateImageHeader ||
> + require opencv opencv2/core/core_c.h 
> cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
> require_pkg_config opencv opencv/cxcore.h 
> cvCreateImageHeader; }
>  enabled libopenh264   && require_pkg_config openh264 wels/codec_api.h 
> WelsGetCodecVersion
>  enabled libopenjpeg   && { check_lib openjpeg-2.1/openjpeg.h opj_version 
> -lopenjp2 -DOPJ_STATIC ||

Why not send a patch to opencv?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter: add BobWeaver deinterlacing filter

2016-02-07 Thread Thomas Mundt
Hi,
last years I did many quality tests with commercial broadcast transcoder 
software for SD/HD conversions.
Aside from few exeptions the weak point always was the deinterlacer. This was 
even more visible with new OLED monitors.
Here artefacts from edge directed interpolation are much more eye-catching than 
with TFTs.
I also tested ffmpeg deinterlacers. It was interesting to see that each one has 
its pros and cons.
Yadif has a very good detection of still and very slow moving parts of the 
picture, but invites many artefacts and slightly blurs the rest.
W3fdif performs well at slow and medium motion, but jiggles stills and traces 
the adjacent fields. Especially visible at scene changes and horizontal lines 
at fast vertical motion.
The attached deinterlacer tries to combine the advantages of both and uses 
cubic interpolation when temporal difference exeeds spatial difference for the 
interpolated pixel. This is far from perfect, but gives very homogenous results 
and is pretty fast. CPU optimizations of course would make it even faster, but 
I´m totally clueless about that.
I used the yadif code as basis. Due to quality requirements the slightly 
modified yadif spatial interlacing check is always on. Also the w3fdif complex 
filter.
Please test and comment.
And sorry for the stupid name...


attachment.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavformat/dnxhddec added support for raw 444 and dnxhr formats

2016-02-07 Thread Mark Reid
---
 libavcodec/dnxhd_parser.c | 19 ---
 libavformat/dnxhddec.c| 14 +++---
 2 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/libavcodec/dnxhd_parser.c b/libavcodec/dnxhd_parser.c
index fffb98f..83bfda8 100644
--- a/libavcodec/dnxhd_parser.c
+++ b/libavcodec/dnxhd_parser.c
@@ -26,7 +26,10 @@
 
 #include "parser.h"
 
-#define DNXHD_HEADER_PREFIX 0x02800100
+#define DNXHD_HEADER_PREFIX0x02800100
+#define DNXHD_HEADER_PREFIX444 0x02800200
+#define DNXHD_HEADER_PREFIXHR1 0x02800300
+#define DNXHD_HEADER_PREFIXHR2 0x038C0300
 
 typedef struct {
 ParseContext pc;
@@ -34,6 +37,16 @@ typedef struct {
 int cur_field; /* first field is 0, second is 1 */
 } DNXHDParserContext;
 
+static int dnxhd_is_prefix(uint64_t prefix)
+{
+  if (prefix == DNXHD_HEADER_PREFIX||
+  prefix == DNXHD_HEADER_PREFIX444 ||
+  prefix == DNXHD_HEADER_PREFIXHR1 ||
+  prefix == DNXHD_HEADER_PREFIXHR2)
+  return 1;
+  return 0;
+}
+
 static int dnxhd_find_frame_end(DNXHDParserContext *dctx,
 const uint8_t *buf, int buf_size)
 {
@@ -47,7 +60,7 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx,
 if (!pic_found) {
 for (i = 0; i < buf_size; i++) {
 state = (state << 8) | buf[i];
-if ((state & 0xff00LL) == DNXHD_HEADER_PREFIX) {
+if (dnxhd_is_prefix(state & 0xff00LL)) {
 i++;
 pic_found = 1;
 interlaced = (state&2)>>1; /* byte following the 5-byte header 
prefix */
@@ -62,7 +75,7 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx,
 return 0;
 for (; i < buf_size; i++) {
 state = (state << 8) | buf[i];
-if ((state & 0xff00LL) == DNXHD_HEADER_PREFIX) {
+if (dnxhd_is_prefix(state & 0xff00LL)) {
 if (!interlaced || dctx->cur_field) {
 pc->frame_start_found = 0;
 pc->state64 = -1;
diff --git a/libavformat/dnxhddec.c b/libavformat/dnxhddec.c
index 37e52d5..d26667d 100644
--- a/libavformat/dnxhddec.c
+++ b/libavformat/dnxhddec.c
@@ -26,18 +26,26 @@
 
 static int dnxhd_probe(AVProbeData *p)
 {
-static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
+static const uint8_t header_prefix[]= { 0x00, 0x00, 0x02, 0x80, 0x01 };
+static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 };
+static const uint8_t header_prefixhr1[] = { 0x00, 0x00, 0x02, 0x80, 0x03 };
+static const uint8_t header_prefixhr2[] = { 0x00, 0x00, 0x03, 0x8C, 0x03 };
+
 int w, h, compression_id;
 if (p->buf_size < 0x2c)
 return 0;
-if (memcmp(p->buf, header, 5))
+if (memcmp(p->buf, header_prefix,5) &&
+memcmp(p->buf, header_prefix444, 5) &&
+memcmp(p->buf, header_prefixhr1, 5) &&
+memcmp(p->buf, header_prefixhr2, 5))
 return 0;
 h = AV_RB16(p->buf + 0x18);
 w = AV_RB16(p->buf + 0x1a);
 if (!w || !h)
 return 0;
 compression_id = AV_RB32(p->buf + 0x28);
-if (compression_id < 1235 || compression_id > 1260)
+if ((compression_id < 1235 || compression_id > 1260) &&
+(compression_id < 1270 || compression_id > 1274))
 return 0;
 return AVPROBE_SCORE_MAX;
 }
-- 
2.4.1

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


[FFmpeg-devel] [PATCH] libavformat/dnxhddec added support for raw 444 and dnxhr

2016-02-07 Thread Mark Reid
Hi,
This patch enable demuxing of raw 444 and dnxhr streams.
To generate a raw stream of dnxhr (since there is no encoder support yet)
ffmpeg -i fate-suite/dnxhd/dnxhr444_cid1270.mov -an -vcodec copy out.dnxhd
ffplay out.dnxhd

Mark Reid (1):
  libavformat/dnxhddec added support for raw 444 and dnxhr formats

 libavcodec/dnxhd_parser.c | 19 ---
 libavformat/dnxhddec.c| 14 +++---
 2 files changed, 27 insertions(+), 6 deletions(-)

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


Re: [FFmpeg-devel] [PATCH v2] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-07 Thread Mats Peterson

On 02/08/2016 06:19 AM, Mats Peterson wrote:

In order to produce a working nut file from a 1, 2, 4 or 8 bpp AVI or
QuickTime file, force the pixel format with "-pix_fmt rgb24" or similar.
For black & white files in order to save space, use "-pix_fmt monow" or
"-pix_fmt monob" (give or take the slightly erratic conversion from pal8
to monow/monob in FFmpeg).



A better way to produce a monow or monob nut file from a black & white 
AVI or QuickTime file is to use "ffmpeg -i 1bpp.avi -vcodec copy -vtag 
B1W0 1bpp.nut". The "-vtag" option is currently needed, otherwise FFmpeg 
will incorrectly use a RGB[15] codec tag for some reason.


Mats

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


Re: [FFmpeg-devel] [PATCH v2] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-07 Thread Mats Peterson

On 02/08/2016 06:24 AM, Mats Peterson wrote:

A better way to produce a monow or monob nut file from a black & white
AVI or QuickTime file is to use "ffmpeg -i 1bpp.avi -vcodec copy -vtag
B1W0 1bpp.nut". The "-vtag" option is currently needed, otherwise FFmpeg
will incorrectly use a RGB[15] codec tag for some reason.



Make that "monow", not "monow or monob".

Mats

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


Re: [FFmpeg-devel] [PATCH] libavformat/dnxhddec added support for raw 444 and dnxhr formats

2016-02-07 Thread Christophe Gisquet
Hi,

2016-02-08 2:31 GMT+01:00 Mark Reid :

> +static int dnxhd_is_prefix(uint64_t prefix)
> +{
> +  if (prefix == DNXHD_HEADER_PREFIX||
> +  prefix == DNXHD_HEADER_PREFIX444 ||
> +  prefix == DNXHD_HEADER_PREFIXHR1 ||
> +  prefix == DNXHD_HEADER_PREFIXHR2)
> +  return 1;
> +  return 0;
> +}
> +
>  static int dnxhd_find_frame_end(DNXHDParserContext *dctx,
>  const uint8_t *buf, int buf_size)
>  {
> @@ -47,7 +60,7 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx,
>  if (!pic_found) {
>  for (i = 0; i < buf_size; i++) {
>  state = (state << 8) | buf[i];
> -if ((state & 0xff00LL) == DNXHD_HEADER_PREFIX) {
> +if (dnxhd_is_prefix(state & 0xff00LL)) {

OK.

>  static int dnxhd_probe(AVProbeData *p)
>  {
> -static const uint8_t header[] = {0x00,0x00,0x02,0x80,0x01};
> +static const uint8_t header_prefix[]= { 0x00, 0x00, 0x02, 0x80, 0x01 
> };
> +static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 
> };
> +static const uint8_t header_prefixhr1[] = { 0x00, 0x00, 0x02, 0x80, 0x03 
> };
> +static const uint8_t header_prefixhr2[] = { 0x00, 0x00, 0x03, 0x8C, 0x03 
> };
> +
>  int w, h, compression_id;
>  if (p->buf_size < 0x2c)
>  return 0;
> -if (memcmp(p->buf, header, 5))
> +if (memcmp(p->buf, header_prefix,5) &&
> +memcmp(p->buf, header_prefix444, 5) &&
> +memcmp(p->buf, header_prefixhr1, 5) &&
> +memcmp(p->buf, header_prefixhr2, 5))

At this point, I'd say the encoder would better use that prefix.
That's what the attached patch does (rebased but not tested). You may
consider building on top of it for that purpose.

Best regards,
-- 
Christophe
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel