[FFmpeg-cvslog] lavf/mov.c: Make audio timestamps strictly monotonically increasing inside an edit list.

2016-09-28 Thread Sasi Inguva
ffmpeg | branch: master | Sasi Inguva  | Mon Sep 26 09:56:26 
2016 -0700| [dba2db6c0e4a18b9b69b846650401bf3a1d5a019] | committer: Michael 
Niedermayer

lavf/mov.c: Make audio timestamps strictly monotonically increasing inside an 
edit list.

Fixes gapless decoding. Adjust skip_samples field correctly in case of 
DISCARDed audio frames.

Signed-off-by: Sasi Inguva 
Signed-off-by: Michael Niedermayer 

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

 libavformat/mov.c| 80 
 tests/ref/fate/gaplessenc-itunes-to-ipod-aac |  2 +-
 tests/ref/fate/gaplessenc-pcm-to-mov-aac |  2 +-
 3 files changed, 71 insertions(+), 13 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index b84d9c0..8b7bbf1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2856,6 +2856,21 @@ static int64_t add_index_entry(AVStream *st, int64_t 
pos, int64_t timestamp,
 }
 
 /**
+ * Rewrite timestamps of index entries in the range [end_index - 
frame_duration_buffer_size, end_index)
+ * by subtracting end_ts successively by the amounts given in 
frame_duration_buffer.
+ */
+static void fix_index_entry_timestamps(AVStream* st, int end_index, int64_t 
end_ts,
+   int64_t* frame_duration_buffer,
+   int frame_duration_buffer_size) {
+int i = 0;
+av_assert0(end_index >= 0 && end_index <= st->nb_index_entries);
+for (i = 0; i < frame_duration_buffer_size; i++) {
+end_ts -= frame_duration_buffer[frame_duration_buffer_size - 1 - i];
+st->index_entries[end_index - 1 - i].timestamp = end_ts;
+}
+}
+
+/**
  * Append a new ctts entry to ctts_data.
  * Returns the new ctts_count if successful, else returns -1.
  */
@@ -2919,7 +2934,10 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 int64_t edit_list_media_time_dts = 0;
 int64_t edit_list_start_encountered = 0;
 int64_t search_timestamp = 0;
-
+int64_t* frame_duration_buffer = NULL;
+int num_discarded_begin = 0;
+int first_non_zero_audio_edit = -1;
+int packet_skip_samples = 0;
 
 if (!msc->elst_data || msc->elst_count <= 0) {
 return;
@@ -2955,6 +2973,7 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 edit_list_index++;
 edit_list_dts_counter = edit_list_dts_entry_end;
 edit_list_dts_entry_end += edit_list_duration;
+num_discarded_begin = 0;
 if (edit_list_media_time == -1) {
 continue;
 }
@@ -2962,7 +2981,14 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 // If we encounter a non-negative edit list reset the 
skip_samples/start_pad fields and set them
 // according to the edit list below.
 if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
-st->skip_samples = msc->start_pad = 0;
+if (first_non_zero_audio_edit < 0) {
+first_non_zero_audio_edit = 1;
+} else {
+first_non_zero_audio_edit = 0;
+}
+
+if (first_non_zero_audio_edit > 0)
+st->skip_samples = msc->start_pad = 0;
 }
 
 //find closest previous key frame
@@ -3041,24 +3067,56 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
 }
 
 if (curr_cts < edit_list_media_time || curr_cts >= 
(edit_list_duration + edit_list_media_time)) {
-if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && curr_cts 
< edit_list_media_time &&
-curr_cts + frame_duration > edit_list_media_time &&
-st->skip_samples == 0 && msc->start_pad == 0) {
-st->skip_samples = msc->start_pad = edit_list_media_time - 
curr_cts;
-
-// Shift the index entry timestamp by skip_samples to be 
correct.
-edit_list_dts_counter -= st->skip_samples;
+if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && 
st->codecpar->codec_id != AV_CODEC_ID_VORBIS &&
+curr_cts < edit_list_media_time && curr_cts + 
frame_duration > edit_list_media_time &&
+first_non_zero_audio_edit > 0) {
+packet_skip_samples = edit_list_media_time - curr_cts;
+st->skip_samples += packet_skip_samples;
+
+// Shift the index entry timestamp by packet_skip_samples 
to be correct.
+edit_list_dts_counter -= packet_skip_samples;
 if (edit_list_start_encountered == 0)  {
-  edit_list_start_encountered = 1;
+edit_list_start_encountered = 1;
+// Make timestamps strictly monotonically increasing 
for audio, by rewriting timestamps for
+// discarded packets.
+  

[FFmpeg-cvslog] lavc/utils.c: Subtract skip_samples when frame is DISCARDed.

2016-09-28 Thread Sasi Inguva
ffmpeg | branch: master | Sasi Inguva  | Mon 
Sep 26 18:41:01 2016 -0700| [7e0235bdb145cf7975bda240acb629991c4b7048] | 
committer: Michael Niedermayer

lavc/utils.c: Subtract skip_samples when frame is DISCARDed.

Signed-off-by: Sasi Inguva 
Signed-off-by: Michael Niedermayer 

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

 libavcodec/utils.c   | 16 +++-
 libavcodec/version.h |  2 +-
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 0d78f0b..cf85300 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2335,7 +2335,6 @@ int attribute_align_arg 
avcodec_decode_audio4(AVCodecContext *avctx,
 uint32_t discard_padding = 0;
 uint8_t skip_reason = 0;
 uint8_t discard_reason = 0;
-int demuxer_skip_samples = 0;
 // copy to ensure we do not change avpkt
 AVPacket tmp = *avpkt;
 int did_split = av_packet_split_side_data();
@@ -2343,7 +2342,6 @@ int attribute_align_arg 
avcodec_decode_audio4(AVCodecContext *avctx,
 if (ret < 0)
 goto fail;
 
-demuxer_skip_samples = avctx->internal->skip_samples;
 avctx->internal->pkt = 
 if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
 ret = ff_thread_decode_frame(avctx, frame, got_frame_ptr, );
@@ -2368,13 +2366,6 @@ int attribute_align_arg 
avcodec_decode_audio4(AVCodecContext *avctx,
 frame->sample_rate = avctx->sample_rate;
 }
 
-
-if (frame->flags & AV_FRAME_FLAG_DISCARD) {
-// If using discard frame flag, ignore skip_samples set by the 
decoder.
-avctx->internal->skip_samples = demuxer_skip_samples;
-*got_frame_ptr = 0;
-}
-
 side= av_packet_get_side_data(avctx->internal->pkt, 
AV_PKT_DATA_SKIP_SAMPLES, _size);
 if(side && side_size>=10) {
 avctx->internal->skip_samples = AV_RL32(side);
@@ -2384,6 +2375,13 @@ int attribute_align_arg 
avcodec_decode_audio4(AVCodecContext *avctx,
 skip_reason = AV_RL8(side + 8);
 discard_reason = AV_RL8(side + 9);
 }
+
+if ((frame->flags & AV_FRAME_FLAG_DISCARD) && *got_frame_ptr &&
+!(avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL)) {
+avctx->internal->skip_samples -= frame->nb_samples;
+*got_frame_ptr = 0;
+}
+
 if (avctx->internal->skip_samples > 0 && *got_frame_ptr &&
 !(avctx->flags2 & AV_CODEC_FLAG2_SKIP_MANUAL)) {
 if(frame->nb_samples <= avctx->internal->skip_samples){
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 71dac40..91abd31 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  57
-#define LIBAVCODEC_VERSION_MINOR  59
+#define LIBAVCODEC_VERSION_MINOR  60
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

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


[FFmpeg-cvslog] ffmpeg_vaapi: fix choice of decoder_format

2016-09-28 Thread Moritz Barsnick
ffmpeg | branch: master | Moritz Barsnick  | Tue Sep 27 
14:21:49 2016 +0200| [1846a3eac854799fbffc9669dcf4de558b917957] | committer: 
Michael Niedermayer

ffmpeg_vaapi: fix choice of decoder_format

The check could previously never evaluate to true, probably due to
a typo.

Reported-By: Mihai Chindea 
Signed-off-by: Moritz Barsnick 
Tested-by: Mark Thompson 
Signed-off-by: Michael Niedermayer 

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

 ffmpeg_vaapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffmpeg_vaapi.c b/ffmpeg_vaapi.c
index 8090597..f1e7c76 100644
--- a/ffmpeg_vaapi.c
+++ b/ffmpeg_vaapi.c
@@ -302,7 +302,7 @@ static int vaapi_build_decoder_config(VAAPIDecoderContext 
*ctx,
 if (ctx->output_format != AV_PIX_FMT_NONE &&
 ctx->output_format != AV_PIX_FMT_VAAPI) {
 for (i = 0; constraints->valid_sw_formats[i] != AV_PIX_FMT_NONE; i++) {
-if (constraints->valid_sw_formats[i] == ctx->decode_format) {
+if (constraints->valid_sw_formats[i] == ctx->output_format) {
 ctx->decode_format = ctx->output_format;
 av_log(ctx, AV_LOG_DEBUG, "Using decode format %s (output "
"format).\n", av_get_pix_fmt_name(ctx->decode_format));

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


[FFmpeg-cvslog] doc/codecs.texi: fix and expand color related options

2016-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Sep 28 17:14:33 
2016 -0300| [a68f1ae6b1f2f80dff59d5dd5f806e2107c0c540] | committer: James Almer

doc/codecs.texi: fix and expand color related options

Found-by: Michael Niedermayer 
Reviewed-by: Michael Niedermayer 
Signed-off-by: James Almer 

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

 doc/codecs.texi | 73 +
 1 file changed, 63 insertions(+), 10 deletions(-)

diff --git a/doc/codecs.texi b/doc/codecs.texi
index 48fc3bf..913e257 100644
--- a/doc/codecs.texi
+++ b/doc/codecs.texi
@@ -1049,7 +1049,31 @@ Possible values:
 @item rc_max_vbv_use @var{float} (@emph{encoding,video})
 @item rc_min_vbv_use @var{float} (@emph{encoding,video})
 @item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video})
+
 @item color_primaries @var{integer} (@emph{decoding/encoding,video})
+Possible values:
+@table @samp
+@item bt709
+BT.709
+@item bt470m
+BT.470 M
+@item bt470bg
+BT.470 BG
+@item smpte170m
+SMPTE 170 M
+@item smpte240m
+SMPTE 240 M
+@item film
+Film
+@item bt2020
+BT.2020
+@item smpte428_1
+SMPTE ST 428-1
+@item smpte431
+SMPTE 431-2
+@item smpte432
+SMPTE 432-1
+@end table
 
 @item color_trc @var{integer} (@emph{decoding/encoding,video})
 Possible values:
@@ -1060,29 +1084,58 @@ BT.709
 BT.470 M
 @item gamma28
 BT.470 BG
-@item linear
+@item smpte170m
 SMPTE 170 M
-@item log
+@item smpte240m
 SMPTE 240 M
-@item log_sqrt
+@item linear
 Linear
-@item iec61966_2_4
+@item log
 Log
-@item bt1361
+@item log_sqrt
 Log square root
-@item iec61966_2_1
+@item iec61966_2_4
 IEC 61966-2-4
-@item bt2020_10bit
+@item bt1361
 BT.1361
-@item bt2020_12bit
+@item iec61966_2_1
 IEC 61966-2-1
-@item smpte2084
+@item bt2020_10bit
 BT.2020 - 10 bit
-@item smpte428_1
+@item bt2020_12bit
 BT.2020 - 12 bit
+@item smpte2084
+SMPTE ST 2084
+@item smpte428_1
+SMPTE ST 428-1
+@item arib-std-b67
+ARIB STD-B67
 @end table
 
 @item colorspace @var{integer} (@emph{decoding/encoding,video})
+Possible values:
+@table @samp
+@item rgb
+RGB
+@item bt709
+BT.709
+@item fcc
+FCC
+@item bt470bg
+BT.470 BG
+@item smpte170m
+SMPTE 170 M
+@item smpte240m
+SMPTE 240 M
+@item ycocg
+YCOCG
+@item bt2020_ncl
+BT.2020 NCL
+@item bt2020_cl
+BT.2020 CL
+@item smpte2085
+SMPTE 2085
+@end table
 
 @item color_range @var{integer} (@emph{decoding/encoding,video})
 If used as input parameter, it serves as a hint to the decoder, which

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


[FFmpeg-cvslog] movenc: use similar logic to DASH when writing bit rate to ISML

2016-09-28 Thread Jan Ekström
ffmpeg | branch: master | Jan Ekström  | Wed Sep 28 02:14:23 
2016 +0300| [6c10f8fe7658c699fc41688c175aa9d79f4b1daf] | committer: Michael 
Niedermayer

movenc: use similar logic to DASH when writing bit rate to ISML

This way, in case of bit rate not being set, max_bitrate will be
used instead. This enables, for example, re-using max_bitrate
information from the input or doing transcoding with a rate
control mode that is not bit rate based.

Signed-off-by: Jan Ekström 
Signed-off-by: Michael Niedermayer 

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

 libavformat/movenc.c | 16 ++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 449d0b5..8992782 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3581,6 +3581,9 @@ static int mov_write_isml_manifest(AVIOContext *pb, 
MOVMuxContext *mov, AVFormat
 {
 int64_t pos = avio_tell(pb);
 int i;
+int64_t manifest_bit_rate = 0;
+AVCPBProperties *props = NULL;
+
 static const uint8_t uuid[] = {
 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd,
 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66
@@ -3615,9 +3618,18 @@ static int mov_write_isml_manifest(AVIOContext *pb, 
MOVMuxContext *mov, AVFormat
 } else {
 continue;
 }
+
+props = (AVCPBProperties*)av_stream_get_side_data(track->st, 
AV_PKT_DATA_CPB_PROPERTIES, NULL);
+
+if (track->par->bit_rate) {
+manifest_bit_rate = track->par->bit_rate;
+} else if (props) {
+manifest_bit_rate = props->max_bitrate;
+}
+
 avio_printf(pb, "<%s systemBitrate=\"%"PRId64"\">\n", type,
-(int64_t)track->par->bit_rate);
-param_write_int(pb, "systemBitrate", track->par->bit_rate);
+manifest_bit_rate);
+param_write_int(pb, "systemBitrate", manifest_bit_rate);
 param_write_int(pb, "trackID", track_id);
 if (track->par->codec_type == AVMEDIA_TYPE_VIDEO) {
 if (track->par->codec_id == AV_CODEC_ID_H264) {

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


[FFmpeg-cvslog] avfilter/vf_colorspace: fix range for output colorspace option

2016-09-28 Thread James Almer
ffmpeg | branch: release/3.1 | James Almer  | Wed Sep 28 
17:24:42 2016 -0300| [2303cea5be08a31a4708b36c8e83150e2a120414] | committer: 
James Almer

avfilter/vf_colorspace: fix range for output colorspace option

Rreviewed-by: BBB
Signed-off-by: James Almer 
(cherry picked from commit e4bfc9ecf73d593853ef4e993a5c753f5596aee1)

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

 libavfilter/vf_colorspace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 3d39f13..a543690 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -1008,7 +1008,7 @@ static const AVOption colorspace_options[] = {
 
 { "space",  "Output colorspace",
   OFFSET(user_csp),   AV_OPT_TYPE_INT, { .i64 = AVCOL_SPC_UNSPECIFIED },
-  AVCOL_PRI_RESERVED0, AVCOL_PRI_NB - 1, FLAGS, "csp" },
+  AVCOL_SPC_RGB, AVCOL_SPC_NB - 1, FLAGS,  "csp"},
 ENUM("bt709",   AVCOL_SPC_BT709,   "csp"),
 ENUM("fcc", AVCOL_SPC_FCC, "csp"),
 ENUM("bt470bg", AVCOL_SPC_BT470BG, "csp"),

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


[FFmpeg-cvslog] avfilter/vf_colorspace: fix range for output colorspace option

2016-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Sep 28 17:24:42 
2016 -0300| [e4bfc9ecf73d593853ef4e993a5c753f5596aee1] | committer: James Almer

avfilter/vf_colorspace: fix range for output colorspace option

Rreviewed-by: BBB
Signed-off-by: James Almer 

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

 libavfilter/vf_colorspace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index c74fe00..5b060f9 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -1031,7 +1031,7 @@ static const AVOption colorspace_options[] = {
 
 { "space",  "Output colorspace",
   OFFSET(user_csp),   AV_OPT_TYPE_INT, { .i64 = AVCOL_SPC_UNSPECIFIED },
-  AVCOL_PRI_RESERVED0, AVCOL_PRI_NB - 1, FLAGS, "csp" },
+  AVCOL_SPC_RGB, AVCOL_SPC_NB - 1, FLAGS,  "csp"},
 ENUM("bt709",   AVCOL_SPC_BT709,   "csp"),
 ENUM("fcc", AVCOL_SPC_FCC, "csp"),
 ENUM("bt470bg", AVCOL_SPC_BT470BG, "csp"),

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


Re: [FFmpeg-cvslog] Merge commit 'a8164323374e86ce5f93759230868c98356833a2'

2016-09-28 Thread Michael Niedermayer
On Wed, Sep 28, 2016 at 06:15:03PM +0200, James Almer wrote:
> ffmpeg | branch: master | James Almer  | Wed Sep 28 
> 13:12:18 2016 -0300| [6e76c9c45018b9cea383ff1c3f17d08792623509] | committer: 
> James Almer
> 
> Merge commit 'a8164323374e86ce5f93759230868c98356833a2'
> 
> * commit 'a8164323374e86ce5f93759230868c98356833a2':
>   pixdesc: Add new SMPTE 431, 432, and 2085 color properties
> 
> Conflicts:
> libavcodec/options_table.h
> libavcodec/version.h
> libavutil/pixdesc.c
> libavutil/pixfmt.h
> libavutil/version.h
> 
> Merged-by: James Almer 
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6e76c9c45018b9cea383ff1c3f17d08792623509
> ---
> 
>  libavcodec/options_table.h | 3 +++
>  libavcodec/version.h   | 2 +-
>  libavutil/pixdesc.c| 3 +++
>  libavutil/pixfmt.h | 5 -
>  libavutil/version.h| 2 +-
>  5 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> index 88dee61..995906b 100644
> --- a/libavcodec/options_table.h
> +++ b/libavcodec/options_table.h
> @@ -460,6 +460,8 @@ static const AVOption avcodec_options[] = {
>  {"film","Film",   0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_PRI_FILM }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
>  {"bt2020",  "BT.2020",0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_PRI_BT2020 },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
>  {"smpte428_1",  "SMPTE ST 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
> +{"smpte431","SMPTE 431-2",0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_PRI_SMPTE431 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
> +{"smpte432","SMPTE 422-1",0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_PRI_SMPTE432 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
>  {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
> AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
> "color_trc_type"},
>  {"bt709","BT.709",   0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_TRC_BT709 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
>  {"unspecified",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
> @@ -489,6 +491,7 @@ static const AVOption avcodec_options[] = {
>  {"ycocg",   "YCOCG",   0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_YCOCG 
> },   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
>  {"bt2020_ncl",  "BT.2020 NCL", 0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_SPC_BT2020_NCL },  INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
>  {"bt2020_cl",   "BT.2020 CL",  0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_SPC_BT2020_CL },   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
> +{"smpte2085",   "SMPTE 2085",  0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_SPC_SMPTE2085 },   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
>  {"color_range", "color range", OFFSET(color_range), AV_OPT_TYPE_INT, {.i64 = 
> AVCOL_RANGE_UNSPECIFIED }, 0, AVCOL_RANGE_NB-1, V|E|D, "color_range_type"},
>  {"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_RANGE_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_range_type"},
>  {"mpeg", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = 
> AVCOL_RANGE_MPEG },INT_MIN, INT_MAX, V|E|D, "color_range_type"},

Missing changes to doc/
also the need to update doc/ should be mentioned in doc/libav-merge.txt

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

No snowflake in an avalanche ever feels responsible. -- Voltaire


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


[FFmpeg-cvslog] avformat/concatdec: don't call open_file when seek position within a file

2016-09-28 Thread raymondzheng1...@gmail.com
ffmpeg | branch: master | raymondzheng1...@gmail.com 
 | Fri Sep 23 11:48:40 2016 +0800| 
[2366efce3cd5be7c6aeafa24ae9a3f550b4518c6] | committer: Nicolas George

avformat/concatdec: don't call open_file when seek position within a file

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

 libavformat/concatdec.c | 24 +---
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index b3a430e..5cc239a 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -689,7 +689,7 @@ static int try_seek(AVFormatContext *avf, int stream,
 }
 
 static int real_seek(AVFormatContext *avf, int stream,
- int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
+ int64_t min_ts, int64_t ts, int64_t max_ts, int flags, 
AVFormatContext *cur_avf)
 {
 ConcatContext *cat = avf->priv_data;
 int ret, left, right;
@@ -711,13 +711,19 @@ static int real_seek(AVFormatContext *avf, int stream,
 left  = mid;
 }
 
-if ((ret = open_file(avf, left)) < 0)
-return ret;
+if (cat->cur_file != >files[left]) {
+if ((ret = open_file(avf, left)) < 0)
+return ret;
+} else {
+cat->avf = cur_avf;
+}
 
 ret = try_seek(avf, stream, min_ts, ts, max_ts, flags);
 if (ret < 0 &&
 left < cat->nb_files - 1 &&
 cat->files[left + 1].start_time < max_ts) {
+if (cat->cur_file == >files[left])
+cat->avf = NULL;
 if ((ret = open_file(avf, left + 1)) < 0)
 return ret;
 ret = try_seek(avf, stream, min_ts, ts, max_ts, flags);
@@ -738,13 +744,17 @@ static int concat_seek(AVFormatContext *avf, int stream,
 if (flags & (AVSEEK_FLAG_BYTE | AVSEEK_FLAG_FRAME))
 return AVERROR(ENOSYS);
 cat->avf = NULL;
-if ((ret = real_seek(avf, stream, min_ts, ts, max_ts, flags)) < 0) {
-if (cat->avf)
-avformat_close_input(>avf);
+if ((ret = real_seek(avf, stream, min_ts, ts, max_ts, flags, 
cur_avf_saved)) < 0) {
+if (cat->cur_file != cur_file_saved) {
+if (cat->avf)
+avformat_close_input(>avf);
+}
 cat->avf  = cur_avf_saved;
 cat->cur_file = cur_file_saved;
 } else {
-avformat_close_input(_avf_saved);
+if (cat->cur_file != cur_file_saved) {
+avformat_close_input(_avf_saved);
+}
 cat->eof = 0;
 }
 return ret;

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


[FFmpeg-cvslog] avutil/hwcontext: use CONFIG_QSV instead of CONFIG_LIBMFX for qsv

2016-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Sep 28 15:12:29 
2016 -0300| [13dd5edb88c9ecfc1d01899f5b36453051e02d98] | committer: James Almer

avutil/hwcontext: use CONFIG_QSV instead of CONFIG_LIBMFX for qsv

See "[FFmpeg-devel] [PATCH] hwcontext: add a QSV implementation"

Suggested-by: nablet developer 
Signed-off-by: James Almer 

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

 libavutil/Makefile| 4 ++--
 libavutil/hwcontext.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/Makefile b/libavutil/Makefile
index 7385ec2..0fa90fe 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -155,7 +155,7 @@ OBJS-$(!HAVE_ATOMICS_NATIVE)+= atomic.o 
\
 
 OBJS-$(CONFIG_CUDA) += hwcontext_cuda.o
 OBJS-$(CONFIG_DXVA2)+= hwcontext_dxva2.o
-OBJS-$(CONFIG_LIBMFX)   += hwcontext_qsv.o
+OBJS-$(CONFIG_QSV)   += hwcontext_qsv.o
 OBJS-$(CONFIG_LZO)  += lzo.o
 OBJS-$(CONFIG_OPENCL)   += opencl.o opencl_internal.o
 OBJS-$(CONFIG_VAAPI)+= hwcontext_vaapi.o
@@ -168,7 +168,7 @@ SLIBOBJS-$(HAVE_GNU_WINDRES)+= avutilres.o
 
 SKIPHEADERS-$(CONFIG_CUDA) += hwcontext_cuda.h
 SKIPHEADERS-$(CONFIG_DXVA2)+= hwcontext_dxva2.h
-SKIPHEADERS-$(CONFIG_LIBMFX)   += hwcontext_qsv.h
+SKIPHEADERS-$(CONFIG_QSV)   += hwcontext_qsv.h
 SKIPHEADERS-$(CONFIG_VAAPI)+= hwcontext_vaapi.h
 SKIPHEADERS-$(CONFIG_VDPAU)+= hwcontext_vdpau.h
 SKIPHEADERS-$(HAVE_ATOMICS_GCC)+= atomic_gcc.h
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 8af7afa..be1d73e 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -35,7 +35,7 @@ static const HWContextType *hw_table[] = {
 #if CONFIG_DXVA2
 _hwcontext_type_dxva2,
 #endif
-#if CONFIG_LIBMFX
+#if CONFIG_QSV
 _hwcontext_type_qsv,
 #endif
 #if CONFIG_VAAPI

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


[FFmpeg-cvslog] ffmpeg_cuvid: Don't unnecessarily include nvcuvid.h

2016-09-28 Thread Philip Langdale
ffmpeg | branch: master | Philip Langdale  | Wed Sep 28 
10:42:40 2016 -0700| [d6573275a71554cef25a78e462e688f58d585423] | committer: 
Philip Langdale

ffmpeg_cuvid: Don't unnecessarily include nvcuvid.h

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

 ffmpeg_cuvid.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/ffmpeg_cuvid.c b/ffmpeg_cuvid.c
index 7fb47a2..866f43b 100644
--- a/ffmpeg_cuvid.c
+++ b/ffmpeg_cuvid.c
@@ -22,7 +22,6 @@
 #include "ffmpeg.h"
 
 #include 
-#include 
 
 typedef struct CUVIDContext {
 AVBufferRef *hw_frames_ctx;

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


[FFmpeg-cvslog] hwcontext: add a QSV implementation

2016-09-28 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Wed Jan 13 
14:25:58 2016 +0100| [59e7361cc791e5103be1712dc59a2055f118d0da] | committer: 
Anton Khirnov

hwcontext: add a QSV implementation

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

 doc/APIchanges |   4 +
 libavutil/Makefile |   3 +
 libavutil/hwcontext.c  |   3 +
 libavutil/hwcontext.h  |   1 +
 libavutil/hwcontext_internal.h |   1 +
 libavutil/hwcontext_qsv.c  | 791 +
 libavutil/hwcontext_qsv.h  |  53 +++
 libavutil/version.h|   2 +-
 8 files changed, 857 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index e251490..74316ed 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,10 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-xx-xx - xxx - lavu 55.16.0 - hwcontext.h hwcontext_qsv.h
+  Add AV_HWDEVICE_TYPE_QSV and a new installed header with QSV-specific
+  hwcontext definitions.
+
 2016-xx-xx - xxx - lavc 57.23.0 - avcodec.h
   AVCodecContext.hw_frames_ctx now may be used by decoders.
 
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 637ad3b..b10b4d2 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -27,6 +27,7 @@ HEADERS = adler32.h   
  \
   hwcontext.h   \
   hwcontext_cuda.h  \
   hwcontext_dxva2.h \
+  hwcontext_qsv.h   \
   hwcontext_vaapi.h \
   hwcontext_vdpau.h \
   imgutils.h\
@@ -110,6 +111,7 @@ OBJS = adler32.o
\
 
 OBJS-$(CONFIG_CUDA) += hwcontext_cuda.o
 OBJS-$(CONFIG_DXVA2)+= hwcontext_dxva2.o
+OBJS-$(CONFIG_LIBMFX)   += hwcontext_qsv.o
 OBJS-$(CONFIG_LZO)  += lzo.o
 OBJS-$(CONFIG_VAAPI)+= hwcontext_vaapi.o
 OBJS-$(CONFIG_VDPAU)+= hwcontext_vdpau.o
@@ -118,6 +120,7 @@ OBJS += $(COMPAT_OBJS:%=../compat/%)
 
 SKIPHEADERS-$(CONFIG_CUDA) += hwcontext_cuda.h
 SKIPHEADERS-$(CONFIG_DXVA2)+= hwcontext_dxva2.h
+SKIPHEADERS-$(CONFIG_LIBMFX)   += hwcontext_qsv.h
 SKIPHEADERS-$(CONFIG_VAAPI)+= hwcontext_vaapi.h
 SKIPHEADERS-$(CONFIG_VDPAU)+= hwcontext_vdpau.h
 SKIPHEADERS-$(HAVE_ATOMICS_GCC)+= atomic_gcc.h
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 3028b67..96b316a 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -35,6 +35,9 @@ static const HWContextType *hw_table[] = {
 #if CONFIG_DXVA2
 _hwcontext_type_dxva2,
 #endif
+#if CONFIG_LIBMFX
+_hwcontext_type_qsv,
+#endif
 #if CONFIG_VAAPI
 _hwcontext_type_vaapi,
 #endif
diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h
index d8e7c3f..f15cf7c 100644
--- a/libavutil/hwcontext.h
+++ b/libavutil/hwcontext.h
@@ -29,6 +29,7 @@ enum AVHWDeviceType {
 AV_HWDEVICE_TYPE_CUDA,
 AV_HWDEVICE_TYPE_VAAPI,
 AV_HWDEVICE_TYPE_DXVA2,
+AV_HWDEVICE_TYPE_QSV,
 };
 
 typedef struct AVHWDeviceInternal AVHWDeviceInternal;
diff --git a/libavutil/hwcontext_internal.h b/libavutil/hwcontext_internal.h
index 2e1daae..a391e25 100644
--- a/libavutil/hwcontext_internal.h
+++ b/libavutil/hwcontext_internal.h
@@ -101,6 +101,7 @@ struct AVHWFramesInternal {
 
 extern const HWContextType ff_hwcontext_type_cuda;
 extern const HWContextType ff_hwcontext_type_dxva2;
+extern const HWContextType ff_hwcontext_type_qsv;
 extern const HWContextType ff_hwcontext_type_vaapi;
 extern const HWContextType ff_hwcontext_type_vdpau;
 
diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
new file mode 100644
index 000..b222da2
--- /dev/null
+++ b/libavutil/hwcontext_qsv.c
@@ -0,0 +1,791 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */

[FFmpeg-cvslog] Merge commit '59e7361cc791e5103be1712dc59a2055f118d0da'

2016-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Sep 28 13:30:27 
2016 -0300| [eba041476879fc46a49fa36fca03f1565ecaefca] | committer: James Almer

Merge commit '59e7361cc791e5103be1712dc59a2055f118d0da'

* commit '59e7361cc791e5103be1712dc59a2055f118d0da':
  hwcontext: add a QSV implementation

Conflicts:
doc/APIchanges
libavutil/version.h

Merged-by: James Almer 

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

 doc/APIchanges |   4 +
 libavutil/Makefile |   3 +
 libavutil/hwcontext.c  |   3 +
 libavutil/hwcontext.h  |   1 +
 libavutil/hwcontext_internal.h |   1 +
 libavutil/hwcontext_qsv.c  | 791 +
 libavutil/hwcontext_qsv.h  |  53 +++
 libavutil/version.h|   2 +-
 8 files changed, 857 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 7acfc3e..7869629 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-09-xx - xxx - lavu 55.32.100 / 55.16.0 - hwcontext.h hwcontext_qsv.h
+  Add AV_HWDEVICE_TYPE_QSV and a new installed header with QSV-specific
+  hwcontext definitions.
+
 2016-09-xx - xxx - lavc 57.59.100/ 57.23.0 - avcodec.h
   AVCodecContext.hw_frames_ctx now may be used by decoders.
 
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 1e06176..7385ec2 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -35,6 +35,7 @@ HEADERS = adler32.h   
  \
   hwcontext.h   \
   hwcontext_cuda.h  \
   hwcontext_dxva2.h \
+  hwcontext_qsv.h   \
   hwcontext_vaapi.h \
   hwcontext_vdpau.h \
   imgutils.h\
@@ -154,6 +155,7 @@ OBJS-$(!HAVE_ATOMICS_NATIVE)+= atomic.o 
\
 
 OBJS-$(CONFIG_CUDA) += hwcontext_cuda.o
 OBJS-$(CONFIG_DXVA2)+= hwcontext_dxva2.o
+OBJS-$(CONFIG_LIBMFX)   += hwcontext_qsv.o
 OBJS-$(CONFIG_LZO)  += lzo.o
 OBJS-$(CONFIG_OPENCL)   += opencl.o opencl_internal.o
 OBJS-$(CONFIG_VAAPI)+= hwcontext_vaapi.o
@@ -166,6 +168,7 @@ SLIBOBJS-$(HAVE_GNU_WINDRES)+= avutilres.o
 
 SKIPHEADERS-$(CONFIG_CUDA) += hwcontext_cuda.h
 SKIPHEADERS-$(CONFIG_DXVA2)+= hwcontext_dxva2.h
+SKIPHEADERS-$(CONFIG_LIBMFX)   += hwcontext_qsv.h
 SKIPHEADERS-$(CONFIG_VAAPI)+= hwcontext_vaapi.h
 SKIPHEADERS-$(CONFIG_VDPAU)+= hwcontext_vdpau.h
 SKIPHEADERS-$(HAVE_ATOMICS_GCC)+= atomic_gcc.h
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 1e9e913..8af7afa 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -35,6 +35,9 @@ static const HWContextType *hw_table[] = {
 #if CONFIG_DXVA2
 _hwcontext_type_dxva2,
 #endif
+#if CONFIG_LIBMFX
+_hwcontext_type_qsv,
+#endif
 #if CONFIG_VAAPI
 _hwcontext_type_vaapi,
 #endif
diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h
index 4e9da02..5e2af09 100644
--- a/libavutil/hwcontext.h
+++ b/libavutil/hwcontext.h
@@ -29,6 +29,7 @@ enum AVHWDeviceType {
 AV_HWDEVICE_TYPE_CUDA,
 AV_HWDEVICE_TYPE_VAAPI,
 AV_HWDEVICE_TYPE_DXVA2,
+AV_HWDEVICE_TYPE_QSV,
 };
 
 typedef struct AVHWDeviceInternal AVHWDeviceInternal;
diff --git a/libavutil/hwcontext_internal.h b/libavutil/hwcontext_internal.h
index cf832fe..079e42b 100644
--- a/libavutil/hwcontext_internal.h
+++ b/libavutil/hwcontext_internal.h
@@ -101,6 +101,7 @@ struct AVHWFramesInternal {
 
 extern const HWContextType ff_hwcontext_type_cuda;
 extern const HWContextType ff_hwcontext_type_dxva2;
+extern const HWContextType ff_hwcontext_type_qsv;
 extern const HWContextType ff_hwcontext_type_vaapi;
 extern const HWContextType ff_hwcontext_type_vdpau;
 
diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
new file mode 100644
index 000..13be5b0
--- /dev/null
+++ b/libavutil/hwcontext_qsv.c
@@ -0,0 +1,791 @@
+/*
+ * 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 

[FFmpeg-cvslog] qsvdec: move reading the user-provided session to qsv_decode_init()

2016-09-28 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sat May 21 
18:26:40 2016 +0200| [6f19bbcf8532d018d8d6d82e000738d0ac2385c9] | committer: 
Anton Khirnov

qsvdec: move reading the user-provided session to qsv_decode_init()

This is a more appropriate place for it.

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

 libavcodec/qsvdec.c | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 1d59e72..e3e5bba 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -70,8 +70,9 @@ static int qsv_init_session(AVCodecContext *avctx, QSVContext 
*q, mfxSession ses
 return 0;
 }
 
-static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q, mfxSession 
session)
+static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
 {
+mfxSession session = NULL;
 mfxVideoParam param = { { 0 } };
 int ret;
 
@@ -82,13 +83,20 @@ static int qsv_decode_init(AVCodecContext *avctx, 
QSVContext *q, mfxSession sess
 return AVERROR(ENOMEM);
 }
 
+if (avctx->hwaccel_context) {
+AVQSVContext *user_ctx = avctx->hwaccel_context;
+session   = user_ctx->session;
+q->iopattern  = user_ctx->iopattern;
+q->ext_buffers= user_ctx->ext_buffers;
+q->nb_ext_buffers = user_ctx->nb_ext_buffers;
+}
+
 ret = qsv_init_session(avctx, q, session);
 if (ret < 0) {
 av_log(avctx, AV_LOG_ERROR, "Error initializing an MFX session\n");
 return ret;
 }
 
-
 ret = ff_qsv_codec_id_to_mfx(avctx->codec_id);
 if (ret < 0)
 return ret;
@@ -399,8 +407,6 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext 
*q,
 if (q->parser->format   != q->orig_pix_fmt||
 q->parser->coded_width  != avctx->coded_width ||
 q->parser->coded_height != avctx->coded_height) {
-mfxSession session = NULL;
-
 enum AVPixelFormat pix_fmts[3] = { AV_PIX_FMT_QSV,
AV_PIX_FMT_NONE,
AV_PIX_FMT_NONE };
@@ -429,15 +435,7 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext 
*q,
 
 avctx->pix_fmt = ret;
 
-if (avctx->hwaccel_context) {
-AVQSVContext *user_ctx = avctx->hwaccel_context;
-session   = user_ctx->session;
-q->iopattern  = user_ctx->iopattern;
-q->ext_buffers= user_ctx->ext_buffers;
-q->nb_ext_buffers = user_ctx->nb_ext_buffers;
-}
-
-ret = qsv_decode_init(avctx, q, session);
+ret = qsv_decode_init(avctx, q);
 if (ret < 0)
 goto reinit_fail;
 }

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


[FFmpeg-cvslog] Merge commit '6f19bbcf8532d018d8d6d82e000738d0ac2385c9'

2016-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Sep 28 13:26:12 
2016 -0300| [e9a5fc967867f9bd361f472306ca130bb64b0b04] | committer: James Almer

Merge commit '6f19bbcf8532d018d8d6d82e000738d0ac2385c9'

* commit '6f19bbcf8532d018d8d6d82e000738d0ac2385c9':
  qsvdec: move reading the user-provided session to qsv_decode_init()

Conflicts:
libavcodec/qsvdec.c

Merged-by: James Almer 

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

 libavcodec/qsvdec.c | 33 -
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 98585e3..b685e0e 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -49,8 +49,27 @@ int ff_qsv_map_pixfmt(enum AVPixelFormat format)
 }
 }
 
+static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession 
session)
+{
+if (!session) {
+if (!q->internal_qs.session) {
+   int ret = ff_qsv_init_internal_session(avctx, >internal_qs,
+  q->load_plugins);
+if (ret < 0)
+return ret;
+}
+
+q->session = q->internal_qs.session;
+} else {
+q->session = session;
+}
+
+   return 0;
+}
+
 static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket 
*avpkt)
 {
+mfxSession session = NULL;
 mfxVideoParam param = { { 0 } };
 mfxBitstream bs   = { { { 0 } } };
 int ret;
@@ -68,20 +87,16 @@ static int qsv_decode_init(AVCodecContext *avctx, 
QSVContext *q, AVPacket *avpkt
 if (avctx->hwaccel_context) {
 AVQSVContext *qsv = avctx->hwaccel_context;
 
-q->session= qsv->session;
+session   = qsv->session;
 q->iopattern  = qsv->iopattern;
 q->ext_buffers= qsv->ext_buffers;
 q->nb_ext_buffers = qsv->nb_ext_buffers;
 }
-if (!q->session) {
-if (!q->internal_qs.session) {
-ret = ff_qsv_init_internal_session(avctx, >internal_qs,
-   q->load_plugins);
-if (ret < 0)
-return ret;
-}
 
-q->session = q->internal_qs.session;
+ret = qsv_init_session(avctx, q, session);
+if (ret < 0) {
+av_log(avctx, AV_LOG_ERROR, "Error initializing an MFX session\n");
+return ret;
 }
 
 if (avpkt->size) {


==

diff --cc libavcodec/qsvdec.c
index 98585e3,e3e5bba..b685e0e
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@@ -49,67 -49,70 +49,82 @@@ int ff_qsv_map_pixfmt(enum AVPixelForma
  }
  }
  
+ static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession 
session)
+ {
+ if (!session) {
 -if (!q->internal_session) {
 -int ret = ff_qsv_init_internal_session(avctx, 
>internal_session,
 -   q->load_plugins);
++if (!q->internal_qs.session) {
++   int ret = ff_qsv_init_internal_session(avctx, >internal_qs,
++  q->load_plugins);
+ if (ret < 0)
+ return ret;
+ }
+ 
 -q->session = q->internal_session;
++q->session = q->internal_qs.session;
+ } else {
+ q->session = session;
+ }
+ 
 -/* make sure the decoder is uninitialized */
 -MFXVideoDECODE_Close(q->session);
 -
 -return 0;
++   return 0;
+ }
+ 
 -static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
 +static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q, AVPacket 
*avpkt)
  {
+ mfxSession session = NULL;
  mfxVideoParam param = { { 0 } };
 +mfxBitstream bs   = { { { 0 } } };
  int ret;
 +enum AVPixelFormat pix_fmts[3] = { AV_PIX_FMT_QSV,
 +   AV_PIX_FMT_NV12,
 +   AV_PIX_FMT_NONE };
  
 -if (!q->async_fifo) {
 -q->async_fifo = av_fifo_alloc((1 + q->async_depth) *
 -  (sizeof(mfxSyncPoint*) + 
sizeof(QSVFrame*)));
 -if (!q->async_fifo)
 -return AVERROR(ENOMEM);
 -}
 +ret = ff_get_format(avctx, pix_fmts);
 +if (ret < 0)
 +return ret;
 +
 +avctx->pix_fmt  = ret;
  
 +q->iopattern  = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
  if (avctx->hwaccel_context) {
 -AVQSVContext *user_ctx = avctx->hwaccel_context;
 -session   = user_ctx->session;
 -q->iopattern  = user_ctx->iopattern;
 -q->ext_buffers= user_ctx->ext_buffers;
 -q->nb_ext_buffers = user_ctx->nb_ext_buffers;
 +AVQSVContext *qsv = avctx->hwaccel_context;
 +
- q->session= qsv->session;
++session   = qsv->session;
 +q->iopattern  = qsv->iopattern;
 +

[FFmpeg-cvslog] Merge commit 'e85f6f7f8d037c0af0f294000718d9ba22753baa'

2016-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Sep 28 13:22:00 
2016 -0300| [32c25f06b79f9edcda726f6e043325d40036cdce] | committer: James Almer

Merge commit 'e85f6f7f8d037c0af0f294000718d9ba22753baa'

* commit 'e85f6f7f8d037c0af0f294000718d9ba22753baa':
  lavc: allow using AVCodecContext.hw_frames_ctx for decoding

Conflicts:
doc/APIchanges
libavcodec/version.h

Merged-by: James Almer 

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

 doc/APIchanges   |  3 +++
 libavcodec/avcodec.h | 24 +---
 libavcodec/utils.c   | 15 +++
 libavcodec/version.h |  4 ++--
 4 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index e4a96cc..7acfc3e 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-09-xx - xxx - lavc 57.59.100/ 57.23.0 - avcodec.h
+  AVCodecContext.hw_frames_ctx now may be used by decoders.
+
 2016-09-27 - xxx - lavf 57.51.100 - avformat.h
   Add av_stream_get_codec_timebase()
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b174116..d72ee07 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3518,15 +3518,25 @@ typedef struct AVCodecContext {
 intnb_coded_side_data;
 
 /**
- * Encoding only.
+ * A reference to the AVHWFramesContext describing the input (for encoding)
+ * or output (decoding) frames. The reference is set by the caller and
+ * afterwards owned (and freed) by libavcodec.
  *
- * For hardware encoders configured to use a hwaccel pixel format, this
- * field should be set by the caller to a reference to the 
AVHWFramesContext
- * describing input frames. AVHWFramesContext.format must be equal to
- * AVCodecContext.pix_fmt.
+ * - decoding: This field should be set by the caller from the get_format()
+ * callback. The previous reference (if any) will always be
+ * unreffed by libavcodec before the get_format() call.
  *
- * This field should be set before avcodec_open2() is called and is
- * afterwards owned and managed by libavcodec.
+ * If the default get_buffer2() is used with a hwaccel pixel
+ * format, then this AVHWFramesContext will be used for
+ * allocating the frame buffers.
+ *
+ * - encoding: For hardware encoders configured to use a hwaccel pixel
+ * format, this field should be set by the caller to a 
reference
+ * to the AVHWFramesContext describing input frames.
+ * AVHWFramesContext.format must be equal to
+ * AVCodecContext.pix_fmt.
+ *
+ * This field should be set before avcodec_open2() is called.
  */
 AVBufferRef *hw_frames_ctx;
 
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b0345b6..0d78f0b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -724,6 +724,9 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, 
AVFrame *frame, int flags
 {
 int ret;
 
+if (avctx->hw_frames_ctx)
+return av_hwframe_get_buffer(avctx->hw_frames_ctx, frame, 0);
+
 if ((ret = update_frame_pool(avctx, frame)) < 0)
 return ret;
 
@@ -1119,6 +1122,8 @@ int ff_get_format(AVCodecContext *avctx, const enum 
AVPixelFormat *fmt)
 av_freep(>internal->hwaccel_priv_data);
 avctx->hwaccel = NULL;
 
+av_buffer_unref(>hw_frames_ctx);
+
 ret = avctx->get_format(avctx, choices);
 
 desc = av_pix_fmt_desc_get(ret);
@@ -1134,6 +1139,16 @@ int ff_get_format(AVCodecContext *avctx, const enum 
AVPixelFormat *fmt)
 break;
 #endif
 
+if (avctx->hw_frames_ctx) {
+AVHWFramesContext *hw_frames_ctx = 
(AVHWFramesContext*)avctx->hw_frames_ctx->data;
+if (hw_frames_ctx->format != ret) {
+av_log(avctx, AV_LOG_ERROR, "Format returned from get_buffer() 
"
+   "does not match the format of provided 
AVHWFramesContext\n");
+ret = AV_PIX_FMT_NONE;
+break;
+}
+}
+
 if (!setup_hwaccel(avctx, ret, desc->name))
 break;
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index c583da0..71dac40 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,8 +28,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  57
-#define LIBAVCODEC_VERSION_MINOR  58
-#define LIBAVCODEC_VERSION_MICRO 104
+#define LIBAVCODEC_VERSION_MINOR  59
+#define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \


==

diff --cc doc/APIchanges
index 

[FFmpeg-cvslog] lavc: allow using AVCodecContext.hw_frames_ctx for decoding

2016-09-28 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Mon May  9 
21:40:08 2016 +0200| [e85f6f7f8d037c0af0f294000718d9ba22753baa] | committer: 
Anton Khirnov

lavc: allow using AVCodecContext.hw_frames_ctx for decoding

For now it will only be used by the default get_buffer2 callback for
allocating hw frames.

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

 doc/APIchanges   |  3 +++
 libavcodec/avcodec.h | 24 +---
 libavcodec/utils.c   | 15 +++
 libavcodec/version.h |  4 ++--
 4 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index de0213f..e251490 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-xx-xx - xxx - lavc 57.23.0 - avcodec.h
+  AVCodecContext.hw_frames_ctx now may be used by decoders.
+
 2016-xx-xx - xxx - lavc 57.20.0 - avcodec.h
   Add FF_PROFILE_H264_MULTIVIEW_HIGH and FF_PROFILE_H264_STEREO_HIGH.
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c4bf708..ace761d 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3078,15 +3078,25 @@ typedef struct AVCodecContext {
 intnb_coded_side_data;
 
 /**
- * Encoding only.
+ * A reference to the AVHWFramesContext describing the input (for encoding)
+ * or output (decoding) frames. The reference is set by the caller and
+ * afterwards owned (and freed) by libavcodec.
  *
- * For hardware encoders configured to use a hwaccel pixel format, this
- * field should be set by the caller to a reference to the 
AVHWFramesContext
- * describing input frames. AVHWFramesContext.format must be equal to
- * AVCodecContext.pix_fmt.
+ * - decoding: This field should be set by the caller from the get_format()
+ * callback. The previous reference (if any) will always be
+ * unreffed by libavcodec before the get_format() call.
  *
- * This field should be set before avcodec_open2() is called and is
- * afterwards owned and managed by libavcodec.
+ * If the default get_buffer2() is used with a hwaccel pixel
+ * format, then this AVHWFramesContext will be used for
+ * allocating the frame buffers.
+ *
+ * - encoding: For hardware encoders configured to use a hwaccel pixel
+ * format, this field should be set by the caller to a 
reference
+ * to the AVHWFramesContext describing input frames.
+ * AVHWFramesContext.format must be equal to
+ * AVCodecContext.pix_fmt.
+ *
+ * This field should be set before avcodec_open2() is called.
  */
 AVBufferRef *hw_frames_ctx;
 } AVCodecContext;
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a0352b8..8f8efec 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -513,6 +513,9 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, 
AVFrame *frame, int flags
 {
 int ret;
 
+if (avctx->hw_frames_ctx)
+return av_hwframe_get_buffer(avctx->hw_frames_ctx, frame, 0);
+
 if ((ret = update_frame_pool(avctx, frame)) < 0)
 return ret;
 
@@ -793,6 +796,8 @@ int ff_get_format(AVCodecContext *avctx, const enum 
AVPixelFormat *fmt)
 av_freep(>internal->hwaccel_priv_data);
 avctx->hwaccel = NULL;
 
+av_buffer_unref(>hw_frames_ctx);
+
 ret = avctx->get_format(avctx, choices);
 
 desc = av_pix_fmt_desc_get(ret);
@@ -804,6 +809,16 @@ int ff_get_format(AVCodecContext *avctx, const enum 
AVPixelFormat *fmt)
 if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
 break;
 
+if (avctx->hw_frames_ctx) {
+AVHWFramesContext *hw_frames_ctx = 
(AVHWFramesContext*)avctx->hw_frames_ctx->data;
+if (hw_frames_ctx->format != ret) {
+av_log(avctx, AV_LOG_ERROR, "Format returned from get_buffer() 
"
+   "does not match the format of provided 
AVHWFramesContext\n");
+ret = AV_PIX_FMT_NONE;
+break;
+}
+}
+
 if (!setup_hwaccel(avctx, ret, desc->name))
 break;
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 78f4214..9b495e9 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,8 +28,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 57
-#define LIBAVCODEC_VERSION_MINOR 22
-#define LIBAVCODEC_VERSION_MICRO  2
+#define LIBAVCODEC_VERSION_MINOR 23
+#define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org

[FFmpeg-cvslog] truemotion2rt: Use ff_set_dimensions

2016-09-28 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Tue 
Jun 21 09:11:32 2016 -0400| [40dd5166d2ba4f9035b93748840e408cd8be40e5] | 
committer: Vittorio Giovara

truemotion2rt: Use ff_set_dimensions

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

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

diff --git a/libavcodec/truemotion2rt.c b/libavcodec/truemotion2rt.c
index 4d398fb..ed7fb68 100644
--- a/libavcodec/truemotion2rt.c
+++ b/libavcodec/truemotion2rt.c
@@ -63,7 +63,8 @@ static int truemotion2rt_decode_header(AVCodecContext *avctx, 
AVPacket *avpkt)
 uint8_t header_buffer[128] = { 0 };  /* logical maximum header size */
 const uint8_t *buf = avpkt->data;
 int size = avpkt->size;
-int i;
+int width, height;
+int ret, i;
 
 if (size < 1) {
 av_log(avctx, AV_LOG_ERROR, "input packet too small (%d)\n", size);
@@ -90,8 +91,12 @@ static int truemotion2rt_decode_header(AVCodecContext 
*avctx, AVPacket *avpkt)
 if (s->delta_size < 2 || s->delta_size > 4)
 return AVERROR_INVALIDDATA;
 
-avctx->height = AV_RL16(header_buffer + 5);
-avctx->width  = AV_RL16(header_buffer + 7);
+height = AV_RL16(header_buffer + 5);
+width  = AV_RL16(header_buffer + 7);
+
+ret = ff_set_dimensions(avctx, width, height);
+if (ret < 0)
+return ret;
 
 av_log(avctx, AV_LOG_DEBUG, "Header size: %d\n", header_size);
 return header_size;

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


[FFmpeg-cvslog] Merge commit '40dd5166d2ba4f9035b93748840e408cd8be40e5'

2016-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Sep 28 13:19:07 
2016 -0300| [0153cc49b20ac6c54d5bcd86f5ce53357e6b29aa] | committer: James Almer

Merge commit '40dd5166d2ba4f9035b93748840e408cd8be40e5'

* commit '40dd5166d2ba4f9035b93748840e408cd8be40e5':
  truemotion2rt: Use ff_set_dimensions

Merged-by: James Almer 

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

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

diff --git a/libavcodec/truemotion2rt.c b/libavcodec/truemotion2rt.c
index 94d4480..d639187 100644
--- a/libavcodec/truemotion2rt.c
+++ b/libavcodec/truemotion2rt.c
@@ -63,7 +63,8 @@ static int truemotion2rt_decode_header(AVCodecContext *avctx, 
const AVPacket *av
 uint8_t header_buffer[128] = { 0 };  /* logical maximum header size */
 const uint8_t *buf = avpkt->data;
 int size = avpkt->size;
-int i;
+int width, height;
+int ret, i;
 
 if (size < 1) {
 av_log(avctx, AV_LOG_ERROR, "input packet too small (%d)\n", size);
@@ -90,8 +91,12 @@ static int truemotion2rt_decode_header(AVCodecContext 
*avctx, const AVPacket *av
 if (s->delta_size < 2 || s->delta_size > 4)
 return AVERROR_INVALIDDATA;
 
-avctx->height = AV_RL16(header_buffer + 5);
-avctx->width  = AV_RL16(header_buffer + 7);
+height = AV_RL16(header_buffer + 5);
+width  = AV_RL16(header_buffer + 7);
+
+ret = ff_set_dimensions(avctx, width, height);
+if (ret < 0)
+return ret;
 
 av_log(avctx, AV_LOG_DEBUG, "Header size: %d\n", header_size);
 return header_size;


==


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


[FFmpeg-cvslog] pixdesc: Add new SMPTE 431, 432, and 2085 color properties

2016-09-28 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Wed 
Jun 15 14:25:04 2016 -0400| [a8164323374e86ce5f93759230868c98356833a2] | 
committer: Vittorio Giovara

pixdesc: Add new SMPTE 431, 432, and 2085 color properties

Appeared in H.264 2016/02.

Signed-off-by: Vittorio Giovara 

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

 libavcodec/options_table.h | 3 +++
 libavcodec/version.h   | 2 +-
 libavutil/pixdesc.c| 3 +++
 libavutil/pixfmt.h | 3 +++
 libavutil/version.h| 2 +-
 5 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 5c788ed..beebe18 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -436,6 +436,8 @@ static const AVOption avcodec_options[] = {
 {"film","Film",0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_FILM }, 
   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt2020",  "BT.2020", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT2020 
},  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smptest428_1", "SMPTE ST 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte431","SMPTE 431-2", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE431 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte432","SMPTE 422-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE432 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
"color_trc_type"},
 {"bt709","BT.709",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT709 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"unspecified",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
@@ -465,6 +467,7 @@ static const AVOption avcodec_options[] = {
 {"ycocg",   "YCOCG",   0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_YCOCG 
},   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt2020_ncl",  "BT.2020 NCL", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_BT2020_NCL },  INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt2020_cl",   "BT.2020 CL",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_BT2020_CL },   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
+{"smpte2085",   "SMPTE 2085",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_SMPTE2085 },   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"color_range", "color range", OFFSET(color_range), AV_OPT_TYPE_INT, {.i64 = 
AVCOL_RANGE_UNSPECIFIED }, 0, AVCOL_RANGE_NB-1, V|E|D, "color_range_type"},
 {"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_RANGE_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_range_type"},
 {"mpeg", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG 
},INT_MIN, INT_MAX, V|E|D, "color_range_type"},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 3f36d69..78f4214 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 57
 #define LIBAVCODEC_VERSION_MINOR 22
-#define LIBAVCODEC_VERSION_MICRO  1
+#define LIBAVCODEC_VERSION_MICRO  2
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 209d107..4e52067 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1613,6 +1613,8 @@ static const char *color_primaries_names[] = {
 [AVCOL_PRI_FILM] = "film",
 [AVCOL_PRI_BT2020] = "bt2020",
 [AVCOL_PRI_SMPTEST428_1] = "smptest428-1",
+[AVCOL_PRI_SMPTE431] = "smpte431",
+[AVCOL_PRI_SMPTE432] = "smpte432",
 };
 
 static const char *color_transfer_names[] = {
@@ -1649,6 +1651,7 @@ static const char *color_space_names[] = {
 [AVCOL_SPC_YCOCG] = "ycgco",
 [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
 [AVCOL_SPC_BT2020_CL] = "bt2020c",
+[AVCOL_SPC_SMPTE2085] = "smpte2085",
 };
 
 static const char *chroma_location_names[] = {
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 621c9ac..58d87a0 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -299,6 +299,8 @@ enum AVColorPrimaries {
 AVCOL_PRI_FILM= 8, ///< colour filters using Illuminant C
 AVCOL_PRI_BT2020  = 9, ///< ITU-R BT2020
 AVCOL_PRI_SMPTEST428_1 = 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ)
+AVCOL_PRI_SMPTE431= 11, ///< SMPTE ST 431-2 (2011)
+AVCOL_PRI_SMPTE432= 12, ///< SMPTE ST 432-1 D65 (2010)
 AVCOL_PRI_NB,  ///< Not part of ABI
 };
 
@@ -343,6 +345,7 @@ enum AVColorSpace {
 AVCOL_SPC_YCOCG   = 8,  ///< Used by Dirac / VC-2 and H.264 FRext, see 
ITU-T SG16
 AVCOL_SPC_BT2020_NCL  = 9,  ///< ITU-R BT2020 non-constant 

[FFmpeg-cvslog] Merge commit 'a8164323374e86ce5f93759230868c98356833a2'

2016-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Sep 28 13:12:18 
2016 -0300| [6e76c9c45018b9cea383ff1c3f17d08792623509] | committer: James Almer

Merge commit 'a8164323374e86ce5f93759230868c98356833a2'

* commit 'a8164323374e86ce5f93759230868c98356833a2':
  pixdesc: Add new SMPTE 431, 432, and 2085 color properties

Conflicts:
libavcodec/options_table.h
libavcodec/version.h
libavutil/pixdesc.c
libavutil/pixfmt.h
libavutil/version.h

Merged-by: James Almer 

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

 libavcodec/options_table.h | 3 +++
 libavcodec/version.h   | 2 +-
 libavutil/pixdesc.c| 3 +++
 libavutil/pixfmt.h | 5 -
 libavutil/version.h| 2 +-
 5 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 88dee61..995906b 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -460,6 +460,8 @@ static const AVOption avcodec_options[] = {
 {"film","Film",   0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_FILM 
}, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt2020",  "BT.2020",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_BT2020 },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte428_1",  "SMPTE ST 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte431","SMPTE 431-2",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE431 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte432","SMPTE 422-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE432 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
"color_trc_type"},
 {"bt709","BT.709",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT709 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"unspecified",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
@@ -489,6 +491,7 @@ static const AVOption avcodec_options[] = {
 {"ycocg",   "YCOCG",   0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_YCOCG 
},   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt2020_ncl",  "BT.2020 NCL", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_BT2020_NCL },  INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt2020_cl",   "BT.2020 CL",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_BT2020_CL },   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
+{"smpte2085",   "SMPTE 2085",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_SPC_SMPTE2085 },   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"color_range", "color range", OFFSET(color_range), AV_OPT_TYPE_INT, {.i64 = 
AVCOL_RANGE_UNSPECIFIED }, 0, AVCOL_RANGE_NB-1, V|E|D, "color_range_type"},
 {"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_RANGE_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_range_type"},
 {"mpeg", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG 
},INT_MIN, INT_MAX, V|E|D, "color_range_type"},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 5889879..c583da0 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  57
 #define LIBAVCODEC_VERSION_MINOR  58
-#define LIBAVCODEC_VERSION_MICRO 103
+#define LIBAVCODEC_VERSION_MICRO 104
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index a147a2d..b715fce 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2115,6 +2115,8 @@ static const char *color_primaries_names[AVCOL_PRI_NB] = {
 [AVCOL_PRI_FILM] = "film",
 [AVCOL_PRI_BT2020] = "bt2020",
 [AVCOL_PRI_SMPTEST428_1] = "smpte428-1",
+[AVCOL_PRI_SMPTE431] = "smpte431",
+[AVCOL_PRI_SMPTE432] = "smpte432",
 };
 
 static const char *color_transfer_names[] = {
@@ -2151,6 +2153,7 @@ static const char *color_space_names[] = {
 [AVCOL_SPC_YCOCG] = "ycgco",
 [AVCOL_SPC_BT2020_NCL] = "bt2020nc",
 [AVCOL_SPC_BT2020_CL] = "bt2020c",
+[AVCOL_SPC_SMPTE2085] = "smpte2085",
 };
 
 static const char *chroma_location_names[] = {
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 6f71ac0..6511f18 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -400,7 +400,9 @@ enum AVColorPrimaries {
 AVCOL_PRI_SMPTE240M   = 7,  ///< functionally identical to above
 AVCOL_PRI_FILM= 8,  ///< colour filters using Illuminant C
 AVCOL_PRI_BT2020  = 9,  ///< ITU-R BT2020
-AVCOL_PRI_SMPTEST428_1= 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ)
+AVCOL_PRI_SMPTEST428_1 = 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ)
+

[FFmpeg-cvslog] pixfmt: Add ARIB STD-B76 color transfer characteristic

2016-09-28 Thread Neil Birkbeck
ffmpeg | branch: master | Neil Birkbeck  | Wed Jun 15 
14:25:00 2016 -0400| [5d560d38deca1e4705e6d3784d737363b9c830fe] | committer: 
Vittorio Giovara

pixfmt: Add ARIB STD-B76 color transfer characteristic

Adding hybrid log-gamma (https://en.wikipedia.org/wiki/Hybrid_Log-Gamma)
based on the standardization in ARIB STD-B67:
http://www.arib.or.jp/english/html/overview/doc/2-STD-B67v1_0.pdf

The choice of enum value of 18 is consistent with HEVC:
http://phenix.it-sudparis.eu/jct/doc_end_user/current_document.php?id=10481

And also with latest proposal for color format in mkv:
https://mailarchive.ietf.org/arch/search/?email_list=cellar=1=Colour+Format+proposal

Signed-off-by: Vittorio Giovara 

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

 libavcodec/options_table.h | 1 +
 libavcodec/version.h   | 2 +-
 libavutil/pixdesc.c| 1 +
 libavutil/pixfmt.h | 1 +
 libavutil/version.h| 2 +-
 5 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index d2f6269..5c788ed 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -453,6 +453,7 @@ static const AVOption avcodec_options[] = {
 {"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smptest2084",  "SMPTE ST 2084",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST2084 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smptest428_1", "SMPTE ST 428-1",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"arib-std-b67", "ARIB STD-B67", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_ARIB_STD_B67 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = 
AVCOL_SPC_UNSPECIFIED }, 0, AVCOL_SPC_NB-1, V|E|D, "colorspace_type"},
 {"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_RGB },  
   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt709",   "BT.709",  0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT709 
},   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 4f6e058..3f36d69 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 57
 #define LIBAVCODEC_VERSION_MINOR 22
-#define LIBAVCODEC_VERSION_MICRO  0
+#define LIBAVCODEC_VERSION_MICRO  1
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 7a53ba3..209d107 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1634,6 +1634,7 @@ static const char *color_transfer_names[] = {
 [AVCOL_TRC_BT2020_12] = "bt2020-20",
 [AVCOL_TRC_SMPTEST2084] = "smptest2084",
 [AVCOL_TRC_SMPTEST428_1] = "smptest428-1",
+[AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",
 };
 
 static const char *color_space_names[] = {
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 5c7f468..621c9ac 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -324,6 +324,7 @@ enum AVColorTransferCharacteristic {
 AVCOL_TRC_BT2020_12= 15, ///< ITU-R BT2020 for 12-bit system
 AVCOL_TRC_SMPTEST2084  = 16, ///< SMPTE ST 2084 for 10-, 12-, 14- and 
16-bit systems
 AVCOL_TRC_SMPTEST428_1 = 17, ///< SMPTE ST 428-1
+AVCOL_TRC_ARIB_STD_B67 = 18, ///< ARIB STD-B67, known as "Hybrid log-gamma"
 AVCOL_TRC_NB,///< Not part of ABI
 };
 
diff --git a/libavutil/version.h b/libavutil/version.h
index 48a5878..7ea434e 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -54,7 +54,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 55
-#define LIBAVUTIL_VERSION_MINOR 13
+#define LIBAVUTIL_VERSION_MINOR 14
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

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


[FFmpeg-cvslog] Merge commit '5d560d38deca1e4705e6d3784d737363b9c830fe'

2016-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Sep 28 13:09:26 
2016 -0300| [f013ba475b0dbf71e2804c57e67bf308ae636f2b] | committer: James Almer

Merge commit '5d560d38deca1e4705e6d3784d737363b9c830fe'

* commit '5d560d38deca1e4705e6d3784d737363b9c830fe':
  pixfmt: Add ARIB STD-B76 color transfer characteristic

See 785038c92cc7fc1da437576382083246ca598fce

Conflicts:
libavcodec/options_table.h
libavcodec/version.h
libavutil/pixdesc.c
libavutil/version.h

Merged-by: James Almer 

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

 libavcodec/options_table.h | 1 +
 libavcodec/version.h   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index fe35454..88dee61 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -477,6 +477,7 @@ static const AVOption avcodec_options[] = {
 {"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smpte2084","SMPTE ST 2084",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST2084 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smpte428_1",   "SMPTE ST 428-1",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"arib-std-b67", "ARIB STD-B67", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_ARIB_STD_B67 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = 
AVCOL_SPC_UNSPECIFIED }, 0, AVCOL_SPC_NB-1, V|E|D, "colorspace_type"},
 {"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_RGB },  
   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt709",   "BT.709",  0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT709 
},   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index e7778e9..5889879 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  57
 #define LIBAVCODEC_VERSION_MINOR  58
-#define LIBAVCODEC_VERSION_MICRO 102
+#define LIBAVCODEC_VERSION_MICRO 103
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \


==

diff --cc libavcodec/options_table.h
index fe35454,5c788ed..88dee61
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@@ -475,8 -451,9 +475,9 @@@ static const AVOption avcodec_options[
  {"iec61966_2_1", "IEC 61966-2-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
  {"bt2020_10bit", "BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_10 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
  {"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 -{"smptest2084",  "SMPTE ST 2084",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST2084 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 -{"smptest428_1", "SMPTE ST 428-1",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 +{"smpte2084","SMPTE ST 2084",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST2084 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 +{"smpte428_1",   "SMPTE ST 428-1",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+ {"arib-std-b67", "ARIB STD-B67", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_ARIB_STD_B67 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
  {"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = 
AVCOL_SPC_UNSPECIFIED }, 0, AVCOL_SPC_NB-1, V|E|D, "colorspace_type"},
  {"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_RGB }, 
INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
  {"bt709",   "BT.709",  0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT709 
},   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
diff --cc libavcodec/version.h
index e7778e9,3f36d69..5889879
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@@ -27,9 -27,9 +27,9 @@@
  
  #include "libavutil/version.h"
  
 -#define LIBAVCODEC_VERSION_MAJOR 57
 -#define LIBAVCODEC_VERSION_MINOR 22
 -#define LIBAVCODEC_VERSION_MICRO  1
 +#define LIBAVCODEC_VERSION_MAJOR  57
 +#define LIBAVCODEC_VERSION_MINOR  58
- #define LIBAVCODEC_VERSION_MICRO 102
++#define LIBAVCODEC_VERSION_MICRO 103
  
  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
 LIBAVCODEC_VERSION_MINOR, \

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


[FFmpeg-cvslog] lavc/movtextdec.c: Avoid infinite loop on invalid data.

2016-09-28 Thread Sasi Inguva
ffmpeg | branch: release/3.0 | Sasi Inguva  | 
Tue Sep 27 19:23:20 2016 -0700| [82b58841c9d0e9d7d76d59438fe6b2a315e07e38] | 
committer: Michael Niedermayer

lavc/movtextdec.c: Avoid infinite loop on invalid data.

Signed-off-by: Sasi Inguva 
(cherry picked from commit 7e9e1b7070242a79fa6e3acd749d7fe76e39ea7b)
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 8d0e814..28f7b8f 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -477,6 +477,10 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
 tsmb_type = AV_RB32(tsmb);
 tsmb += 4;
 
+if (tsmb_size == 0) {
+  return AVERROR_INVALIDDATA;
+}
+
 if (tsmb_size == 1) {
 if (m->tracksize + 16 > avpkt->size)
 break;

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


[FFmpeg-cvslog] avformat/avidec: Check nb_streams in read_gab2_sub()

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Wed Sep 28 16:14:08 2016 +0200| [8c43f320574d201fe1b696b133c08368f5f18508] | 
committer: Michael Niedermayer

avformat/avidec: Check nb_streams in read_gab2_sub()

Fixes null pointer dereference
Fixes: 1/null_point.avi

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 2679ad4773aa356e7c3da5c68bc81f02a194617f)
Signed-off-by: Michael Niedermayer 

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

 libavformat/avidec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 2e053a3..7adb819 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1094,6 +1094,8 @@ static int read_gab2_sub(AVFormatContext *s, AVStream 
*st, AVPacket *pkt)
 goto error;
 
 if (!avformat_open_input(>sub_ctx, "", sub_demuxer, NULL)) {
+if (ast->sub_ctx->nb_streams != 1)
+goto error;
 ff_read_packet(ast->sub_ctx, >sub_pkt);
 *st->codec = *ast->sub_ctx->streams[0]->codec;
 ast->sub_ctx->streams[0]->codec->extradata = NULL;

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


[FFmpeg-cvslog] avcodec/ansi: Check dimensions

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Mon Sep 26 20:25:59 2016 +0200| [e5bf7ab3e7c6432da47958105ac59ee2681d3198] | 
committer: Michael Niedermayer

avcodec/ansi: Check dimensions

Fixes: 1.avi

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 69449da436169e7facaa6d1f3bcbc41cf6ce2754)
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c
index 21d5ae1..98ea9e3 100644
--- a/libavcodec/ansi.c
+++ b/libavcodec/ansi.c
@@ -94,6 +94,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
 int ret = ff_set_dimensions(avctx, 80 << 3, 25 << 4);
 if (ret < 0)
 return ret;
+} else if (avctx->width % FONT_WIDTH || avctx->height % s->font_height) {
+av_log(avctx, AV_LOG_ERROR, "Invalid dimensions %d %d\n", 
avctx->width, avctx->height);
+return AVERROR(EINVAL);
 }
 return 0;
 }

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


[FFmpeg-cvslog] avformat/avidec: Remove ancient assert

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Wed Sep 28 15:47:12 2016 +0200| [77d5a237ef6803e3b5a138fdee10bf1f62e4a7d7] | 
committer: Michael Niedermayer

avformat/avidec: Remove ancient assert

This assert can with crafted files fail, a warning is already printed
for this case.

Fixes assertion failure
Fixes:1/assert.avi

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 14bac7e00d72eac687612d9b125e585011a56d4f)
Signed-off-by: Michael Niedermayer 

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

 libavformat/avidec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index f4a2872..2e053a3 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1846,7 +1846,6 @@ static int avi_read_seek(AVFormatContext *s, int 
stream_index,
 continue;
 
 //av_assert1(st2->codec->block_align);
-av_assert0(fabs(av_q2d(st2->time_base) - ast2->scale / 
(double)ast2->rate) < av_q2d(st2->time_base) * 0.0001);
 index = av_index_search_timestamp(st2,
   av_rescale_q(timestamp,
st->time_base,

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


[FFmpeg-cvslog] avformat/avidec: Fix memleak with dv in avi

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Sun Sep 25 11:56:11 2016 +0200| [fb7617df4eb13659fa20cb535888c10eac0fdb77] | 
committer: Michael Niedermayer

avformat/avidec: Fix memleak with dv in avi

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit b98dafe04564d5fe3e5bf5073d871dd93a4a62de)
Signed-off-by: Michael Niedermayer 

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

 libavformat/avidec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 7209980..f4a2872 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -608,6 +608,7 @@ static int avi_read_header(AVFormatContext *s)
 if (s->streams[0]->info)
 av_freep(>streams[0]->info->duration_error);
 av_freep(>streams[0]->info);
+av_freep(>streams[0]->internal);
 av_freep(>streams[0]);
 s->nb_streams = 0;
 if (CONFIG_DV_DEMUXER) {

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


[FFmpeg-cvslog] avcodec/g726: Add missing ADDB output mask

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Wed Sep 14 13:06:53 2016 +0200| [9357aa67572ce630267144ecd923c643a0982617] | 
committer: Michael Niedermayer

avcodec/g726: Add missing ADDB output mask

Fixes: 1.poc
Fixes out of array read

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit a5af1240fce845f645440364c1335e0f8e44ee6c)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/g726.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index c3d018f..f3de9e7 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -206,7 +206,7 @@ static int16_t g726_decode(G726Context* c, int I)
 
 if (I_sig)  /* get the sign */
 dq = -dq;
-re_signal = c->se + dq;
+re_signal = (int16_t)(c->se + dq);
 
 /* Update second order predictor coefficient A2 and A1 */
 pk0 = (c->sez + dq) ? sgn(c->sez + dq) : 0;

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


[FFmpeg-cvslog] avformat/utils: fix timebase error in avformat_seek_file()

2016-09-28 Thread Xinzheng Zhang
ffmpeg | branch: release/3.0 | Xinzheng Zhang  | Wed Sep 
14 16:13:45 2016 +0800| [f2f7d49f41b1d4a1ac7d6054c12ce92b4708d4d5] | committer: 
Michael Niedermayer

avformat/utils: fix timebase error in avformat_seek_file()

When there is only one stream and stream_index has not specified,
The ts has been transferd by the timebase of stream0 without modifying the 
stream_index
In this condation it cause seek failure.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit ecc04b4f2f29ac676e6c1d1ebf20ec45f5385f1e)
Signed-off-by: Michael Niedermayer 

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

 libavformat/utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 42b617e..c9bc6f2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2284,6 +2284,7 @@ int avformat_seek_file(AVFormatContext *s, int 
stream_index, int64_t min_ts,
 max_ts = av_rescale_rnd(max_ts, time_base.den,
 time_base.num * (int64_t)AV_TIME_BASE,
 AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX);
+stream_index = 0;
 }
 
 ret = s->iformat->read_seek2(s, stream_index, min_ts,

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


[FFmpeg-cvslog] avformat/movenc: Check packet in mov_write_single_packet() too

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Thu Sep 15 23:52:54 2016 +0200| [7fefa4138ddd8b4841459075b5e124b38b3806ee] | 
committer: Michael Niedermayer

avformat/movenc: Check packet in mov_write_single_packet() too

Fixes assertion failure

Found-by: durandal117
Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 28343139330f557e00293933a4697c7d0fc19c56)
Signed-off-by: Michael Niedermayer 

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

 libavformat/movenc.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 6230f30..cdc3a00 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4650,6 +4650,10 @@ static int mov_write_single_packet(AVFormatContext *s, 
AVPacket *pkt)
 int64_t frag_duration = 0;
 int size = pkt->size;
 
+int ret = check_pkt(s, pkt);
+if (ret < 0)
+return ret;
+
 if (mov->flags & FF_MOV_FLAG_FRAG_DISCONT) {
 int i;
 for (i = 0; i < s->nb_streams; i++)

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


[FFmpeg-cvslog] Update for 3.0.4

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Wed Sep 28 17:13:09 2016 +0200| [b9a1d389b2a05269042d013cf6da4a09ce6ccc24] | 
committer: Michael Niedermayer

Update for 3.0.4

Signed-off-by: Michael Niedermayer 

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

 Changelog| 19 +++
 RELEASE  |  2 +-
 doc/Doxyfile |  2 +-
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index 81fa45f..a5bcb37 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,25 @@
 Entries are sorted chronologically from oldest to youngest within each release,
 releases are sorted from youngest to oldest.
 
+version 3.0.4:
+- avformat/avidec: Check nb_streams in read_gab2_sub()
+- avformat/avidec: Remove ancient assert
+- avformat/avidec: Fix memleak with dv in avi
+- lavc/movtextdec.c: Avoid infinite loop on invalid data.
+- avcodec/ansi: Check dimensions
+- avcodec/cavsdsp: use av_clip_uint8() for idct
+- avformat/movenc: Check packet in mov_write_single_packet() too
+- avformat/movenc: Factor check_pkt() out
+- avformat/utils: fix timebase error in avformat_seek_file()
+- avcodec/g726: Add missing ADDB output mask
+- avcodec/avpacket: clear side_data_elems
+- avformat/movenc: Check first DTS similar to dts difference
+- avcodec/ccaption_dec: Use simple array instead of AVBuffer
+- avformat/mov: Fix potential integer overflow in mov_read_keys
+- swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices
+- swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices
+- lavf/utils: Avoid an overflow for huge negative durations.
+
 version 3.0.3:
 - avformat/avidec: Fix infinite loop in avi_read_nikon()
 - avcodec/aacenc: Tighter input checks
diff --git a/RELEASE b/RELEASE
index 75a22a2..b0f2dcb 100644
--- a/RELEASE
+++ b/RELEASE
@@ -1 +1 @@
-3.0.3
+3.0.4
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 91870f3..1159653 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME   = FFmpeg
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER = 3.0.3
+PROJECT_NUMBER = 3.0.4
 
 # With the PROJECT_LOGO tag one can specify a logo or icon that is included
 # in the documentation. The maximum height of the logo should not exceed 55

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


[FFmpeg-cvslog] avformat/movenc: Factor check_pkt() out

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Thu Sep 15 23:52:42 2016 +0200| [a1f77124c87614b71745e08194c667fc04eaa07c] | 
committer: Michael Niedermayer

avformat/movenc: Factor check_pkt() out

Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit deabcd2c05b2b01689d91394bbf3908da17234ed)
Signed-off-by: Michael Niedermayer 

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

 libavformat/movenc.c | 24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 4e51cdf..6230f30 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4342,15 +4342,10 @@ static int mov_auto_flush_fragment(AVFormatContext *s, 
int force)
 return ret;
 }
 
-int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
+static int check_pkt(AVFormatContext *s, AVPacket *pkt)
 {
 MOVMuxContext *mov = s->priv_data;
-AVIOContext *pb = s->pb;
 MOVTrack *trk = >tracks[pkt->stream_index];
-AVCodecContext *enc = trk->enc;
-unsigned int samples_in_chunk = 0;
-int size = pkt->size, ret = 0;
-uint8_t *reformatted_data = NULL;
 
 if (trk->entry) {
 int64_t duration = pkt->dts - trk->cluster[trk->entry - 1].dts;
@@ -4374,6 +4369,23 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" is 
invalid\n", pkt->duration);
 return AVERROR(EINVAL);
 }
+return 0;
+}
+
+int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
+{
+MOVMuxContext *mov = s->priv_data;
+AVIOContext *pb = s->pb;
+MOVTrack *trk = >tracks[pkt->stream_index];
+AVCodecContext *enc = trk->enc;
+unsigned int samples_in_chunk = 0;
+int size = pkt->size, ret = 0;
+uint8_t *reformatted_data = NULL;
+
+ret = check_pkt(s, pkt);
+if (ret < 0)
+return ret;
+
 if (mov->flags & FF_MOV_FLAG_FRAGMENT) {
 int ret;
 if (mov->moov_written || mov->flags & FF_MOV_FLAG_EMPTY_MOOV) {

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


[FFmpeg-cvslog] avcodec/ccaption_dec: Use simple array instead of AVBuffer

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Fri Sep  9 10:26:15 2016 +0200| [d669b7f4f6e8bfe4db5501c7f1d95bdae84f1f1f] | 
committer: Michael Niedermayer

avcodec/ccaption_dec: Use simple array instead of AVBuffer

This is simpler and fixes an out of array read, fixing it with AVBuffers
would be more complex

Fixes: 
e00d9e6e50e5495cc93fea41147b97bb/asan_heap-oob_12dcdbb_8798_b32a97ea722dd37bb5066812cc674552.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 752e6dfa3ea97e7901870bdd9e5a51f860607240)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/ccaption_dec.c | 27 +++
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 790f071..4b42dbc 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -135,7 +135,8 @@ typedef struct CCaptionSubContext {
 int64_t last_real_time;
 char prev_cmd[2];
 /* buffer to store pkt data */
-AVBufferRef *pktbuf;
+uint8_t *pktbuf;
+int pktbuf_size;
 } CCaptionSubContext;
 
 
@@ -160,11 +161,7 @@ static av_cold int init_decoder(AVCodecContext *avctx)
 if (ret < 0) {
 return ret;
 }
-/* allocate pkt buffer */
-ctx->pktbuf = av_buffer_alloc(128);
-if (!ctx->pktbuf) {
-ret = AVERROR(ENOMEM);
-}
+
 return ret;
 }
 
@@ -172,7 +169,8 @@ static av_cold int close_decoder(AVCodecContext *avctx)
 {
 CCaptionSubContext *ctx = avctx->priv_data;
 av_bprint_finalize(>buffer, NULL);
-av_buffer_unref(>pktbuf);
+av_freep(>pktbuf);
+ctx->pktbuf_size = 0;
 return 0;
 }
 
@@ -578,16 +576,13 @@ static int decode(AVCodecContext *avctx, void *data, int 
*got_sub, AVPacket *avp
 int ret = 0;
 int i;
 
-if (ctx->pktbuf->size < len) {
-ret = av_buffer_realloc(>pktbuf, len);
- if (ret < 0) {
-av_log(ctx, AV_LOG_WARNING, "Insufficient Memory of %d truncated 
to %d\n", len, ctx->pktbuf->size);
-len = ctx->pktbuf->size;
-ret = 0;
-}
+av_fast_padded_malloc(>pktbuf, >pktbuf_size, len);
+if (!ctx->pktbuf) {
+av_log(ctx, AV_LOG_WARNING, "Insufficient Memory of %d truncated to 
%d\n", len, ctx->pktbuf_size);
+return AVERROR(ENOMEM);
 }
-memcpy(ctx->pktbuf->data, avpkt->data, len);
-bptr = ctx->pktbuf->data;
+memcpy(ctx->pktbuf, avpkt->data, len);
+bptr = ctx->pktbuf;
 
 for (i  = 0; i < len; i += 3) {
 uint8_t cc_type = *(bptr + i) & 3;

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


[FFmpeg-cvslog] swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Sat Sep  3 12:15:24 2016 +0200| [cb8a29f872909aa88f34b1b9b8e4a355af889ee6] | 
committer: Michael Niedermayer

swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices

Signed-off-by: Michael Niedermayer 
(cherry picked from commit e57d99dd4e0d8fe2992da0d65b563580e35ce728)
Signed-off-by: Michael Niedermayer 

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

 libswscale/swscale_unscaled.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 9662a10..b2d1401 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -558,6 +558,8 @@ static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const 
uint8_t *src[],
 int bpc = dst_format->comp[0].depth;
 int alpha = src_format->flags & AV_PIX_FMT_FLAG_ALPHA;
 int swap = 0;
+int i;
+
 if ( HAVE_BIGENDIAN && !(src_format->flags & AV_PIX_FMT_FLAG_BE) ||
 !HAVE_BIGENDIAN &&   src_format->flags & AV_PIX_FMT_FLAG_BE)
 swap++;
@@ -571,6 +573,12 @@ static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const 
uint8_t *src[],
src_format->name, dst_format->name);
 return srcSliceH;
 }
+
+for(i=0; i<4; i++) {
+dst2013[i] += stride2013[i] * srcSliceY / 2;
+dst1023[i] += stride1023[i] * srcSliceY / 2;
+}
+
 switch (c->srcFormat) {
 case AV_PIX_FMT_RGB48LE:
 case AV_PIX_FMT_RGB48BE:

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


[FFmpeg-cvslog] avcodec/avpacket: clear side_data_elems

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Mon Sep 12 13:13:42 2016 +0200| [26a8fc1c00d58652ebcd5809e76eb5fc9b9e2a44] | 
committer: Michael Niedermayer

avcodec/avpacket: clear side_data_elems

Fixes null pointer dereference

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 5e1bf9d8c0d2cdbbf17b06a5dfdf87a635b3203b)
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index b2079f6..6de85de 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -184,6 +184,7 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket 
*src, int dup)
 {
 pkt->data  = NULL;
 pkt->side_data = NULL;
+pkt->side_data_elems = 0;
 if (pkt->buf) {
 AVBufferRef *ref = av_buffer_ref(src->buf);
 if (!ref)
@@ -193,9 +194,11 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket 
*src, int dup)
 } else {
 DUP_DATA(pkt->data, src->data, pkt->size, 1, ALLOC_BUF);
 }
-if (pkt->side_data_elems && dup)
+if (src->side_data_elems && dup) {
 pkt->side_data = src->side_data;
-if (pkt->side_data_elems && !dup) {
+pkt->side_data_elems = src->side_data_elems;
+}
+if (src->side_data_elems && !dup) {
 return av_copy_packet_side_data(pkt, src);
 }
 return 0;

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


[FFmpeg-cvslog] avformat/mov: Fix potential integer overflow in mov_read_keys

2016-09-28 Thread Sergey Volk
ffmpeg | branch: release/3.0 | Sergey Volk  | Wed Sep  7 
14:05:35 2016 -0700| [9259b7f38e008720096532cd4e666a9889f3c578] | committer: 
Michael Niedermayer

avformat/mov: Fix potential integer overflow in mov_read_keys

Actual allocation size is computed as (count + 1)*sizeof(meta_keys), so
we need to check that (count + 1) won't cause overflow.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 347cb14b7cba7560e53f4434b419b9d8800253e7)
Signed-off-by: Michael Niedermayer 

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

 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index bcba9bb..6b90d08 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3149,7 +3149,7 @@ static int mov_read_keys(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 
 avio_skip(pb, 4);
 count = avio_rb32(pb);
-if (count > UINT_MAX / sizeof(*c->meta_keys)) {
+if (count > UINT_MAX / sizeof(*c->meta_keys) - 1) {
 av_log(c->fc, AV_LOG_ERROR,
"The 'keys' atom with the invalid key count: %d\n", count);
 return AVERROR_INVALIDDATA;

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


[FFmpeg-cvslog] swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Fri Sep  2 20:25:24 2016 +0200| [6744d3f6b953884fd092bd6fc460513e7531defe] | 
committer: Michael Niedermayer

swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 47bc1bdafb0950ccf128eaa491d8fd7cc0978813)
Signed-off-by: Michael Niedermayer 

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

 libswscale/swscale_unscaled.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 74f3467..9662a10 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -352,6 +352,7 @@ static int packed_16bpc_bswap(SwsContext *c, const uint8_t 
*src[],
 int min_stride = FFMIN(FFABS(srcstr), FFABS(dststr));
 if(!dstPtr || !srcPtr)
 continue;
+dstPtr += (srcSliceY >> c->chrDstVSubSample) * dststr;
 for (i = 0; i < (srcSliceH >> c->chrDstVSubSample); i++) {
 for (j = 0; j < min_stride; j++) {
 dstPtr[j] = av_bswap16(srcPtr[j]);

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


[FFmpeg-cvslog] avformat/movenc: Check first DTS similar to dts difference

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.0 | Michael Niedermayer  | 
Fri Sep  9 13:11:43 2016 +0200| [b7b3b0086d4e87caa2f8a54d472e20c80ce23369] | 
committer: Michael Niedermayer

avformat/movenc: Check first DTS similar to dts difference

Fixes assertion failure
Fixes: 
b84b53855a0b74560e64c6f45f505a13/signal_sigabrt_76ae7c37_3837_ef4e243ea5b4fa8d0becf4afe9166604.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 68f4c2163ec6d4534ae1756dbcf259845f2e4d2c)
Signed-off-by: Michael Niedermayer 

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

 libavformat/movenc.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b9c0f7a..4e51cdf 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4362,6 +4362,13 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 pkt->dts = trk->cluster[trk->entry - 1].dts + 1;
 pkt->pts = AV_NOPTS_VALUE;
 }
+} else if (pkt->dts <= INT_MIN || pkt->dts >= INT_MAX) {
+av_log(s, AV_LOG_ERROR, "Application provided initial timestamp: 
%"PRId64" is out of range for mov/mp4 format\n",
+pkt->dts
+);
+
+pkt->dts = 0;
+pkt->pts = AV_NOPTS_VALUE;
 }
 if (pkt->duration < 0 || pkt->duration > INT_MAX) {
 av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" is 
invalid\n", pkt->duration);

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


[FFmpeg-cvslog] avconv: initialize output framerate earlier

2016-09-28 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Mon May 23 
16:52:28 2016 +0200| [5fa255b65c7887cc913f097aed1b581fbf1a8745] | committer: 
Anton Khirnov

avconv: initialize output framerate earlier

This will be needed in the following commits.

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

 avconv.c | 34 --
 avconv_opt.c | 42 ++
 2 files changed, 42 insertions(+), 34 deletions(-)

diff --git a/avconv.c b/avconv.c
index d7365f3..74de3ac 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1954,40 +1954,6 @@ static int transcode_init(void)
 enc_ctx->chroma_sample_location = 
dec_ctx->chroma_sample_location;
 }
 
-/*
- * We want CFR output if and only if one of those is true:
- * 1) user specified output framerate with -r
- * 2) user specified -vsync cfr
- * 3) output format is CFR and the user didn't force vsync to
- *something else than CFR
- *
- * in such a case, set ost->frame_rate
- */
-if (enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO &&
-!ost->frame_rate.num && ist &&
-(video_sync_method ==  VSYNC_CFR ||
- (video_sync_method ==  VSYNC_AUTO &&
-  !(oc->oformat->flags & (AVFMT_NOTIMESTAMPS | 
AVFMT_VARIABLE_FPS) {
-if (ist->framerate.num)
-ost->frame_rate = ist->framerate;
-else if (ist->st->avg_frame_rate.num)
-ost->frame_rate = ist->st->avg_frame_rate;
-else {
-av_log(NULL, AV_LOG_WARNING, "Constant framerate requested 
"
-   "for the output stream #%d:%d, but no information "
-   "about the input framerate is available. Falling "
-   "back to a default value of 25fps. Use the -r 
option "
-   "if you want a different framerate.\n",
-   ost->file_index, ost->index);
-ost->frame_rate = (AVRational){ 25, 1 };
-}
-
-if (ost->enc && ost->enc->supported_framerates && 
!ost->force_fps) {
-int idx = av_find_nearest_q_idx(ost->frame_rate, 
ost->enc->supported_framerates);
-ost->frame_rate = ost->enc->supported_framerates[idx];
-}
-}
-
 #if CONFIG_LIBMFX
 if (qsv_transcode_init(ost))
 exit_program(1);
diff --git a/avconv_opt.c b/avconv_opt.c
index eab79f2..2a4f71a 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -1767,6 +1767,48 @@ loop_end:
 }
 }
 }
+
+/*
+ * We want CFR output if and only if one of those is true:
+ * 1) user specified output framerate with -r
+ * 2) user specified -vsync cfr
+ * 3) output format is CFR and the user didn't force vsync to
+ *something else than CFR
+ *
+ * in such a case, set ost->frame_rate
+ */
+if (ost->encoding_needed && ost->enc_ctx->codec_type == 
AVMEDIA_TYPE_VIDEO) {
+int format_cfr = !(oc->oformat->flags & (AVFMT_NOTIMESTAMPS | 
AVFMT_VARIABLE_FPS));
+int need_cfr = !!ost->frame_rate.num;
+
+if (video_sync_method == VSYNC_CFR ||
+(video_sync_method == VSYNC_AUTO && format_cfr))
+need_cfr = 1;
+
+if (need_cfr && !ost->frame_rate.num) {
+InputStream *ist = ost->source_index >= 0 ? 
input_streams[ost->source_index] : NULL;
+
+if (ist && ist->framerate.num)
+ost->frame_rate = ist->framerate;
+else if (ist && ist->st->avg_frame_rate.num)
+ost->frame_rate = ist->st->avg_frame_rate;
+else {
+av_log(NULL, AV_LOG_WARNING, "Constant framerate requested 
"
+   "for the output stream #%d:%d, but no information "
+   "about the input framerate is available. Falling "
+   "back to a default value of 25fps. Use the -r 
option "
+   "if you want a different framerate.\n",
+   ost->file_index, ost->index);
+ost->frame_rate = (AVRational){ 25, 1 };
+}
+}
+
+if (need_cfr && ost->enc->supported_framerates && !ost->force_fps) 
{
+int idx = av_find_nearest_q_idx(ost->frame_rate, 
ost->enc->supported_framerates);
+ost->frame_rate = ost->enc->supported_framerates[idx];
+}
+}
+
 }
 
 /* check filename in case of an image number is expected */

___
ffmpeg-cvslog mailing list

[FFmpeg-cvslog] Merge commit '5fa255b65c7887cc913f097aed1b581fbf1a8745'

2016-09-28 Thread James Almer
ffmpeg | branch: master | James Almer  | Wed Sep 28 12:57:58 
2016 -0300| [df2ae8f3f0a8ce9d9aefa5efb664928a783759ec] | committer: James Almer

Merge commit '5fa255b65c7887cc913f097aed1b581fbf1a8745'

* commit '5fa255b65c7887cc913f097aed1b581fbf1a8745':
  avconv: initialize output framerate earlier

Skipping this for now. It's not needed until several committs ahead,
and should be carefully implemented.

Merged-by: James Almer 

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



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


[FFmpeg-cvslog] avconv: factor out initializing stream parameters for streamcopy

2016-09-28 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Mon May 23 
09:37:10 2016 +0200| [6ed0f70f97c882813199b3bafd724ceeb43659de] | committer: 
Anton Khirnov

avconv: factor out initializing stream parameters for streamcopy

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

 avconv.c | 209 +--
 1 file changed, 110 insertions(+), 99 deletions(-)

diff --git a/avconv.c b/avconv.c
index 74de3ac..385eb2c 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1663,6 +1663,111 @@ static int init_output_bsfs(OutputStream *ost)
 return 0;
 }
 
+static int init_output_stream_streamcopy(OutputStream *ost)
+{
+OutputFile *of = output_files[ost->file_index];
+InputStream *ist = get_input_stream(ost);
+AVCodecParameters *par_dst = ost->st->codecpar;
+AVCodecParameters *par_src = ist->st->codecpar;
+AVRational sar;
+int i;
+uint64_t extra_size;
+
+extra_size = (uint64_t)par_src->extradata_size + 
AV_INPUT_BUFFER_PADDING_SIZE;
+if (extra_size > INT_MAX) {
+return AVERROR(EINVAL);
+}
+
+ost->st->disposition = ist->st->disposition;
+
+/* if stream_copy is selected, no need to decode or encode */
+par_dst->codec_id   = par_src->codec_id;
+par_dst->codec_type = par_src->codec_type;
+
+if (!par_dst->codec_tag) {
+if (!of->ctx->oformat->codec_tag ||
+ av_codec_get_id (of->ctx->oformat->codec_tag, par_src->codec_tag) 
== par_dst->codec_id ||
+ av_codec_get_tag(of->ctx->oformat->codec_tag, par_src->codec_id) 
<= 0)
+par_dst->codec_tag = par_src->codec_tag;
+}
+
+par_dst->bit_rate= par_src->bit_rate;
+par_dst->field_order = par_src->field_order;
+par_dst->chroma_location = par_src->chroma_location;
+
+if (par_src->extradata) {
+par_dst->extradata   = av_mallocz(extra_size);
+if (!par_dst->extradata) {
+return AVERROR(ENOMEM);
+}
+memcpy(par_dst->extradata, par_src->extradata, 
par_src->extradata_size);
+par_dst->extradata_size = par_src->extradata_size;
+}
+
+ost->st->time_base = ist->st->time_base;
+
+if (ist->st->nb_side_data) {
+ost->st->side_data = av_realloc_array(NULL, ist->st->nb_side_data,
+  sizeof(*ist->st->side_data));
+if (!ost->st->side_data)
+return AVERROR(ENOMEM);
+
+for (i = 0; i < ist->st->nb_side_data; i++) {
+const AVPacketSideData *sd_src = >st->side_data[i];
+AVPacketSideData *sd_dst = >st->side_data[i];
+
+sd_dst->data = av_malloc(sd_src->size);
+if (!sd_dst->data)
+return AVERROR(ENOMEM);
+memcpy(sd_dst->data, sd_src->data, sd_src->size);
+sd_dst->size = sd_src->size;
+sd_dst->type = sd_src->type;
+ost->st->nb_side_data++;
+}
+}
+
+ost->parser = av_parser_init(par_dst->codec_id);
+ost->parser_avctx = avcodec_alloc_context3(NULL);
+if (!ost->parser_avctx)
+return AVERROR(ENOMEM);
+
+switch (par_dst->codec_type) {
+case AVMEDIA_TYPE_AUDIO:
+if (audio_volume != 256) {
+av_log(NULL, AV_LOG_FATAL, "-acodec copy and -vol are incompatible 
(frames are not decoded)\n");
+exit_program(1);
+}
+par_dst->channel_layout = par_src->channel_layout;
+par_dst->sample_rate= par_src->sample_rate;
+par_dst->channels   = par_src->channels;
+par_dst->block_align= par_src->block_align;
+break;
+case AVMEDIA_TYPE_VIDEO:
+par_dst->format = par_src->format;
+par_dst->width  = par_src->width;
+par_dst->height = par_src->height;
+if (ost->frame_aspect_ratio)
+sar = av_d2q(ost->frame_aspect_ratio * par_dst->height / 
par_dst->width, 255);
+else if (ist->st->sample_aspect_ratio.num)
+sar = ist->st->sample_aspect_ratio;
+else
+sar = par_src->sample_aspect_ratio;
+ost->st->sample_aspect_ratio = par_dst->sample_aspect_ratio = sar;
+break;
+case AVMEDIA_TYPE_SUBTITLE:
+par_dst->width  = par_src->width;
+par_dst->height = par_src->height;
+break;
+case AVMEDIA_TYPE_DATA:
+case AVMEDIA_TYPE_ATTACHMENT:
+break;
+default:
+abort();
+}
+
+return 0;
+}
+
 static int init_output_stream(OutputStream *ost, char *error, int error_len)
 {
 int ret = 0;
@@ -1735,6 +1840,10 @@ static int init_output_stream(OutputStream *ost, char 
*error, int error_len)
 
 ost->st->time_base = ost->enc_ctx->time_base;
 } else if (ost->stream_copy) {
+ret = init_output_stream_streamcopy(ost);
+if (ret < 0)
+return ret;
+
 /*
  * FIXME: will the codec 

[FFmpeg-cvslog] lavc/8bps: Fix 32bit output of 24bit video.

2016-09-28 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Wed Sep 28 
17:49:39 2016 +0200| [83bf40f3cfcf4b7545e41836b37f21806004f136] | committer: 
Carl Eugen Hoyos

lavc/8bps: Fix 32bit output of 24bit video.

Regression since / partial revert of ba3bb53b

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

 libavcodec/8bps.c| 13 -
 libavcodec/version.h |  2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c
index 46344e0..49fd445 100644
--- a/libavcodec/8bps.c
+++ b/libavcodec/8bps.c
@@ -41,7 +41,7 @@
 
 
 static const enum AVPixelFormat pixfmt_rgb24[] = {
-AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE };
+AV_PIX_FMT_BGR24, AV_PIX_FMT_0RGB32, AV_PIX_FMT_NONE };
 
 typedef struct EightBpsContext {
 AVCodecContext *avctx;
@@ -65,6 +65,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 unsigned int dlen, p, row;
 const unsigned char *lp, *dp, *ep;
 unsigned char count;
+unsigned int px_inc;
 unsigned int planes = c->planes;
 unsigned char *planemap = c->planemap;
 int ret;
@@ -77,6 +78,8 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 /* Set data pointer after line lengths */
 dp = encoded + planes * (height << 1);
 
+px_inc = planes + (avctx->pix_fmt == AV_PIX_FMT_0RGB32);
+
 for (p = 0; p < planes; p++) {
 /* Lines length pointer for this plane */
 lp = encoded + p * (height << 1);
@@ -95,21 +98,21 @@ static int decode_frame(AVCodecContext *avctx, void *data,
 if ((count = *dp++) <= 127) {
 count++;
 dlen -= count + 1;
-if (pixptr_end - pixptr < count * planes)
+if (pixptr_end - pixptr < count * px_inc)
 break;
 if (ep - dp < count)
 return AVERROR_INVALIDDATA;
 while (count--) {
 *pixptr = *dp++;
-pixptr += planes;
+pixptr += px_inc;
 }
 } else {
 count = 257 - count;
-if (pixptr_end - pixptr < count * planes)
+if (pixptr_end - pixptr < count * px_inc)
 break;
 while (count--) {
 *pixptr = *dp;
-pixptr += planes;
+pixptr += px_inc;
 }
 dp++;
 dlen -= 2;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 636c9d6..e7778e9 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  57
 #define LIBAVCODEC_VERSION_MINOR  58
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \

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


[FFmpeg-cvslog] lavf/mpegtsenc: Set min PID for data pkt to 0x0010.

2016-09-28 Thread Sylvain Laurent
ffmpeg | branch: master | Sylvain Laurent  | Sat Sep 24 
12:01:34 2016 +0200| [58776ccbdb4d2e5f07d1d0fe12a1529cffe949c0] | committer: 
Carl Eugen Hoyos

lavf/mpegtsenc: Set min PID for data pkt to 0x0010.

Fixes ticket #1673.

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

 libavformat/mpegtsenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index fd849e5..c10a3bf 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1843,7 +1843,7 @@ static const AVOption options[] = {
   { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM },
 { "mpegts_start_pid", "Set the first pid.",
   offsetof(MpegTSWrite, start_pid), AV_OPT_TYPE_INT,
-  { .i64 = 0x0100 }, 0x0020, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
+  { .i64 = 0x0100 }, 0x0010, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
 { "mpegts_m2ts_mode", "Enable m2ts mode.",
   offsetof(MpegTSWrite, m2ts_mode), AV_OPT_TYPE_BOOL,
   { .i64 = -1 }, -1, 1, AV_OPT_FLAG_ENCODING_PARAM },

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


[FFmpeg-cvslog] avcodec/nvenc: nicely align AVOptions

2016-09-28 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Wed Sep 
28 16:08:09 2016 +0200| [c03b9d6a62db4e45119e1170e83f26df1fba36df] | committer: 
Timo Rothenpieler

avcodec/nvenc: nicely align AVOptions

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

 libavcodec/nvenc_h264.c | 146 ++--
 libavcodec/nvenc_hevc.c | 139 -
 2 files changed, 154 insertions(+), 131 deletions(-)

diff --git a/libavcodec/nvenc_h264.c b/libavcodec/nvenc_h264.c
index 788cf69..2d7f2d1 100644
--- a/libavcodec/nvenc_h264.c
+++ b/libavcodec/nvenc_h264.c
@@ -26,73 +26,85 @@
 #define OFFSET(x) offsetof(NvencContext, x)
 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
-{ "preset",   "Set the encoding preset",  OFFSET(preset),  
AV_OPT_TYPE_INT,{ .i64 = PRESET_MEDIUM }, PRESET_DEFAULT, 
PRESET_LOSSLESS_HP, VE, "preset" },
-{ "default","",   0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_DEFAULT }, 0, 0, VE, "preset" },
-{ "slow",   "hq 2 passes",0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_SLOW }, 0, 0, VE, "preset" },
-{ "medium", "hq 1 pass",  0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_MEDIUM }, 0, 0, VE, "preset" },
-{ "fast",   "hp 1 pass",  0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_FAST }, 0, 0, VE, "preset" },
-{ "hp", "",   0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_HP }, 0, 0, VE, "preset" },
-{ "hq", "",   0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_HQ }, 0, 0, VE, "preset" },
-{ "bd", "",   0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_BD }, 0, 0, VE, "preset" },
-{ "ll", "low latency",0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_LOW_LATENCY_DEFAULT }, 0, 0, VE, "preset" },
-{ "llhq",   "low latency hq", 0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_LOW_LATENCY_HQ }, 0, 0, VE, "preset" },
-{ "llhp",   "low latency hp", 0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_LOW_LATENCY_HP }, 0, 0, VE, "preset" },
-{ "lossless",   NULL, 0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_LOSSLESS_DEFAULT }, 0, 0, VE, "preset" },
-{ "losslesshp", NULL, 0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_LOSSLESS_HP }, 0, 0, VE, "preset" },
-{ "profile",  "Set the encoding profile", OFFSET(profile), 
AV_OPT_TYPE_INT,{ .i64 = NV_ENC_H264_PROFILE_MAIN }, 
NV_ENC_H264_PROFILE_BASELINE, NV_ENC_H264_PROFILE_HIGH_444P, VE, "profile" },
-{ "baseline", "", 0,   
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_H264_PROFILE_BASELINE },0, 0, 
VE, "profile" },
-{ "main", "", 0,   
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_H264_PROFILE_MAIN },0, 0, 
VE, "profile" },
-{ "high", "", 0,   
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_H264_PROFILE_HIGH },0, 0, 
VE, "profile" },
-{ "high444p", "", 0,   
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_H264_PROFILE_HIGH_444P },0, 0, 
VE, "profile" },
-{ "level", "Set the encoding level restriction", OFFSET(level), 
AV_OPT_TYPE_INT, { .i64 = NV_ENC_LEVEL_AUTOSELECT }, NV_ENC_LEVEL_AUTOSELECT, 
NV_ENC_LEVEL_H264_51, VE, "level" },
-{ "auto", "", 0,   
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_LEVEL_AUTOSELECT },  0, 0, VE,  "level" },
-{ "1","", 0,   
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_LEVEL_H264_1 },  0, 0, VE,  "level" },
-{ "1.0",  "", 0,   
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_LEVEL_H264_1 },  0, 0, VE,  "level" },
-{ "1b",   "", 0,   
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_LEVEL_H264_1b }, 0, 0, VE,  "level" },
-{ "1.0b", "", 0,   
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_LEVEL_H264_1b }, 0, 0, VE,  "level" },
-{ "1.1",  "", 0,   
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_LEVEL_H264_11 }, 0, 0, VE,  "level" },
-{ "1.2",  "", 0,   

[FFmpeg-cvslog] avcodec/nvenc: Extended rate-control support as provided by SDK 7

2016-09-28 Thread Yogender Gupta
ffmpeg | branch: master | Yogender Gupta  | Sat Sep 24 
17:55:00 2016 +0200| [facc19ef06a753515a3fa604269dd1aa412dc08f] | committer: 
Timo Rothenpieler

avcodec/nvenc: Extended rate-control support as provided by SDK 7

Merged from libav commit by Yogender Gupta:
https://git.libav.org/?p=libav.git;a=commitdiff;h=70de2ea4261f860457a04e3d0c58c5543f403325

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

 libavcodec/nvenc.c  | 46 +++---
 libavcodec/nvenc.h  |  9 +
 libavcodec/nvenc_h264.c |  9 +
 libavcodec/nvenc_hevc.c |  7 +++
 libavcodec/version.h|  2 +-
 5 files changed, 69 insertions(+), 4 deletions(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 421ea79..f6f756f 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -724,10 +724,50 @@ static av_cold void 
nvenc_setup_rate_control(AVCodecContext *avctx)
 ctx->encode_config.rcParams.vbvBufferSize = 2 * 
ctx->encode_config.rcParams.averageBitRate;
 }
 
-if (ctx->rc_lookahead > 0) {
-ctx->encode_config.rcParams.enableLookahead = 1;
-ctx->encode_config.rcParams.lookaheadDepth = FFMIN(ctx->rc_lookahead, 
32);
+if (ctx->aq) {
+ctx->encode_config.rcParams.enableAQ   = 1;
+ctx->encode_config.rcParams.aqStrength = ctx->aq_strength;
+av_log(avctx, AV_LOG_VERBOSE, "AQ enabled.\n");
 }
+
+if (ctx->temporal_aq) {
+ctx->encode_config.rcParams.enableTemporalAQ = 1;
+av_log(avctx, AV_LOG_VERBOSE, "Temporal AQ enabled.\n");
+}
+
+if (ctx->rc_lookahead) {
+int lkd_bound = FFMIN(ctx->nb_surfaces, ctx->async_depth) -
+ctx->encode_config.frameIntervalP - 4;
+
+if (lkd_bound < 0) {
+av_log(avctx, AV_LOG_WARNING,
+   "Lookahead not enabled. Increase buffer delay (-delay).\n");
+} else {
+ctx->encode_config.rcParams.enableLookahead = 1;
+ctx->encode_config.rcParams.lookaheadDepth  = 
av_clip(ctx->rc_lookahead, 0, lkd_bound);
+ctx->encode_config.rcParams.disableIadapt   = ctx->no_scenecut;
+ctx->encode_config.rcParams.disableBadapt   = !ctx->b_adapt;
+av_log(avctx, AV_LOG_VERBOSE,
+   "Lookahead enabled: depth %d, scenecut %s, B-adapt %s.\n",
+   ctx->encode_config.rcParams.lookaheadDepth,
+   ctx->encode_config.rcParams.disableIadapt ? "disabled" : 
"enabled",
+   ctx->encode_config.rcParams.disableBadapt ? "disabled" : 
"enabled");
+}
+}
+
+if (ctx->strict_gop) {
+ctx->encode_config.rcParams.strictGOPTarget = 1;
+av_log(avctx, AV_LOG_VERBOSE, "Strict GOP target enabled.\n");
+}
+
+if (ctx->nonref_p)
+ctx->encode_config.rcParams.enableNonRefP = 1;
+
+if (ctx->zerolatency)
+ctx->encode_config.rcParams.zeroReorderDelay = 1;
+
+if (ctx->quality)
+ctx->encode_config.rcParams.targetQuality = ctx->quality;
 }
 
 static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index efc2a7a..648d1dc 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -183,6 +183,15 @@ typedef struct NvencContext
 int flags;
 int async_depth;
 int rc_lookahead;
+int aq;
+int no_scenecut;
+int b_adapt;
+int temporal_aq;
+int zerolatency;
+int nonref_p;
+int strict_gop;
+int aq_strength;
+int quality;
 } NvencContext;
 
 int ff_nvenc_encode_init(AVCodecContext *avctx);
diff --git a/libavcodec/nvenc_h264.c b/libavcodec/nvenc_h264.c
index 4ef9836..788cf69 100644
--- a/libavcodec/nvenc_h264.c
+++ b/libavcodec/nvenc_h264.c
@@ -84,6 +84,15 @@ static const AVOption options[] = {
 { "any",  "Pick the first device available",  0,   
AV_OPT_TYPE_CONST,  { .i64 = ANY_DEVICE },   0, 0, VE, "gpu" },
 { "list", "List the available devices",   0,   
AV_OPT_TYPE_CONST,  { .i64 = LIST_DEVICES }, 0, 0, VE, "gpu" },
 { "delay","Delay frame output by the given amount of frames", 
OFFSET(async_depth), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 0, INT_MAX, VE },
+{ "no-scenecut", "When lookahead is enabled, set this to 1 to disable 
adaptive I-frame insertion at scene cuts", OFFSET(no_scenecut), 
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
+{ "b_adapt", "When lookahead is enabled, set this to 0 to disable adaptive 
B-frame decision", OFFSET(b_adapt), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
+{ "spatial-aq", "set to 1 to enable Spatial AQ", OFFSET(aq), 
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
+{ "temporal-aq", "set to 1 to enable Temporal AQ", 
OFFSET(temporal_aq),  AV_OPT_TYPE_INT,   { .i64 = 0   }, 0, 
1, VE},
+{ "zerolatency", "Set 1 to indicate zero latency 

[FFmpeg-cvslog] avcodec/nvenc: add HEVC REXT profile

2016-09-28 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Wed Sep 
28 14:21:03 2016 +0200| [033f98c902f5b556a01be27d2cb5cff93bda92f3] | committer: 
Timo Rothenpieler

avcodec/nvenc: add HEVC REXT profile

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

 libavcodec/nvenc.c  | 10 ++
 libavcodec/nvenc.h  |  1 +
 libavcodec/nvenc_hevc.c |  3 ++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index ecc1c4f..421ea79 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -864,6 +864,10 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext 
*avctx)
 cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID;
 avctx->profile = FF_PROFILE_HEVC_MAIN_10;
 break;
+case NV_ENC_HEVC_PROFILE_REXT:
+cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID;
+avctx->profile = FF_PROFILE_HEVC_REXT;
+break;
 }
 
 // force setting profile as main10 if input is 10 bit
@@ -872,6 +876,12 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext 
*avctx)
 avctx->profile = FF_PROFILE_HEVC_MAIN_10;
 }
 
+// force setting profile as rext if input is yuv444
+if (IS_YUV444(ctx->data_pix_fmt)) {
+cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID;
+avctx->profile = FF_PROFILE_HEVC_REXT;
+}
+
 hevc->chromaFormatIDC = IS_YUV444(ctx->data_pix_fmt) ? 3 : 1;
 
 hevc->pixelBitDepthMinus8 = IS_10BIT(ctx->data_pix_fmt) ? 2 : 0;
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index 521902c..efc2a7a 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -121,6 +121,7 @@ enum {
 enum {
 NV_ENC_HEVC_PROFILE_MAIN,
 NV_ENC_HEVC_PROFILE_MAIN_10,
+NV_ENC_HEVC_PROFILE_REXT,
 };
 
 enum {
diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index e875772..9e94a43 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -39,9 +39,10 @@ static const AVOption options[] = {
 { "llhp",   "low latency hp", 0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_LOW_LATENCY_HP }, 0, 0, VE, "preset" },
 { "lossless",   "lossless",   0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_LOSSLESS_DEFAULT }, 0, 0, VE, "preset" },
 { "losslesshp", "lossless hp",0,   
AV_OPT_TYPE_CONST,  { .i64 = PRESET_LOSSLESS_HP }, 0, 0, VE, "preset" },
-{ "profile", "Set the encoding profile", OFFSET(profile),  
AV_OPT_TYPE_INT,{ .i64 = NV_ENC_HEVC_PROFILE_MAIN }, 
NV_ENC_HEVC_PROFILE_MAIN, FF_PROFILE_HEVC_MAIN_10, VE, "profile" },
+{ "profile", "Set the encoding profile", OFFSET(profile),  
AV_OPT_TYPE_INT,{ .i64 = NV_ENC_HEVC_PROFILE_MAIN }, 
NV_ENC_HEVC_PROFILE_MAIN, FF_PROFILE_HEVC_REXT, VE, "profile" },
 { "main","", 0,
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, 0, 0, VE, "profile" },
 { "main10",  "", 0,
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_HEVC_PROFILE_MAIN_10 }, 0, 0, VE, "profile" 
},
+{ "rext","", 0,
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_HEVC_PROFILE_REXT }, 0, 0, VE, "profile" },
 { "level",   "Set the encoding level restriction",   OFFSET(level),
AV_OPT_TYPE_INT,{ .i64 = NV_ENC_LEVEL_AUTOSELECT }, 
NV_ENC_LEVEL_AUTOSELECT, NV_ENC_LEVEL_HEVC_62, VE, "level" },
 { "auto","", 0,
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_LEVEL_AUTOSELECT },  0, 0, VE,  "level" },
 { "1",   "", 0,
AV_OPT_TYPE_CONST,  { .i64 = NV_ENC_LEVEL_HEVC_1 },  0, 0, VE,  "level" },

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


[FFmpeg-cvslog] avcodec/nvenc: Make sure that enum and array index match

2016-09-28 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Wed Sep 
28 13:52:47 2016 +0200| [a81b000a392e5c7119d2eddb3f4c90ab9f1e0554] | committer: 
Timo Rothenpieler

avcodec/nvenc: Make sure that enum and array index match

Based on libav commits by Luca Barbato and Yogender Gupta:
https://git.libav.org/?p=libav.git;a=commit;h=352741b5ead1543d775ccf6040f33023e4491186
https://git.libav.org/?p=libav.git;a=commit;h=e02e2515b24bfc37ede6ca1744696230be55e50b

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

 libavcodec/nvenc.c | 32 
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index fc5253a..ecc1c4f 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -525,21 +525,26 @@ typedef struct GUIDTuple {
 int flags;
 } GUIDTuple;
 
+#define PRESET_ALIAS(alias, name, ...) \
+[PRESET_ ## alias] = { NV_ENC_PRESET_ ## name ## _GUID, __VA_ARGS__ }
+
+#define PRESET(name, ...) PRESET_ALIAS(name, name, __VA_ARGS__)
+
 static void nvenc_map_preset(NvencContext *ctx)
 {
 GUIDTuple presets[] = {
-{ NV_ENC_PRESET_DEFAULT_GUID },
-{ NV_ENC_PRESET_HQ_GUID,  NVENC_TWO_PASSES }, /* slow 
*/
-{ NV_ENC_PRESET_HQ_GUID,  NVENC_ONE_PASS }, /* medium 
*/
-{ NV_ENC_PRESET_HP_GUID,  NVENC_ONE_PASS }, /* fast */
-{ NV_ENC_PRESET_HP_GUID },
-{ NV_ENC_PRESET_HQ_GUID },
-{ NV_ENC_PRESET_BD_GUID },
-{ NV_ENC_PRESET_LOW_LATENCY_DEFAULT_GUID, NVENC_LOWLATENCY },
-{ NV_ENC_PRESET_LOW_LATENCY_HQ_GUID,  NVENC_LOWLATENCY },
-{ NV_ENC_PRESET_LOW_LATENCY_HP_GUID,  NVENC_LOWLATENCY },
-{ NV_ENC_PRESET_LOSSLESS_DEFAULT_GUID,NVENC_LOSSLESS },
-{ NV_ENC_PRESET_LOSSLESS_HP_GUID, NVENC_LOSSLESS },
+PRESET(DEFAULT),
+PRESET(HP),
+PRESET(HQ),
+PRESET(BD),
+PRESET_ALIAS(SLOW,   HQ,NVENC_TWO_PASSES),
+PRESET_ALIAS(MEDIUM, HQ,NVENC_ONE_PASS),
+PRESET_ALIAS(FAST,   HP,NVENC_ONE_PASS),
+PRESET(LOW_LATENCY_DEFAULT, NVENC_LOWLATENCY),
+PRESET(LOW_LATENCY_HP,  NVENC_LOWLATENCY),
+PRESET(LOW_LATENCY_HQ,  NVENC_LOWLATENCY),
+PRESET(LOSSLESS_DEFAULT,NVENC_LOSSLESS),
+PRESET(LOSSLESS_HP, NVENC_LOSSLESS),
 };
 
 GUIDTuple *t = [ctx->preset];
@@ -548,6 +553,9 @@ static void nvenc_map_preset(NvencContext *ctx)
 ctx->flags = t->flags;
 }
 
+#undef PRESET
+#undef PRESET_ALIAS
+
 static av_cold void set_constqp(AVCodecContext *avctx)
 {
 NvencContext *ctx = avctx->priv_data;

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


[FFmpeg-cvslog] avformat/avidec: Check nb_streams in read_gab2_sub()

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Sep 28 16:14:08 2016 +0200| [2679ad4773aa356e7c3da5c68bc81f02a194617f] | 
committer: Michael Niedermayer

avformat/avidec: Check nb_streams in read_gab2_sub()

Fixes null pointer dereference
Fixes: 1/null_point.avi

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 

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

 libavformat/avidec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 96edfa8..2c81267 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1101,6 +1101,8 @@ static int read_gab2_sub(AVFormatContext *s, AVStream 
*st, AVPacket *pkt)
 goto error;
 
 if (!avformat_open_input(>sub_ctx, "", sub_demuxer, NULL)) {
+if (ast->sub_ctx->nb_streams != 1)
+goto error;
 ff_read_packet(ast->sub_ctx, >sub_pkt);
 avcodec_parameters_copy(st->codecpar, 
ast->sub_ctx->streams[0]->codecpar);
 time_base = ast->sub_ctx->streams[0]->time_base;

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


[FFmpeg-cvslog] avformat/avidec: Remove ancient assert

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Sep 28 15:47:12 2016 +0200| [14bac7e00d72eac687612d9b125e585011a56d4f] | 
committer: Michael Niedermayer

avformat/avidec: Remove ancient assert

This assert can with crafted files fail, a warning is already printed
for this case.

Fixes assertion failure
Fixes:1/assert.avi

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 

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

 libavformat/avidec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 1e8481e..96edfa8 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1857,7 +1857,6 @@ static int avi_read_seek(AVFormatContext *s, int 
stream_index,
 continue;
 
 //av_assert1(st2->codecpar->block_align);
-av_assert0(fabs(av_q2d(st2->time_base) - ast2->scale / 
(double)ast2->rate) < av_q2d(st2->time_base) * 0.0001);
 index = av_index_search_timestamp(st2,
   av_rescale_q(timestamp,
st->time_base,

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


[FFmpeg-cvslog] lavc/mediacodecdec_h264: fix SODB escaping

2016-09-28 Thread Matthieu Bouron
ffmpeg | branch: release/3.1 | Matthieu Bouron  
| Tue Sep  6 16:30:07 2016 +0200| [d0590d93493a3b854e4e2755f0637099ef551b98] | 
committer: Matthieu Bouron

lavc/mediacodecdec_h264: fix SODB escaping

Fixes escaping of consecutive 0x00, 0x00, 0x0{0-3} sequences.

(cherry picked from commit f574012d5fe922684a5befa16828f22fe9a83ce8)

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

 libavcodec/mediacodecdec_h264.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mediacodecdec_h264.c b/libavcodec/mediacodecdec_h264.c
index 11fb677..f663267 100644
--- a/libavcodec/mediacodecdec_h264.c
+++ b/libavcodec/mediacodecdec_h264.c
@@ -103,9 +103,9 @@ static int h264_ps_to_nalu(const uint8_t *src, int 
src_size, uint8_t **out, int
 }
 *out = p = new;
 
-i = i + 3;
-memmove(p + i, p + i - 1, *out_size - i);
-p[i - 1] = 0x03;
+i = i + 2;
+memmove(p + i + 1, p + i, *out_size - (i + 1));
+p[i] = 0x03;
 }
 }
 done:

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


[FFmpeg-cvslog] avcodec/nvenc: fix const options for hevc gpu setting

2016-09-28 Thread Timo Rothenpieler
ffmpeg | branch: release/3.1 | Timo Rothenpieler  | Wed 
Sep 28 16:10:49 2016 +0200| [e60a00e0cc48930867cc6a9224d406a026f7c081] | 
committer: Timo Rothenpieler

avcodec/nvenc: fix const options for hevc gpu setting

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

 libavcodec/nvenc_hevc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index 1ce7c89..17a0c2d 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -76,7 +76,7 @@ static const AVOption options[] = {
 { "surfaces", "Number of concurrent surfaces",OFFSET(nb_surfaces), 
AV_OPT_TYPE_INT,{ .i64 = 32 },   0, INT_MAX, VE },
 { "cbr", "Use cbr encoding mode", OFFSET(cbr), AV_OPT_TYPE_BOOL, { .i64 = 
0 }, 0, 1, VE },
 { "2pass", "Use 2pass encoding mode", OFFSET(twopass), AV_OPT_TYPE_BOOL, { 
.i64 = -1 }, -1, 1, VE },
-{ "gpu", "Selects which NVENC capable GPU to use. First GPU is 0, second 
is 1, and so on.", OFFSET(device), AV_OPT_TYPE_INT, { .i64 = ANY_DEVICE }, -2, 
INT_MAX, VE },
+{ "gpu", "Selects which NVENC capable GPU to use. First GPU is 0, second 
is 1, and so on.", OFFSET(device), AV_OPT_TYPE_INT, { .i64 = ANY_DEVICE }, -2, 
INT_MAX, VE, "device" },
 { "any",  "Pick the first device available",  0,   
AV_OPT_TYPE_CONST,  { .i64 = ANY_DEVICE },   0, 0, VE, "device" },
 { "list", "List the available devices",   0,   
AV_OPT_TYPE_CONST,  { .i64 = LIST_DEVICES }, 0, 0, VE, "device" },
 { "delay","Delay frame output by the given amount of frames", 
OFFSET(async_depth), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 0, INT_MAX, VE },

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


[FFmpeg-cvslog] lavc/movtextdec.c: Avoid infinite loop on invalid data.

2016-09-28 Thread Sasi Inguva
ffmpeg | branch: release/3.1 | Sasi Inguva  | 
Tue Sep 27 19:23:20 2016 -0700| [39dc26f0c104fb601fbe4fb0e66c3aa4341f3cb7] | 
committer: Michael Niedermayer

lavc/movtextdec.c: Avoid infinite loop on invalid data.

Signed-off-by: Sasi Inguva 
(cherry picked from commit 7e9e1b7070242a79fa6e3acd749d7fe76e39ea7b)
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index abf8711..a33fff7 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -471,6 +471,10 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
 tsmb_type = AV_RB32(tsmb);
 tsmb += 4;
 
+if (tsmb_size == 0) {
+  return AVERROR_INVALIDDATA;
+}
+
 if (tsmb_size == 1) {
 if (m->tracksize + 16 > avpkt->size)
 break;

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


[FFmpeg-cvslog] avformat/utils: fix timebase error in avformat_seek_file()

2016-09-28 Thread Xinzheng Zhang
ffmpeg | branch: release/3.1 | Xinzheng Zhang  | Wed Sep 
14 16:13:45 2016 +0800| [c68ce48260cf374480439b8f0d658f02fe9932d4] | committer: 
Michael Niedermayer

avformat/utils: fix timebase error in avformat_seek_file()

When there is only one stream and stream_index has not specified,
The ts has been transferd by the timebase of stream0 without modifying the 
stream_index
In this condation it cause seek failure.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit ecc04b4f2f29ac676e6c1d1ebf20ec45f5385f1e)
Signed-off-by: Michael Niedermayer 

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

 libavformat/utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 1711bef..5be1e86 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2414,6 +2414,7 @@ int avformat_seek_file(AVFormatContext *s, int 
stream_index, int64_t min_ts,
 max_ts = av_rescale_rnd(max_ts, time_base.den,
 time_base.num * (int64_t)AV_TIME_BASE,
 AV_ROUND_DOWN | AV_ROUND_PASS_MINMAX);
+stream_index = 0;
 }
 
 ret = s->iformat->read_seek2(s, stream_index, min_ts,

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


[FFmpeg-cvslog] avformat/movenc: Check packet in mov_write_single_packet() too

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Thu Sep 15 23:52:54 2016 +0200| [77c9c350930907b5201576573a70ffb8aaaec60f] | 
committer: Michael Niedermayer

avformat/movenc: Check packet in mov_write_single_packet() too

Fixes assertion failure

Found-by: durandal117
Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 28343139330f557e00293933a4697c7d0fc19c56)
Signed-off-by: Michael Niedermayer 

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

 libavformat/movenc.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 917fdaf..a283231 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4901,6 +4901,10 @@ static int mov_write_single_packet(AVFormatContext *s, 
AVPacket *pkt)
 int64_t frag_duration = 0;
 int size = pkt->size;
 
+int ret = check_pkt(s, pkt);
+if (ret < 0)
+return ret;
+
 if (mov->flags & FF_MOV_FLAG_FRAG_DISCONT) {
 int i;
 for (i = 0; i < s->nb_streams; i++)

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


[FFmpeg-cvslog] avcodec/ccaption_dec: Use simple array instead of AVBuffer

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Fri Sep  9 10:26:15 2016 +0200| [65c10f0f5c5212f903feb30a5f65700caa6f0b2e] | 
committer: Michael Niedermayer

avcodec/ccaption_dec: Use simple array instead of AVBuffer

This is simpler and fixes an out of array read, fixing it with AVBuffers
would be more complex

Fixes: 
e00d9e6e50e5495cc93fea41147b97bb/asan_heap-oob_12dcdbb_8798_b32a97ea722dd37bb5066812cc674552.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 752e6dfa3ea97e7901870bdd9e5a51f860607240)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/ccaption_dec.c | 27 +++
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 3b15149..360c687 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -247,7 +247,8 @@ typedef struct CCaptionSubContext {
 int64_t last_real_time;
 char prev_cmd[2];
 /* buffer to store pkt data */
-AVBufferRef *pktbuf;
+uint8_t *pktbuf;
+int pktbuf_size;
 int readorder;
 } CCaptionSubContext;
 
@@ -273,11 +274,7 @@ static av_cold int init_decoder(AVCodecContext *avctx)
 if (ret < 0) {
 return ret;
 }
-/* allocate pkt buffer */
-ctx->pktbuf = av_buffer_alloc(128);
-if (!ctx->pktbuf) {
-ret = AVERROR(ENOMEM);
-}
+
 return ret;
 }
 
@@ -285,7 +282,8 @@ static av_cold int close_decoder(AVCodecContext *avctx)
 {
 CCaptionSubContext *ctx = avctx->priv_data;
 av_bprint_finalize(>buffer, NULL);
-av_buffer_unref(>pktbuf);
+av_freep(>pktbuf);
+ctx->pktbuf_size = 0;
 return 0;
 }
 
@@ -729,16 +727,13 @@ static int decode(AVCodecContext *avctx, void *data, int 
*got_sub, AVPacket *avp
 int ret = 0;
 int i;
 
-if (ctx->pktbuf->size < len) {
-ret = av_buffer_realloc(>pktbuf, len);
- if (ret < 0) {
-av_log(ctx, AV_LOG_WARNING, "Insufficient Memory of %d truncated 
to %d\n", len, ctx->pktbuf->size);
-len = ctx->pktbuf->size;
-ret = 0;
-}
+av_fast_padded_malloc(>pktbuf, >pktbuf_size, len);
+if (!ctx->pktbuf) {
+av_log(ctx, AV_LOG_WARNING, "Insufficient Memory of %d truncated to 
%d\n", len, ctx->pktbuf_size);
+return AVERROR(ENOMEM);
 }
-memcpy(ctx->pktbuf->data, avpkt->data, len);
-bptr = ctx->pktbuf->data;
+memcpy(ctx->pktbuf, avpkt->data, len);
+bptr = ctx->pktbuf;
 
 for (i  = 0; i < len; i += 3) {
 uint8_t cc_type = *(bptr + i) & 3;

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


[FFmpeg-cvslog] swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Fri Sep  2 20:25:24 2016 +0200| [5aaf7e31829d624803af4290120bc0fd4c34edd8] | 
committer: Michael Niedermayer

swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 47bc1bdafb0950ccf128eaa491d8fd7cc0978813)
Signed-off-by: Michael Niedermayer 

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

 libswscale/swscale_unscaled.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index b231abe..8df0694 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -352,6 +352,7 @@ static int packed_16bpc_bswap(SwsContext *c, const uint8_t 
*src[],
 int min_stride = FFMIN(FFABS(srcstr), FFABS(dststr));
 if(!dstPtr || !srcPtr)
 continue;
+dstPtr += (srcSliceY >> c->chrDstVSubSample) * dststr;
 for (i = 0; i < (srcSliceH >> c->chrDstVSubSample); i++) {
 for (j = 0; j < min_stride; j++) {
 dstPtr[j] = av_bswap16(srcPtr[j]);

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


[FFmpeg-cvslog] avformat/mov: Fix potential integer overflow in mov_read_keys

2016-09-28 Thread Sergey Volk
ffmpeg | branch: release/3.1 | Sergey Volk  | Wed Sep  7 
14:05:35 2016 -0700| [7a3dc2f7b6c2fbe62aeed7839e736db395a6f76a] | committer: 
Michael Niedermayer

avformat/mov: Fix potential integer overflow in mov_read_keys

Actual allocation size is computed as (count + 1)*sizeof(meta_keys), so
we need to check that (count + 1) won't cause overflow.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 347cb14b7cba7560e53f4434b419b9d8800253e7)
Signed-off-by: Michael Niedermayer 

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

 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7266fd0..dd746b4 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3243,7 +3243,7 @@ static int mov_read_keys(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 
 avio_skip(pb, 4);
 count = avio_rb32(pb);
-if (count > UINT_MAX / sizeof(*c->meta_keys)) {
+if (count > UINT_MAX / sizeof(*c->meta_keys) - 1) {
 av_log(c->fc, AV_LOG_ERROR,
"The 'keys' atom with the invalid key count: %d\n", count);
 return AVERROR_INVALIDDATA;

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


[FFmpeg-cvslog] avcodec/svq3: Reintroduce slice_type

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Thu Sep  8 21:15:55 2016 +0200| [ed1c6f701a7861c77e89530d081e87da6fb3d3a7] | 
committer: Michael Niedermayer

avcodec/svq3: Reintroduce slice_type

Fixes out of array read
Fixes: 
1642cd3962249d6aaf0eec2836023fb6/signal_sigsegv_2557a72_2995_04efaf2ff57a052f609a3b4a2ea4e622.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 2d3099ad8ee67a4612633ea02c7fce10e5537579)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/svq3.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 5e7d164..8c176f6 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -102,6 +102,7 @@ typedef struct SVQ3Context {
 int prev_frame_num;
 
 enum AVPictureType pict_type;
+enum AVPictureType slice_type;
 int low_delay;
 
 int mb_x, mb_y;
@@ -1057,7 +1058,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
 return -1;
 }
 
-s->pict_type = ff_h264_golomb_to_pict_type[slice_id];
+s->slice_type = ff_h264_golomb_to_pict_type[slice_id];
 
 if ((header & 0x9F) == 2) {
 i = (s->mb_num < 64) ? 6 : (1 + av_log2(s->mb_num - 1));
@@ -1426,6 +1427,8 @@ static int svq3_decode_frame(AVCodecContext *avctx, void 
*data,
 if (svq3_decode_slice_header(avctx))
 return -1;
 
+s->pict_type = s->slice_type;
+
 if (s->pict_type != AV_PICTURE_TYPE_B)
 FFSWAP(H264Picture*, s->next_pic, s->last_pic);
 
@@ -1539,6 +1542,9 @@ static int svq3_decode_frame(AVCodecContext *avctx, void 
*data,
 if (svq3_decode_slice_header(avctx))
 return -1;
 }
+if (s->slice_type != s->pict_type) {
+avpriv_request_sample(avctx, "non constant slice type\n");
+}
 /* TODO: support s->mb_skip_run */
 }
 

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


[FFmpeg-cvslog] avcodec/g726: Add missing ADDB output mask

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Wed Sep 14 13:06:53 2016 +0200| [ac8ac46641adef208485baebc3734463bf0bd266] | 
committer: Michael Niedermayer

avcodec/g726: Add missing ADDB output mask

Fixes: 1.poc
Fixes out of array read

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit a5af1240fce845f645440364c1335e0f8e44ee6c)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/g726.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index c7d138e..ca7f856 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -206,7 +206,7 @@ static int16_t g726_decode(G726Context* c, int I)
 
 if (I_sig)  /* get the sign */
 dq = -dq;
-re_signal = c->se + dq;
+re_signal = (int16_t)(c->se + dq);
 
 /* Update second order predictor coefficient A2 and A1 */
 pk0 = (c->sez + dq) ? sgn(c->sez + dq) : 0;

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


[FFmpeg-cvslog] avformat/movenc: Check first DTS similar to dts difference

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Fri Sep  9 13:11:43 2016 +0200| [21a979773783bb4e1baa2597150f25151328c93f] | 
committer: Michael Niedermayer

avformat/movenc: Check first DTS similar to dts difference

Fixes assertion failure
Fixes: 
b84b53855a0b74560e64c6f45f505a13/signal_sigabrt_76ae7c37_3837_ef4e243ea5b4fa8d0becf4afe9166604.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 68f4c2163ec6d4534ae1756dbcf259845f2e4d2c)
Signed-off-by: Michael Niedermayer 

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

 libavformat/movenc.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index d614933..788ab3c 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4612,6 +4612,13 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 pkt->dts = trk->cluster[trk->entry - 1].dts + 1;
 pkt->pts = AV_NOPTS_VALUE;
 }
+} else if (pkt->dts <= INT_MIN || pkt->dts >= INT_MAX) {
+av_log(s, AV_LOG_ERROR, "Application provided initial timestamp: 
%"PRId64" is out of range for mov/mp4 format\n",
+pkt->dts
+);
+
+pkt->dts = 0;
+pkt->pts = AV_NOPTS_VALUE;
 }
 if (pkt->duration < 0 || pkt->duration > INT_MAX) {
 av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" is 
invalid\n", pkt->duration);

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


[FFmpeg-cvslog] swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Sat Sep  3 12:15:24 2016 +0200| [e91b7852dfae807b1996c30ec77e5bd7eb3a01a1] | 
committer: Michael Niedermayer

swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices

Signed-off-by: Michael Niedermayer 
(cherry picked from commit e57d99dd4e0d8fe2992da0d65b563580e35ce728)
Signed-off-by: Michael Niedermayer 

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

 libswscale/swscale_unscaled.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 8df0694..1f99462 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -558,6 +558,8 @@ static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const 
uint8_t *src[],
 int bpc = dst_format->comp[0].depth;
 int alpha = src_format->flags & AV_PIX_FMT_FLAG_ALPHA;
 int swap = 0;
+int i;
+
 if ( HAVE_BIGENDIAN && !(src_format->flags & AV_PIX_FMT_FLAG_BE) ||
 !HAVE_BIGENDIAN &&   src_format->flags & AV_PIX_FMT_FLAG_BE)
 swap++;
@@ -571,6 +573,12 @@ static int Rgb16ToPlanarRgb16Wrapper(SwsContext *c, const 
uint8_t *src[],
src_format->name, dst_format->name);
 return srcSliceH;
 }
+
+for(i=0; i<4; i++) {
+dst2013[i] += stride2013[i] * srcSliceY / 2;
+dst1023[i] += stride1023[i] * srcSliceY / 2;
+}
+
 switch (c->srcFormat) {
 case AV_PIX_FMT_RGB48LE:
 case AV_PIX_FMT_RGB48BE:

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


[FFmpeg-cvslog] avformat/movenc: Factor check_pkt() out

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Thu Sep 15 23:52:42 2016 +0200| [03f996d1834610bd735406aac3ee6df47a946406] | 
committer: Michael Niedermayer

avformat/movenc: Factor check_pkt() out

Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit deabcd2c05b2b01689d91394bbf3908da17234ed)
Signed-off-by: Michael Niedermayer 

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

 libavformat/movenc.c | 24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 788ab3c..917fdaf 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4592,15 +4592,10 @@ static int mov_auto_flush_fragment(AVFormatContext *s, 
int force)
 return ret;
 }
 
-int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
+static int check_pkt(AVFormatContext *s, AVPacket *pkt)
 {
 MOVMuxContext *mov = s->priv_data;
-AVIOContext *pb = s->pb;
 MOVTrack *trk = >tracks[pkt->stream_index];
-AVCodecParameters *par = trk->par;
-unsigned int samples_in_chunk = 0;
-int size = pkt->size, ret = 0;
-uint8_t *reformatted_data = NULL;
 
 if (trk->entry) {
 int64_t duration = pkt->dts - trk->cluster[trk->entry - 1].dts;
@@ -4624,6 +4619,23 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" is 
invalid\n", pkt->duration);
 return AVERROR(EINVAL);
 }
+return 0;
+}
+
+int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
+{
+MOVMuxContext *mov = s->priv_data;
+AVIOContext *pb = s->pb;
+MOVTrack *trk = >tracks[pkt->stream_index];
+AVCodecParameters *par = trk->par;
+unsigned int samples_in_chunk = 0;
+int size = pkt->size, ret = 0;
+uint8_t *reformatted_data = NULL;
+
+ret = check_pkt(s, pkt);
+if (ret < 0)
+return ret;
+
 if (mov->flags & FF_MOV_FLAG_FRAGMENT) {
 int ret;
 if (mov->moov_written || mov->flags & FF_MOV_FLAG_EMPTY_MOOV) {

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


[FFmpeg-cvslog] avcodec/avpacket: clear side_data_elems

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Mon Sep 12 13:13:42 2016 +0200| [c2087fc48b46ac478944b4e6c59ae2a3a05da0e1] | 
committer: Michael Niedermayer

avcodec/avpacket: clear side_data_elems

Fixes null pointer dereference

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 5e1bf9d8c0d2cdbbf17b06a5dfdf87a635b3203b)
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index d70ee5d..bb0fc6c 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -199,6 +199,7 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket 
*src, int dup)
 {
 pkt->data  = NULL;
 pkt->side_data = NULL;
+pkt->side_data_elems = 0;
 if (pkt->buf) {
 AVBufferRef *ref = av_buffer_ref(src->buf);
 if (!ref)
@@ -208,9 +209,11 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket 
*src, int dup)
 } else {
 DUP_DATA(pkt->data, src->data, pkt->size, 1, ALLOC_BUF);
 }
-if (pkt->side_data_elems && dup)
+if (src->side_data_elems && dup) {
 pkt->side_data = src->side_data;
-if (pkt->side_data_elems && !dup) {
+pkt->side_data_elems = src->side_data_elems;
+}
+if (src->side_data_elems && !dup) {
 return av_copy_packet_side_data(pkt, src);
 }
 return 0;

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


[FFmpeg-cvslog] avformat/avidec: Fix memleak with dv in avi

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Sun Sep 25 11:56:11 2016 +0200| [8834e080c20d3d23c3ffe779371359f9b9b835ec] | 
committer: Michael Niedermayer

avformat/avidec: Fix memleak with dv in avi

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit b98dafe04564d5fe3e5bf5073d871dd93a4a62de)
Signed-off-by: Michael Niedermayer 

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

 libavformat/avidec.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 858011c..26b0234 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -605,9 +605,13 @@ static int avi_read_header(AVFormatContext *s)
 ast = s->streams[0]->priv_data;
 av_freep(>streams[0]->codecpar->extradata);
 av_freep(>streams[0]->codecpar);
+av_freep(>streams[0]->codec);
 if (s->streams[0]->info)
 av_freep(>streams[0]->info->duration_error);
 av_freep(>streams[0]->info);
+if (s->streams[0]->internal)
+av_freep(>streams[0]->internal->avctx);
+av_freep(>streams[0]->internal);
 av_freep(>streams[0]);
 s->nb_streams = 0;
 if (CONFIG_DV_DEMUXER) {

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


[FFmpeg-cvslog] Update for 3.1.4

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Tue Sep 27 13:44:47 2016 +0200| [e6351504dc545aef7c7f87a81f95a4d3172ec55d] | 
committer: Michael Niedermayer

Update for 3.1.4

Signed-off-by: Michael Niedermayer 

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

 Changelog| 22 ++
 RELEASE  |  2 +-
 doc/Doxyfile |  2 +-
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index 6089814..b6156a0 100644
--- a/Changelog
+++ b/Changelog
@@ -3,6 +3,28 @@ releases are sorted from youngest to oldest.
 
 version :
 
+version 3.1.4:
+- avformat/avidec: Fix memleak with dv in avi
+- lavc/movtextdec.c: Avoid infinite loop on invalid data.
+- avcodec/ansi: Check dimensions
+- avcodec/cavsdsp: use av_clip_uint8() for idct
+- avformat/movenc: Check packet in mov_write_single_packet() too
+- avformat/movenc: Factor check_pkt() out
+- avformat/utils: fix timebase error in avformat_seek_file()
+- avcodec/g726: Add missing ADDB output mask
+- avcodec/avpacket: clear side_data_elems
+- avformat/movenc: Check first DTS similar to dts difference
+- avcodec/ccaption_dec: Use simple array instead of AVBuffer
+- avcodec/svq3: Reintroduce slice_type
+- avformat/mov: Fix potential integer overflow in mov_read_keys
+- swscale/swscale_unscaled: Try to fix Rgb16ToPlanarRgb16Wrapper() with slices
+- swscale/swscale_unscaled: Fix packed_16bpc_bswap() with slices
+- avformat/avidec: Fix infinite loop in avi_read_nikon()
+- lavf/utils: Avoid an overflow for huge negative durations.
+- avformat/hls: Fix handling of EXT-X-BYTERANGE streams over 2GB
+- lavc/avpacket: Fix undefined behaviour, do not pass a null pointer to 
memcpy().
+- lavc/mjpegdec: Do not skip reading quantization tables.
+- cmdutils: fix implicit declaration of SetDllDirectory function
 
 version 3.1.3:
 - examples/demuxing_decoding: convert to codecpar
diff --git a/RELEASE b/RELEASE
index ff365e0..0aec50e 100644
--- a/RELEASE
+++ b/RELEASE
@@ -1 +1 @@
-3.1.3
+3.1.4
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 5c8b2ed..000498b 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME   = FFmpeg
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER = 3.1.3
+PROJECT_NUMBER = 3.1.4
 
 # With the PROJECT_LOGO tag one can specify a logo or icon that is included
 # in the documentation. The maximum height of the logo should not exceed 55

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


[FFmpeg-cvslog] avcodec/cavsdsp: use av_clip_uint8() for idct

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Mon Sep 19 15:25:38 2016 +0200| [9d738e6968757d4e70c8e07e0b720ac0004accc4] | 
committer: Michael Niedermayer

avcodec/cavsdsp: use av_clip_uint8() for idct

Fixes out of array read
Fixes: 1.swf

Found-by: 连一汉 
Tested-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 0e318f110bcd6bb8e7de9127f2747272e60f48d7)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/cavsdsp.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/libavcodec/cavsdsp.c b/libavcodec/cavsdsp.c
index 91f6d73..df9490a 100644
--- a/libavcodec/cavsdsp.c
+++ b/libavcodec/cavsdsp.c
@@ -188,7 +188,6 @@ static void cavs_filter_ch_c(uint8_t *d, int stride, int 
alpha, int beta, int tc
 static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) {
 int i;
 int16_t (*src)[8] = (int16_t(*)[8])block;
-const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;
 
 src[0][0] += 8;
 
@@ -243,14 +242,14 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t 
*block, int stride) {
 const int b2 = a5 - a7;
 const int b3 = a4 - a6;
 
-dst[i + 0*stride] = cm[ dst[i + 0*stride] + ((b0 + b4) >> 7)];
-dst[i + 1*stride] = cm[ dst[i + 1*stride] + ((b1 + b5) >> 7)];
-dst[i + 2*stride] = cm[ dst[i + 2*stride] + ((b2 + b6) >> 7)];
-dst[i + 3*stride] = cm[ dst[i + 3*stride] + ((b3 + b7) >> 7)];
-dst[i + 4*stride] = cm[ dst[i + 4*stride] + ((b3 - b7) >> 7)];
-dst[i + 5*stride] = cm[ dst[i + 5*stride] + ((b2 - b6) >> 7)];
-dst[i + 6*stride] = cm[ dst[i + 6*stride] + ((b1 - b5) >> 7)];
-dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((b0 - b4) >> 7)];
+dst[i + 0*stride] = av_clip_uint8( dst[i + 0*stride] + ((b0 + b4) >> 
7));
+dst[i + 1*stride] = av_clip_uint8( dst[i + 1*stride] + ((b1 + b5) >> 
7));
+dst[i + 2*stride] = av_clip_uint8( dst[i + 2*stride] + ((b2 + b6) >> 
7));
+dst[i + 3*stride] = av_clip_uint8( dst[i + 3*stride] + ((b3 + b7) >> 
7));
+dst[i + 4*stride] = av_clip_uint8( dst[i + 4*stride] + ((b3 - b7) >> 
7));
+dst[i + 5*stride] = av_clip_uint8( dst[i + 5*stride] + ((b2 - b6) >> 
7));
+dst[i + 6*stride] = av_clip_uint8( dst[i + 6*stride] + ((b1 - b5) >> 
7));
+dst[i + 7*stride] = av_clip_uint8( dst[i + 7*stride] + ((b0 - b4) >> 
7));
 }
 }
 

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


[FFmpeg-cvslog] avformat/utils: End probing if the expected codec surpasses AVPROBE_SCORE_STREAM_RETRY

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Sat Aug 27 01:12:49 2016 +0200| [ba642f031906b89566c60426cd2c0ffcd43072ea] | 
committer: Michael Niedermayer

avformat/utils: End probing if the expected codec surpasses 
AVPROBE_SCORE_STREAM_RETRY

Fixes Ticket5800

Signed-off-by: Michael Niedermayer 
(cherry picked from commit c75273310cf1becffee79bab0e2bba0b1606afb7)
Signed-off-by: Michael Niedermayer 

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

 libavformat/utils.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index f470c79..1711bef 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -307,7 +307,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, 
AVStream *st,
 int score;
 AVInputFormat *fmt = av_probe_input_format3(pd, 1, );
 
-if (fmt && st->request_probe <= score) {
+if (fmt) {
 int i;
 av_log(s, AV_LOG_DEBUG,
"Probe with size=%d, packets=%d detected %s with score=%d\n",
@@ -318,6 +318,9 @@ static int set_codec_from_probe_data(AVFormatContext *s, 
AVStream *st,
 if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
 st->codecpar->sample_rate)
 continue;
+if (st->request_probe > score &&
+st->codecpar->codec_id != fmt_id_type[i].id)
+continue;
 st->codecpar->codec_id   = fmt_id_type[i].id;
 st->codecpar->codec_type = fmt_id_type[i].type;
 st->internal->need_context_update = 1;

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


[FFmpeg-cvslog] avcodec/ansi: Check dimensions

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Mon Sep 26 20:25:59 2016 +0200| [496267f8e9ec218351e4359e1fde48722d4fc804] | 
committer: Michael Niedermayer

avcodec/ansi: Check dimensions

Fixes: 1.avi

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 69449da436169e7facaa6d1f3bcbc41cf6ce2754)
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c
index 4808ea7..19c88d8 100644
--- a/libavcodec/ansi.c
+++ b/libavcodec/ansi.c
@@ -94,6 +94,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
 int ret = ff_set_dimensions(avctx, 80 << 3, 25 << 4);
 if (ret < 0)
 return ret;
+} else if (avctx->width % FONT_WIDTH || avctx->height % s->font_height) {
+av_log(avctx, AV_LOG_ERROR, "Invalid dimensions %d %d\n", 
avctx->width, avctx->height);
+return AVERROR(EINVAL);
 }
 return 0;
 }

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


[FFmpeg-cvslog] avformat/avidec: Fix infinite loop in avi_read_nikon()

2016-09-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.1 | Michael Niedermayer  | 
Fri Sep  2 12:19:29 2016 +0200| [ed38046c5c2e3b310980be32287179895c83e0d8] | 
committer: Michael Niedermayer

avformat/avidec: Fix infinite loop in avi_read_nikon()

Fixes: 360/test.poc

Found-by: 连一汉 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit e4e4a9cad7f21593d4bcb1f2404ea0d373c36c43)
Signed-off-by: Michael Niedermayer 

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

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

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 38ea86d..858011c 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -344,14 +344,14 @@ static void avi_metadata_creation_time(AVDictionary 
**metadata, char *date)
 
 static void avi_read_nikon(AVFormatContext *s, uint64_t end)
 {
-while (avio_tell(s->pb) < end) {
+while (avio_tell(s->pb) < end && !avio_feof(s->pb)) {
 uint32_t tag  = avio_rl32(s->pb);
 uint32_t size = avio_rl32(s->pb);
 switch (tag) {
 case MKTAG('n', 'c', 't', 'g'):  /* Nikon Tags */
 {
 uint64_t tag_end = avio_tell(s->pb) + size;
-while (avio_tell(s->pb) < tag_end) {
+while (avio_tell(s->pb) < tag_end && !avio_feof(s->pb)) {
 uint16_t tag = avio_rl16(s->pb);
 uint16_t size= avio_rl16(s->pb);
 const char *name = NULL;

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


[FFmpeg-cvslog] lavc/qdm2: increase code clarity

2016-09-28 Thread Adriano Pallavicino
ffmpeg | branch: master | Adriano Pallavicino  | 
Tue Sep 27 20:22:20 2016 +0200| [25866680fd6ba2e1994e8aeda2e3b1a1938e8385] | 
committer: Josh de Kock

lavc/qdm2: increase code clarity

Signed-off-by: Michael Niedermayer 
Signed-off-by: Josh de Kock 

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

 libavcodec/qdm2.c | 117 +++---
 1 file changed, 59 insertions(+), 58 deletions(-)

diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index dd8b257..e3cc902 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -537,7 +537,7 @@ static void fill_coding_method_array(sb_int8_array 
tone_level_idx,
 /* This case is untested, no samples available */
 avpriv_request_sample(NULL, "!superblocktype_2_3");
 return;
-for (ch = 0; ch < nb_channels; ch++)
+for (ch = 0; ch < nb_channels; ch++) {
 for (sb = 0; sb < 30; sb++) {
 for (j = 1; j < 63; j++) {  // The loop only iterates to 63 so 
the code doesn't overflow the buffer
 add1 = tone_level_idx[ch][sb][j] - 10;
@@ -566,67 +566,68 @@ static void fill_coding_method_array(sb_int8_array 
tone_level_idx,
 }
 tone_level_idx_temp[ch][sb][0] = 
tone_level_idx_temp[ch][sb][1];
 }
-acc = 0;
-for (ch = 0; ch < nb_channels; ch++)
-for (sb = 0; sb < 30; sb++)
-for (j = 0; j < 64; j++)
-acc += tone_level_idx_temp[ch][sb][j];
-
-multres = 0x6667LL * (acc * 10);
-esp_40 = (multres >> 32) / 8 + ((multres & 0x) >> 31);
-for (ch = 0;  ch < nb_channels; ch++)
-for (sb = 0; sb < 30; sb++)
-for (j = 0; j < 64; j++) {
-comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
-if (comp < 0)
-comp += 0xff;
-comp /= 256; // signed shift
-switch(sb) {
-case 0:
-if (comp < 30)
-comp = 30;
-comp += 15;
-break;
-case 1:
-if (comp < 24)
-comp = 24;
-comp += 10;
-break;
-case 2:
-case 3:
-case 4:
-if (comp < 16)
-comp = 16;
-}
-if (comp <= 5)
-tmp = 0;
-else if (comp <= 10)
-tmp = 10;
-else if (comp <= 16)
-tmp = 16;
-else if (comp <= 24)
-tmp = -1;
-else
-tmp = 0;
-coding_method[ch][sb][j] = ((tmp & 0xfffa) + 30 )& 
0xff;
+}
+acc = 0;
+for (ch = 0; ch < nb_channels; ch++)
+for (sb = 0; sb < 30; sb++)
+for (j = 0; j < 64; j++)
+acc += tone_level_idx_temp[ch][sb][j];
+
+multres = 0x6667LL * (acc * 10);
+esp_40 = (multres >> 32) / 8 + ((multres & 0x) >> 31);
+for (ch = 0;  ch < nb_channels; ch++)
+for (sb = 0; sb < 30; sb++)
+for (j = 0; j < 64; j++) {
+comp = tone_level_idx_temp[ch][sb][j]* esp_40 * 10;
+if (comp < 0)
+comp += 0xff;
+comp /= 256; // signed shift
+switch(sb) {
+case 0:
+if (comp < 30)
+comp = 30;
+comp += 15;
+break;
+case 1:
+if (comp < 24)
+comp = 24;
+comp += 10;
+break;
+case 2:
+case 3:
+case 4:
+if (comp < 16)
+comp = 16;
 }
+if (comp <= 5)
+tmp = 0;
+else if (comp <= 10)
+tmp = 10;
+else if (comp <= 16)
+tmp = 16;
+else if (comp <= 24)
+tmp = -1;
+else
+