From d90f91c1c85d252c7b6f6b42c256fc10f7d2b5e8 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 4 May 2015 17:44:14 +0200 Subject: [PATCH 1/3] lavf/mxfenc: Write correct interlaced flag when muxing dnxhd. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported and early patch version tested by forum user gridtank. Reviewed-by: Tomas Härdin --- libavcodec/dnxhddata.c | 8 ++++++++ libavcodec/dnxhddata.h | 1 + libavcodec/version.h | 4 ++-- libavformat/mxfenc.c | 2 ++ libavformat/version.h | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c index b6488994d7..ef918b0214 100644 --- a/libavcodec/dnxhddata.c +++ b/libavcodec/dnxhddata.c @@ -1102,6 +1102,14 @@ int avpriv_dnxhd_get_frame_size(int cid) return ff_dnxhd_cid_table[i].frame_size; } +int avpriv_dnxhd_get_interlaced(int cid) +{ + int i = ff_dnxhd_get_cid_table(cid); + if (i < 0) + return i; + return ff_dnxhd_cid_table[i].interlaced; +} + int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth) { int i, j; diff --git a/libavcodec/dnxhddata.h b/libavcodec/dnxhddata.h index d5629e25f1..8cc27e88e7 100644 --- a/libavcodec/dnxhddata.h +++ b/libavcodec/dnxhddata.h @@ -53,5 +53,6 @@ int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth); void ff_dnxhd_print_profiles(AVCodecContext *avctx, int loglevel); int avpriv_dnxhd_get_frame_size(int cid); +int avpriv_dnxhd_get_interlaced(int cid); #endif /* AVCODEC_DNXHDDATA_H */ diff --git a/libavcodec/version.h b/libavcodec/version.h index 69f9759f01..41c41451c7 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,8 +29,8 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 56 -#define LIBAVCODEC_VERSION_MINOR 35 -#define LIBAVCODEC_VERSION_MICRO 101 +#define LIBAVCODEC_VERSION_MINOR 36 +#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index efa1e04116..59667924f0 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1640,6 +1640,8 @@ AVPacket *pkt) if ((frame_size = avpriv_dnxhd_get_frame_size(cid)) < 0) return -1; + if ((sc->interlaced = avpriv_dnxhd_get_interlaced(cid)) < 0) + return AVERROR_INVALIDDATA; switch (cid) { case 1235: diff --git a/libavformat/version.h b/libavformat/version.h index 381c0718b6..8733dc377c 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,7 +31,7 @@ #define LIBAVFORMAT_VERSION_MAJOR 56 #define LIBAVFORMAT_VERSION_MINOR 31 -#define LIBAVFORMAT_VERSION_MICRO 100 +#define LIBAVFORMAT_VERSION_MICRO 101 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ From 8ad04d24c82e4b59a89108c3d37095e8362788bd Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 4 May 2015 17:49:36 +0200 Subject: [PATCH 2/3] lavf/apngenc: Fix png remuxing by using default extension apng. --- Changelog | 2 +- libavformat/apngenc.c | 2 +- libavformat/version.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index 623d10ade1..7d619b9dcc 100644 --- a/Changelog +++ b/Changelog @@ -12,7 +12,7 @@ version : - Detelecine filter - Intel QSV-accelerated H.264 encoding - MMAL-accelerated H.264 decoding -- basic APNG encoder and muxer +- basic APNG encoder and muxer with default extension "apng" - unpack DivX-style packed B-frames in MPEG-4 bitstream filter - WebM Live Chunk Muxer - nvenc level and tier options diff --git a/libavformat/apngenc.c b/libavformat/apngenc.c index 4b31309334..dcf6b906e1 100644 --- a/libavformat/apngenc.c +++ b/libavformat/apngenc.c @@ -259,7 +259,7 @@ AVOutputFormat ff_apng_muxer = { .name = "apng", .long_name = NULL_IF_CONFIG_SMALL("Animated Portable Network Graphics"), .mime_type = "image/png", - .extensions = "png", + .extensions = "apng", .priv_data_size = sizeof(APNGMuxContext), .audio_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_APNG, diff --git a/libavformat/version.h b/libavformat/version.h index 8733dc377c..976fa60fc8 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,7 +31,7 @@ #define LIBAVFORMAT_VERSION_MAJOR 56 #define LIBAVFORMAT_VERSION_MINOR 31 -#define LIBAVFORMAT_VERSION_MICRO 101 +#define LIBAVFORMAT_VERSION_MICRO 102 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ From 0bca6182b26a2094c5229fef4d8fe8ecb9a75e58 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 4 May 2015 17:50:16 +0200 Subject: [PATCH 3/3] lavfi/cropdetect: Fix cropdetect for > 8 bit input. --- libavfilter/version.h | 2 +- libavfilter/vf_cropdetect.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/version.h b/libavfilter/version.h index 090215f655..bf7275f7b9 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -31,7 +31,7 @@ #define LIBAVFILTER_VERSION_MAJOR 5 #define LIBAVFILTER_VERSION_MINOR 16 -#define LIBAVFILTER_VERSION_MICRO 100 +#define LIBAVFILTER_VERSION_MICRO 101 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ LIBAVFILTER_VERSION_MINOR, \ diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c index 485ae69fb3..7fa965160f 100644 --- a/libavfilter/vf_cropdetect.c +++ b/libavfilter/vf_cropdetect.c @@ -92,12 +92,12 @@ static int checkline(void *ctx, const unsigned char *src, int stride, int len, i while (len >= 8) { total += src16[ 0] + src16[ stride] + src16[2*stride] + src16[3*stride] + src16[4*stride] + src16[5*stride] + src16[6*stride] + src16[7*stride]; - src += 8*stride; + src16 += 8*stride; len -= 8; } while (--len >= 0) { total += src16[0]; - src += stride; + src16 += stride; } break; case 3: