[FFmpeg-cvslog] avfilter/vf_lenscorrection: get rid of floats in init code
ffmpeg | branch: master | Michael Niedermayer | Wed Aug 20 14:15:12 2014 +0200| [32cb6c1fe28f3f96ccc8a1ff90b17f01419a004e] | committer: Michael Niedermayer avfilter/vf_lenscorrection: get rid of floats in init code The only remaining floats are in the user interface, they are left as they should not cause a problem in practice Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=32cb6c1fe28f3f96ccc8a1ff90b17f01419a004e --- libavfilter/vf_lenscorrection.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_lenscorrection.c b/libavfilter/vf_lenscorrection.c index 11fa4c8..d30a81b 100644 --- a/libavfilter/vf_lenscorrection.c +++ b/libavfilter/vf_lenscorrection.c @@ -149,8 +149,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) int h = rect->height / vdiv; int xcenter = rect->cx * w; int ycenter = rect->cy * h; -float k1 = rect->k1; -float k2 = rect->k2; +int k1 = rect->k1 * (1<<24); +int k2 = rect->k2 * (1<<24); ThreadData td = { .in = in, .out = out, @@ -162,7 +162,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) if (!rect->correction[plane]) { int i,j; -const float r2inv = 4.0 / (w * w + h * h); +const int64_t r2inv = (4LL<<60) / (w * w + h * h); rect->correction[plane] = av_malloc_array(w, h * sizeof(**rect->correction)); if (!rect->correction[plane]) @@ -172,9 +172,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) const int off_y2 = off_y * off_y; for (i = 0; i < w; i++) { const int off_x = i - xcenter; -const float r2 = (off_x * off_x + off_y2) * r2inv; -const float radius_mult = 1.0f + r2 * k1 + r2 * r2 * k2; -rect->correction[plane][j * w + i] = lrintf(radius_mult * (1<<24)); +const int64_t r2 = ((off_x * off_x + off_y2) * r2inv + (1LL<<31)) >> 32; +const int64_t r4 = (r2 * r2 + (1<<27)) >> 28; +const int radius_mult = (r2 * k1 + r4 * k2 + (1LL<<27) + (1LL<<52))>>28; +rect->correction[plane][j * w + i] = radius_mult; } } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_lenscorrection: get rid of all floats per frame
ffmpeg | branch: master | Michael Niedermayer | Wed Aug 20 14:05:20 2014 +0200| [2450ca0f3344acc9c48c5990aee2e617313f030d] | committer: Michael Niedermayer avfilter/vf_lenscorrection: get rid of all floats per frame there are some still left for 1 time initialization Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2450ca0f3344acc9c48c5990aee2e617313f030d --- libavfilter/vf_lenscorrection.c | 45 --- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/libavfilter/vf_lenscorrection.c b/libavfilter/vf_lenscorrection.c index 048820c..11fa4c8 100644 --- a/libavfilter/vf_lenscorrection.c +++ b/libavfilter/vf_lenscorrection.c @@ -41,6 +41,7 @@ typedef struct LenscorrectionCtx { int hsub, vsub; int nb_planes; double cx, cy, k1, k2; +int32_t *correction[4]; } LenscorrectionCtx; #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM @@ -59,7 +60,7 @@ typedef struct ThreadData { int w, h; int plane; int xcenter, ycenter; -float k1, k2; +int32_t *correction; } ThreadData; static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs) @@ -71,9 +72,6 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs) const int w = td->w, h = td->h; const int xcenter = td->xcenter; const int ycenter = td->ycenter; -const float r2inv = 4.0 / (w * w + h * h); -const float k1 = td->k1; -const float k2 = td->k2; const int start = (h * job ) / nb_jobs; const int end = (h * (job+1)) / nb_jobs; const int plane = td->plane; @@ -84,15 +82,13 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs) int i; for (i = start; i < end; i++, outrow += outlinesize) { const int off_y = i - ycenter; -const int off_y2 = off_y * off_y; uint8_t *out = outrow; int j; for (j = 0; j < w; j++) { const int off_x = j - xcenter; -const float r2 = (off_x * off_x + off_y2) * r2inv; -const float radius_mult = 1.0f + r2 * k1 + r2 * r2 * k2; -const int x = xcenter + radius_mult * off_x + 0.5f; -const int y = ycenter + radius_mult * off_y + 0.5f; +const int64_t radius_mult = td->correction[j + i*w]; +const int x = xcenter + ((radius_mult * off_x + (1<<23))>>24); +const int y = ycenter + ((radius_mult * off_y + (1<<23))>>24); const char isvalid = x > 0 && x < w - 1 && y > 0 && y < h - 1; *out++ = isvalid ? indata[y * inlinesize + x] : 0; } @@ -151,16 +147,39 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) int vdiv = 1 << vsub; int w = rect->width / hdiv; int h = rect->height / vdiv; +int xcenter = rect->cx * w; +int ycenter = rect->cy * h; +float k1 = rect->k1; +float k2 = rect->k2; ThreadData td = { .in = in, .out = out, .w = w, .h = h, -.xcenter = rect->cx * w, -.ycenter = rect->cy * h, -.k1 = rect->k1, -.k2 = rect->k2, +.xcenter = xcenter, +.ycenter = ycenter, .plane = plane}; + +if (!rect->correction[plane]) { +int i,j; +const float r2inv = 4.0 / (w * w + h * h); + +rect->correction[plane] = av_malloc_array(w, h * sizeof(**rect->correction)); +if (!rect->correction[plane]) +return AVERROR(ENOMEM); +for (j = 0; j < h; j++) { +const int off_y = j - ycenter; +const int off_y2 = off_y * off_y; +for (i = 0; i < w; i++) { +const int off_x = i - xcenter; +const float r2 = (off_x * off_x + off_y2) * r2inv; +const float radius_mult = 1.0f + r2 * k1 + r2 * r2 * k2; +rect->correction[plane][j * w + i] = lrintf(radius_mult * (1<<24)); +} +} +} + +td.correction = rect->correction[plane]; ctx->internal->execute(ctx, filter_slice, &td, NULL, FFMIN(h, ctx->graph->nb_threads)); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_lenscorrection: get rid of some floats
ffmpeg | branch: master | Michael Niedermayer | Wed Aug 20 13:19:26 2014 +0200| [c1b663bc92d3d5d4683b4109e5f6cea075855a7d] | committer: Michael Niedermayer avfilter/vf_lenscorrection: get rid of some floats > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c1b663bc92d3d5d4683b4109e5f6cea075855a7d --- libavfilter/vf_lenscorrection.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libavfilter/vf_lenscorrection.c b/libavfilter/vf_lenscorrection.c index f4b1676..048820c 100644 --- a/libavfilter/vf_lenscorrection.c +++ b/libavfilter/vf_lenscorrection.c @@ -56,9 +56,9 @@ AVFILTER_DEFINE_CLASS(lenscorrection); typedef struct ThreadData { AVFrame *in, *out; -float w, h; +int w, h; int plane; -float xcenter, ycenter; +int xcenter, ycenter; float k1, k2; } ThreadData; @@ -68,9 +68,9 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs) AVFrame *in = td->in; AVFrame *out = td->out; -const float w = td->w, h = td->h; -const float xcenter = td->xcenter; -const float ycenter = td->ycenter; +const int w = td->w, h = td->h; +const int xcenter = td->xcenter; +const int ycenter = td->ycenter; const float r2inv = 4.0 / (w * w + h * h); const float k1 = td->k1; const float k2 = td->k2; @@ -83,12 +83,12 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs) uint8_t *outrow = out->data[plane] + start * outlinesize; int i; for (i = start; i < end; i++, outrow += outlinesize) { -const float off_y = i - ycenter; -const float off_y2 = off_y * off_y; +const int off_y = i - ycenter; +const int off_y2 = off_y * off_y; uint8_t *out = outrow; int j; for (j = 0; j < w; j++) { -const float off_x = j - xcenter; +const int off_x = j - xcenter; const float r2 = (off_x * off_x + off_y2) * r2inv; const float radius_mult = 1.0f + r2 * k1 + r2 * r2 * k2; const int x = xcenter + radius_mult * off_x + 0.5f; @@ -147,10 +147,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) for (plane = 0; plane < rect->nb_planes; ++plane) { int hsub = plane == 1 || plane == 2 ? rect->hsub : 0; int vsub = plane == 1 || plane == 2 ? rect->vsub : 0; -float hdiv = 1 << hsub; -float vdiv = 1 << vsub; -float w = rect->width / hdiv; -float h = rect->height / vdiv; +int hdiv = 1 << hsub; +int vdiv = 1 << vsub; +int w = rect->width / hdiv; +int h = rect->height / vdiv; ThreadData td = { .in = in, .out = out, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avutil/motion_vector.h: fix coordinate types
ffmpeg | branch: master | Clément Bœsch | Wed Aug 20 23:24:17 2014 +0200| [980a5b01fd07ae117ee30aaef74b57d68f0df22d] | committer: Clément Bœsch avutil/motion_vector.h: fix coordinate types See b0352b1997a83f1b6b27919b94aab539f099b25b for more information on the feature. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=980a5b01fd07ae117ee30aaef74b57d68f0df22d --- doc/APIchanges|2 +- libavutil/motion_vector.h |8 libavutil/version.h |2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 1bed107..da05c8d 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,7 +15,7 @@ libavutil: 2014-08-09 API changes, most recent first: -2014-08-xx - xxx - lavu 54.5.100 - frame.h motion_vector.h +2014-08-xx - xxx - lavu 54.6.100 - frame.h motion_vector.h Add AV_FRAME_DATA_MOTION_VECTORS side data and AVMotionVector structure 2014-08-16 - xxx - lswr 1.1.100 - swresample.h diff --git a/libavutil/motion_vector.h b/libavutil/motion_vector.h index 245e511..30cfb99 100644 --- a/libavutil/motion_vector.h +++ b/libavutil/motion_vector.h @@ -33,13 +33,13 @@ typedef struct AVMotionVector { */ uint8_t w, h; /** - * Absolute source position. + * Absolute source position. Can be outside the frame area. */ -uint16_t src_x, src_y; +int16_t src_x, src_y; /** - * Absolute destination position. + * Absolute destination position. Can be outside the frame area. */ -uint16_t dst_x, dst_y; +int16_t dst_x, dst_y; /** * Extra flag information. * Currently unused. diff --git a/libavutil/version.h b/libavutil/version.h index d42209d..4236ed2 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -56,7 +56,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 54 -#define LIBAVUTIL_VERSION_MINOR 5 +#define LIBAVUTIL_VERSION_MINOR 6 #define LIBAVUTIL_VERSION_MICRO 100 #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] doc/APIChanges: fill 2 hashes from my recent API additions
ffmpeg | branch: master | Clément Bœsch | Thu Aug 21 12:36:28 2014 +0200| [f5ddce0753c555ac8e9d9364d4a39c5e22e39577] | committer: Clément Bœsch doc/APIChanges: fill 2 hashes from my recent API additions > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f5ddce0753c555ac8e9d9364d4a39c5e22e39577 --- doc/APIchanges |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index da05c8d..2657470 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,7 +15,7 @@ libavutil: 2014-08-09 API changes, most recent first: -2014-08-xx - xxx - lavu 54.6.100 - frame.h motion_vector.h +2014-08-21 - 980a5b0 - lavu 54.6.100 - frame.h motion_vector.h Add AV_FRAME_DATA_MOTION_VECTORS side data and AVMotionVector structure 2014-08-16 - xxx - lswr 1.1.100 - swresample.h @@ -54,7 +54,7 @@ API changes, most recent first: 2014-08-xx - xxx - lavc 55.57.3 - avcodec.h reordered_opaque is not going to be removed in the future. -2014-08-02 - xxx - lavu 52.98.100 - pixelutils.h +2014-08-02 - 28a2107 - lavu 52.98.100 - pixelutils.h Add pixelutils API with SAD functions 2014-08-xx - xxx - lavu 53.22.0 - pixfmt.h ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_lenscorrection: fix memleak
ffmpeg | branch: master | Michael Niedermayer | Thu Aug 21 12:16:07 2014 +0200| [b09ea25fec615c871ab8bfb00c3863aa0ce0d2c9] | committer: Michael Niedermayer avfilter/vf_lenscorrection: fix memleak Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b09ea25fec615c871ab8bfb00c3863aa0ce0d2c9 --- libavfilter/vf_lenscorrection.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/libavfilter/vf_lenscorrection.c b/libavfilter/vf_lenscorrection.c index d30a81b..58184b0 100644 --- a/libavfilter/vf_lenscorrection.c +++ b/libavfilter/vf_lenscorrection.c @@ -111,6 +111,16 @@ static int query_formats(AVFilterContext *ctx) return 0; } +static av_cold void uninit(AVFilterContext *ctx) +{ +LenscorrectionCtx *rect = ctx->priv; +int i; + +for (i = 0; i < FF_ARRAY_ELEMS(rect->correction); i++) { +av_freep(&rect->correction[i]); +} +} + static int config_props(AVFilterLink *outlink) { AVFilterContext *ctx = outlink->src; @@ -214,5 +224,6 @@ AVFilter ff_vf_lenscorrection = { .inputs= lenscorrection_inputs, .outputs = lenscorrection_outputs, .priv_class= &lenscorrection_class, +.uninit= uninit, .flags = AVFILTER_FLAG_SLICE_THREADS, }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] imc: reject files with unfathomable sampling rates
ffmpeg | branch: master | Christophe Gisquet | Thu Aug 21 12:21:07 2014 +0200| [4728cdd88033c2bd41ae675d7df9aaf3f578136b] | committer: Michael Niedermayer imc: reject files with unfathomable sampling rates With huge sampling rates, the table derivation method does not converge fast enough. While fixing it using e.g. Newton-Rhapson-like methods (the curve is nicely convex) is possible, it is much simpler to reject these cases. The value of 96000 was arbitrarily chosen as a realistic value, though 100 would still work and converge. Fixes ticket #3868. Suggested-by: Paul B Mahol Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4728cdd88033c2bd41ae675d7df9aaf3f578136b --- libavcodec/imc.c |8 1 file changed, 8 insertions(+) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index e6a087a..0df0dd1 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -180,6 +180,14 @@ static av_cold int imc_decode_init(AVCodecContext *avctx) IMCContext *q = avctx->priv_data; double r1, r2; +if (avctx->codec_id == AV_CODEC_ID_IAC && avctx->sample_rate > 96000) { +av_log(avctx, AV_LOG_ERROR, + "Strange sample rate of %i, file likely corrupt or " + "needing a new table derivation method.\n", + avctx->sample_rate); +return AVERROR_PATCHWELCOME; +} + if (avctx->codec_id == AV_CODEC_ID_IMC) avctx->channels = 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavfi/apad: fix logic when whole_len or pad_len options are specified
ffmpeg | branch: master | Stefano Sabatini | Mon Aug 18 14:51:25 2014 +0200| [aade9884e95c6f6da5a856da95501bc14a6225aa] | committer: Stefano Sabatini lavfi/apad: fix logic when whole_len or pad_len options are specified In particular, allow pad_len and whole_len to have value set to 0, which means that no padding will be added. Previously a value set to 0 meant that that the filter had to pad forever. The new semantics is clearer, also simplifies scripting since the option value might be automatically computed, so that no checks need to be done in case it is 0. The old semantics was never documented and the logic was broken (the filter was always adding samples indefinitely), so this should not break backward compatibility. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aade9884e95c6f6da5a856da95501bc14a6225aa --- libavfilter/af_apad.c | 34 -- libavfilter/version.h |2 +- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/libavfilter/af_apad.c b/libavfilter/af_apad.c index 6b2c8b1..eafc705 100644 --- a/libavfilter/af_apad.c +++ b/libavfilter/af_apad.c @@ -39,17 +39,17 @@ typedef struct { int64_t next_pts; int packet_size; -int64_t pad_len; -int64_t whole_len; +int64_t pad_len, pad_len_left; +int64_t whole_len, whole_len_left; } APadContext; #define OFFSET(x) offsetof(APadContext, x) #define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM static const AVOption apad_options[] = { -{ "packet_size", "set silence packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, { .i64 = 4096 }, 0, INT_MAX, A }, -{ "pad_len", "number of samples of silence to add", OFFSET(pad_len), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, A }, -{ "whole_len", "target number of samples in the audio stream", OFFSET(whole_len), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, A }, +{ "packet_size", "set silence packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, { .i64 = 4096 }, 0, INT_MAX, A }, +{ "pad_len", "set number of samples of silence to add", OFFSET(pad_len), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, A }, +{ "whole_len", "set minimum target number of samples in the audio stream", OFFSET(whole_len), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, INT64_MAX, A }, { NULL } }; @@ -60,10 +60,12 @@ static av_cold int init(AVFilterContext *ctx) APadContext *apad = ctx->priv; apad->next_pts = AV_NOPTS_VALUE; -if (apad->whole_len && apad->pad_len) { +if (apad->whole_len >= 0 && apad->pad_len >= 0) { av_log(ctx, AV_LOG_ERROR, "Both whole and pad length are set, this is not possible\n"); return AVERROR(EINVAL); } +apad->pad_len_left = apad->pad_len; +apad->whole_len_left = apad->whole_len; return 0; } @@ -73,8 +75,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) AVFilterContext *ctx = inlink->dst; APadContext *apad = ctx->priv; -if (apad->whole_len) -apad->whole_len -= frame->nb_samples; +if (apad->whole_len >= 0) { +apad->whole_len_left = FFMAX(apad->whole_len_left - frame->nb_samples, 0); +av_log(ctx, AV_LOG_DEBUG, + "n_out:%d whole_len_left:%"PRId64"\n", frame->nb_samples, apad->whole_len_left); +} apad->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational){1, inlink->sample_rate}, inlink->time_base); return ff_filter_frame(ctx->outputs[0], frame); @@ -92,13 +97,14 @@ static int request_frame(AVFilterLink *outlink) int n_out = apad->packet_size; AVFrame *outsamplesref; -if (apad->whole_len > 0) { -apad->pad_len = apad->whole_len; -apad->whole_len = 0; +if (apad->whole_len >= 0 && apad->pad_len < 0) { +apad->pad_len = apad->pad_len_left = apad->whole_len_left; } -if (apad->pad_len > 0) { -n_out = FFMIN(n_out, apad->pad_len); -apad->pad_len -= n_out; +if (apad->pad_len >=0 || apad->whole_len >= 0) { +n_out = FFMIN(n_out, apad->pad_len_left); +apad->pad_len_left -= n_out; +av_log(ctx, AV_LOG_DEBUG, + "padding n_out:%d pad_len_left:%"PRId64"\n", n_out, apad->pad_len_left); } if (!n_out) diff --git a/libavfilter/version.h b/libavfilter/version.h index 28c510e..eb3c12b 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -31,7 +31,7 @@ #define LIBAVFILTER_VERSION_MAJOR 5 #define LIBAVFILTER_VERSION_MINOR 0 -#define LIBAVFILTER_VERSION_MICRO 101 +#define LIBAVFILTER_VERSION_MICRO 102 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ LIBAVFILTER_VERSION_MINOR, \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org h
[FFmpeg-cvslog] doc/filters/apad: extend documentation
ffmpeg | branch: master | Stefano Sabatini | Mon Aug 18 14:52:08 2014 +0200| [7e4a4bda0e5a86c7b6b47d36c356499109688cc5] | committer: Stefano Sabatini doc/filters/apad: extend documentation > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7e4a4bda0e5a86c7b6b47d36c356499109688cc5 --- doc/filters.texi | 54 -- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index a20253a..8badc54 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -742,8 +742,58 @@ Pass the audio source unchanged to the output. @section apad -Pad the end of a audio stream with silence, this can be used together with --shortest to extend audio streams to the same length as the video stream. +Pad the end of an audio stream with silence. + +This can be used together with @command{ffmpeg} @option{-shortest} to +extend audio streams to the same length as the video stream. + +A description of the accepted options follows. + +@table @option +@item packet_size +Set silence packet size. Default value is 4096. + +@item pad_len +Set the number of samples of silence to add to the end. After the +value is reached, the stream is terminated. This option is mutually +exclusive with @option{whole_len}. + +@item whole_len +Set the minimum total number of samples in the output audio stream. If +the value is longer than the input audio length, silence is added to +the end, until the value is reached. This option is mutually exclusive +with @option{pad_len}. +@end table + +If neither the @option{pad_len} nor the @option{whole_len} option is +set, the filter will add silence to the end of the input stream +indefinitely. + +@subsection Examples + +@itemize +@item +Add 1024 samples of silence to the end of the input: +@example +apad=pad_len=1024 +@end example + +@item +Make sure the audio output will contain at least 1 samples, pad +the input with silence if required: +@example +apad=whole_len=1 +@end example + +@item +Use @command{ffmpeg} to pad the audio input with silence, so that the +video stream will always result the shortest and will be converted +until the end in the output file when using the @option{shortest} +option: +@example +ffmpeg -i VIDEO -i AUDIO -filter_complex "[1:0]apad" -shortest OUTPUT +@end example +@end itemize @section aphaser Add a phasing effect to the input audio. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/mov: use 64bit for size in mov_skip_multiple_stsd()
ffmpeg | branch: master | Michael Niedermayer | Thu Aug 21 17:28:11 2014 +0200| [a9f3bb14ba8b303cf87c42b8fe7e423571176d54] | committer: Michael Niedermayer avformat/mov: use 64bit for size in mov_skip_multiple_stsd() Fixes integer overflow Fixes Ticket 3866 Reviewed-by: Christophe Gisquet Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a9f3bb14ba8b303cf87c42b8fe7e423571176d54 --- libavformat/mov.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 1255824..b3eb287 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1635,7 +1635,7 @@ static int mov_finalize_stsd_codec(MOVContext *c, AVIOContext *pb, static int mov_skip_multiple_stsd(MOVContext *c, AVIOContext *pb, int codec_tag, int format, - int size) + int64_t size) { int video_codec_id = ff_codec_get_id(ff_codec_movvideo_tags, format); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] wavpackenc: assert on too small buffer
ffmpeg | branch: master | Christophe Gisquet | Tue Aug 19 14:05:56 2014 +0200| [4a5cc34b46a8bf8d47ec907383be83b6153b9f69] | committer: Michael Niedermayer wavpackenc: assert on too small buffer bytestream2_* will not cause buffer overflow, but in that case, this means the allocation would be incorrect and the encoded result invalid. Therefore, assert no overflow occurred. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4a5cc34b46a8bf8d47ec907383be83b6153b9f69 --- libavcodec/wavpackenc.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index 005cf7c..3631a08 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -2813,6 +2813,8 @@ static int wavpack_encode_block(WavPackEncodeContext *s, block_size = bytestream2_tell_p(&pb); AV_WL32(out + 4, block_size - 8); +av_assert0(put_bits_left(&s->pb) > 0); + return block_size; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] x86/hevc_res_add: refactor ff_hevc_transform_add{16, 32}_8
ffmpeg | branch: master | James Almer | Wed Aug 20 19:36:29 2014 -0300| [54ca4dd43bdc8658b7304d9309cdb096c8e8a394] | committer: James Almer x86/hevc_res_add: refactor ff_hevc_transform_add{16,32}_8 * Reduced xmm register count to 7 (As such they are now enabled for x86_32). * Removed four movdqa (affects the sse2 version only). * pxor is now used to clear m0 only once. ~5% faster. Reviewed-by: Christophe Gisquet Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=54ca4dd43bdc8658b7304d9309cdb096c8e8a394 --- libavcodec/x86/hevc_res_add.asm | 122 +++ libavcodec/x86/hevcdsp_init.c | 10 ++-- 2 files changed, 51 insertions(+), 81 deletions(-) diff --git a/libavcodec/x86/hevc_res_add.asm b/libavcodec/x86/hevc_res_add.asm index feea50c..7238fb3 100644 --- a/libavcodec/x86/hevc_res_add.asm +++ b/libavcodec/x86/hevc_res_add.asm @@ -88,71 +88,41 @@ cglobal hevc_transform_add4_8, 3, 4, 6 movhps [r0+r3 ], m1 %endmacro -%macro TR_ADD_INIT_SSE_8 0 -pxor m0, m0 - -mova m4, [r1] -mova m1, [r1+16] -psubw m2, m0, m1 -psubw m5, m0, m4 -packuswb m4, m1 -packuswb m5, m2 - -mova m6, [r1+32] -mova m1, [r1+48] -psubw m2, m0, m1 -psubw m7, m0, m6 -packuswb m6, m1 -packuswb m7, m2 - -mova m8, [r1+64] -mova m1, [r1+80] -psubw m2, m0, m1 -psubw m9, m0, m8 -packuswb m8, m1 -packuswb m9, m2 - -mova m10, [r1+96] -mova m1, [r1+112] -psubw m2, m0, m1 -psubwm11, m0, m10 -packuswb m10, m1 -packuswb m11, m2 -%endmacro - - -%macro TR_ADD_SSE_16_8 0 -TR_ADD_INIT_SSE_8 - -paddusb m0, m4, [r0 ] -paddusb m1, m6, [r0+r2 ] -paddusb m2, m8, [r0+r2*2] -paddusb m3, m10,[r0+r3 ] -psubusb m0, m5 -psubusb m1, m7 -psubusb m2, m9 -psubusb m3, m11 -mova [r0 ], m0 -mova [r0+r2 ], m1 -mova [r0+2*r2], m2 -mova [r0+r3 ], m3 -%endmacro - -%macro TR_ADD_SSE_32_8 0 -TR_ADD_INIT_SSE_8 - -paddusb m0, m4, [r0 ] -paddusb m1, m6, [r0+16 ] -paddusb m2, m8, [r0+r2 ] -paddusb m3, m10,[r0+r2+16] -psubusb m0, m5 -psubusb m1, m7 -psubusb m2, m9 -psubusb m3, m11 -mova [r0 ], m0 -mova [r0+16 ], m1 -mova [r0+r2 ], m2 -mova [r0+r2+16], m3 +%macro TR_ADD_SSE_16_32_8 3 +mova m2, [r1+%1 ] +mova m6, [r1+%1+16] +%if cpuflag(avx) +psubw m1, m0, m2 +psubw m5, m0, m6 +%else +mova m1, m0 +mova m5, m0 +psubw m1, m2 +psubw m5, m6 +%endif +packuswb m2, m6 +packuswb m1, m5 + +mova m4, [r1+%1+32] +mova m6, [r1+%1+48] +%if cpuflag(avx) +psubw m3, m0, m4 +psubw m5, m0, m6 +%else +mova m3, m0 +mova m5, m0 +psubw m3, m4 +psubw m5, m6 +%endif +packuswb m4, m6 +packuswb m3, m5 + +paddusb m2, [%2] +paddusb m4, [%3] +psubusb m2, m1 +psubusb m4, m3 +mova[%2], m2 +mova[%3], m4 %endmacro @@ -166,30 +136,32 @@ cglobal hevc_transform_add8_8, 3, 4, 8 TR_ADD_SSE_8_8 RET -%if ARCH_X86_64 ; void ff_hevc_transform_add16_8_(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride) -cglobal hevc_transform_add16_8, 3, 4, 12 +cglobal hevc_transform_add16_8, 3, 4, 7 +pxor m0, m0 lea r3, [r2*3] -TR_ADD_SSE_16_8 +TR_ADD_SSE_16_32_8 0, r0, r0+r2 +TR_ADD_SSE_16_32_8 64, r0+r2*2, r0+r3 %rep 3 addr1, 128 lear0, [r0+r2*4] -TR_ADD_SSE_16_8 +TR_ADD_SSE_16_32_8 0, r0, r0+r2 +TR_ADD_SSE_16_32_8 64, r0+r2*2, r0+r3 %endrep RET ; void ff_hevc_transform_add32_8_(uint8_t *dst, int16_t *coeffs, ptrdiff_t stride) -cglobal hevc_transform_add32_8, 3, 4, 12 - -TR_ADD_SSE_32_8 +cglobal hevc_transform_add32_8, 3, 4, 7 +pxor m0, m0 +TR_ADD_SSE_16_32_8 0, r0,r0+16 +TR_ADD_SSE_16_32_8 64, r0+r2, r0+r2+16 %rep 15 addr1, 128 lear0, [r0+r2*2] -TR_ADD_SSE_32_8 +TR_ADD_SSE_16_32_8 0, r0,r0+16 +TR_ADD_SSE_16_32_8 64, r0+r2, r0+r2+16 %endrep RET - -%endif ;ARCH_X86_64 %endmacro INIT_XMM sse2 diff --git a/
[FFmpeg-cvslog] vsrc_movie: Adjust a silly typo from b977b287f61fea48ecd6251d54a26334213b7ec6
ffmpeg | branch: master | Diego Biurrun | Wed Aug 20 09:56:26 2014 -0700| [11cd727fbd603197cb1e49654fce3352d56f8fd8] | committer: Diego Biurrun vsrc_movie: Adjust a silly typo from b977b287f61fea48ecd6251d54a26334213b7ec6 > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=11cd727fbd603197cb1e49654fce3352d56f8fd8 --- libavfilter/vsrc_movie.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vsrc_movie.c b/libavfilter/vsrc_movie.c index 1ee0f16..0e5df32 100644 --- a/libavfilter/vsrc_movie.c +++ b/libavfilter/vsrc_movie.c @@ -226,7 +226,7 @@ static int movie_get_frame(AVFilterLink *outlink) "movie_get_frame(): file:'%s' pts:%"PRId64" time:%f aspect:%d/%d\n", movie->file_name, movie->frame->pts, (double)movie->frame->pts * - av_q2d(movie->format_ctx->streams[movie->stream_index]), + av_q2d(movie->format_ctx->streams[movie->stream_index]->time_base), movie->frame->sample_aspect_ratio.num, movie->frame->sample_aspect_ratio.den); // We got it. Free the packet since we are returning ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '11cd727fbd603197cb1e49654fce3352d56f8fd8'
ffmpeg | branch: master | Michael Niedermayer | Thu Aug 21 21:23:14 2014 +0200| [24e81a0a8d86e764dfb89cb21e9caa4aff073e1c] | committer: Michael Niedermayer Merge commit '11cd727fbd603197cb1e49654fce3352d56f8fd8' * commit '11cd727fbd603197cb1e49654fce3352d56f8fd8': vsrc_movie: Adjust a silly typo from b977b287f61fea48ecd6251d54a26334213b7ec6 Conflicts: libavfilter/src_movie.c No change, the typo is not part of FFmpeg Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=24e81a0a8d86e764dfb89cb21e9caa4aff073e1c --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '7cb66ebc0be48489785f7166c9d15eac594b0763'
ffmpeg | branch: master | Michael Niedermayer | Thu Aug 21 21:30:31 2014 +0200| [f6ff1cb1bae5d457dccc9540288b90d44e824ee1] | committer: Michael Niedermayer Merge commit '7cb66ebc0be48489785f7166c9d15eac594b0763' * commit '7cb66ebc0be48489785f7166c9d15eac594b0763': error_resilience: Drop asserts from guess_mv() Conflicts: libavcodec/error_resilience.c Not merged, the asserts in FFmpeg build and work fine Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f6ff1cb1bae5d457dccc9540288b90d44e824ee1 --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] error_resilience: Drop asserts from guess_mv()
ffmpeg | branch: master | Diego Biurrun | Wed Aug 20 09:35:08 2014 -0700| [7cb66ebc0be48489785f7166c9d15eac594b0763] | committer: Diego Biurrun error_resilience: Drop asserts from guess_mv() The asserts check struct members that are not referenced in guess_mv() and one of them fails to compile. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7cb66ebc0be48489785f7166c9d15eac594b0763 --- libavcodec/error_resilience.c |2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index b41474a..33b0360 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -430,8 +430,6 @@ static void guess_mv(ERContext *s) if (fixed[mb_xy] == MV_FROZEN) continue; -assert(!IS_INTRA(s->cur_pic.mb_type[mb_xy])); -assert(s->last_pic && s->last_pic.f->data[0]); j = 0; if (mb_x > 0 && fixed[mb_xy - 1] == MV_FROZEN) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '8fc6a70c2167b645b7a37d0cbc0e276e7b787cc9'
ffmpeg | branch: master | Michael Niedermayer | Thu Aug 21 21:37:39 2014 +0200| [4f49c39a2fec85435fd0aabd5a402d9fa11b2fea] | committer: Michael Niedermayer Merge commit '8fc6a70c2167b645b7a37d0cbc0e276e7b787cc9' * commit '8fc6a70c2167b645b7a37d0cbc0e276e7b787cc9': mpeg12enc: Add missing #include for PICT_FRAME See: 9517900bef528527d8507da5a1992f99513d71b4 Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f49c39a2fec85435fd0aabd5a402d9fa11b2fea --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] mpeg12enc: Add missing #include for PICT_FRAME
ffmpeg | branch: master | Diego Biurrun | Wed Aug 20 09:48:54 2014 -0700| [8fc6a70c2167b645b7a37d0cbc0e276e7b787cc9] | committer: Diego Biurrun mpeg12enc: Add missing #include for PICT_FRAME > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8fc6a70c2167b645b7a37d0cbc0e276e7b787cc9 --- libavcodec/mpeg12enc.c |1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index c4089c9..3376f10 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -37,6 +37,7 @@ #include "mathops.h" #include "mpeg12.h" #include "mpeg12data.h" +#include "mpegutils.h" #include "mpegvideo.h" ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] setpts: Add missing inttypes.h #include for PRId64
ffmpeg | branch: master | Diego Biurrun | Wed Aug 20 09:54:50 2014 -0700| [593aaee953f8b07c141ff115e67bae85ef0350c7] | committer: Diego Biurrun setpts: Add missing inttypes.h #include for PRId64 Also convert a debug av_log() to av_dlog(). > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=593aaee953f8b07c141ff115e67bae85ef0350c7 --- libavfilter/setpts.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/libavfilter/setpts.c b/libavfilter/setpts.c index ff0016d..fa7a0be 100644 --- a/libavfilter/setpts.c +++ b/libavfilter/setpts.c @@ -24,6 +24,8 @@ * video presentation timestamp (PTS) modification filter */ +#include + #include "libavutil/eval.h" #include "libavutil/internal.h" #include "libavutil/mathematics.h" @@ -141,15 +143,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) d = av_expr_eval(setpts->expr, setpts->var_values, NULL); frame->pts = D2TS(d); -#ifdef DEBUG -av_log(inlink->dst, AV_LOG_DEBUG, - "n:%"PRId64" interlaced:%d pts:%"PRId64" t:%f -> pts:%"PRId64" t:%f\n", - (int64_t)setpts->var_values[VAR_N], - (int)setpts->var_values[VAR_INTERLACED], - in_pts, in_pts * av_q2d(inlink->time_base), - frame->pts, frame->pts * av_q2d(inlink->time_base)); -#endif - +av_dlog(inlink->dst, +"n:%"PRId64" interlaced:%d pts:%"PRId64" t:%f -> pts:%"PRId64" t:%f\n", +(int64_t)setpts->var_values[VAR_N], +(int)setpts->var_values[VAR_INTERLACED], +in_pts, in_pts * av_q2d(inlink->time_base), +frame->pts, frame->pts * av_q2d(inlink->time_base)); if (inlink->type == AVMEDIA_TYPE_VIDEO) { setpts->var_values[VAR_N] += 1.0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '593aaee953f8b07c141ff115e67bae85ef0350c7'
ffmpeg | branch: master | Michael Niedermayer | Thu Aug 21 21:47:43 2014 +0200| [2bfd4ff16dddc46d30b9e3510cb31e3b1b1b90fe] | committer: Michael Niedermayer Merge commit '593aaee953f8b07c141ff115e67bae85ef0350c7' * commit '593aaee953f8b07c141ff115e67bae85ef0350c7': setpts: Add missing inttypes.h #include for PRId64 Conflicts: libavfilter/setpts.c Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2bfd4ff16dddc46d30b9e3510cb31e3b1b1b90fe --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] adts: Return more meaningful error codes
ffmpeg | branch: master | Nidhi Makhijani | Fri Aug 15 17:25:24 2014 +0530| [13c90bc9a359e969cc2b7f7e8199b02a0e4c6ec9] | committer: Diego Biurrun adts: Return more meaningful error codes Signed-off-by: Diego Biurrun > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=13c90bc9a359e969cc2b7f7e8199b02a0e4c6ec9 --- libavformat/adtsenc.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c index bf7a62a..5194e75 100644 --- a/libavformat/adtsenc.c +++ b/libavformat/adtsenc.c @@ -57,23 +57,23 @@ static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t if (adts->objecttype > 3U) { av_log(s, AV_LOG_ERROR, "MPEG-4 AOT %d is not allowed in ADTS\n", adts->objecttype+1); -return -1; +return AVERROR_INVALIDDATA; } if (adts->sample_rate_index == 15) { av_log(s, AV_LOG_ERROR, "Escape sample rate index illegal in ADTS\n"); -return -1; +return AVERROR_INVALIDDATA; } if (get_bits(&gb, 1)) { av_log(s, AV_LOG_ERROR, "960/120 MDCT window is not allowed in ADTS\n"); -return -1; +return AVERROR_INVALIDDATA; } if (get_bits(&gb, 1)) { av_log(s, AV_LOG_ERROR, "Scalable configurations are not allowed in ADTS\n"); -return -1; +return AVERROR_INVALIDDATA; } if (get_bits(&gb, 1)) { av_log(s, AV_LOG_ERROR, "Extension flag is not allowed in ADTS\n"); -return -1; +return AVERROR_INVALIDDATA; } if (!adts->channel_conf) { init_put_bits(&pb, adts->pce_data, MAX_PCE_SIZE); @@ -93,9 +93,9 @@ static int adts_write_header(AVFormatContext *s) ADTSContext *adts = s->priv_data; AVCodecContext *avc = s->streams[0]->codec; -if (avc->extradata_size > 0 && -adts_decode_extradata(s, adts, avc->extradata, avc->extradata_size) < 0) -return -1; +if (avc->extradata_size > 0) +return adts_decode_extradata(s, adts, avc->extradata, + avc->extradata_size); return 0; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] Merge commit '13c90bc9a359e969cc2b7f7e8199b02a0e4c6ec9'
ffmpeg | branch: master | Michael Niedermayer | Thu Aug 21 21:56:33 2014 +0200| [fca76dc61ed650477c6e537b9db7c4ae2767197b] | committer: Michael Niedermayer Merge commit '13c90bc9a359e969cc2b7f7e8199b02a0e4c6ec9' * commit '13c90bc9a359e969cc2b7f7e8199b02a0e4c6ec9': adts: Return more meaningful error codes Conflicts: libavformat/adtsenc.c Merged-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fca76dc61ed650477c6e537b9db7c4ae2767197b --- ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] hevc_ps: check overflow and test alternate syntax
ffmpeg | branch: master | Christophe Gisquet | Thu Aug 21 18:57:18 2014 +0200| [0625a3806628f3abcc6daa87b34ceb0d165b0160] | committer: Michael Niedermayer hevc_ps: check overflow and test alternate syntax Some streams were found to have what appeared to be truncated SPS. Their syntax seem to be valid at least until the end of the VUI, so try that syntax if the parsing would overflow the SPS in the conforming syntax. Fixes ticket #3872. Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0625a3806628f3abcc6daa87b34ceb0d165b0160 --- libavcodec/hevc_ps.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c index 2ccce5f..29412d2 100644 --- a/libavcodec/hevc_ps.c +++ b/libavcodec/hevc_ps.c @@ -471,7 +471,8 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps) { VUI *vui = &sps->vui; GetBitContext *gb = &s->HEVClc->gb; -int sar_present; +GetBitContext backup; +int sar_present, alt = 1; av_log(s->avctx, AV_LOG_DEBUG, "Decoding VUI\n"); @@ -525,6 +526,10 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps) vui->frame_field_info_present_flag = get_bits1(gb); vui->default_display_window_flag = get_bits1(gb); +// Backup context in case an alternate header is detected +if( get_bits_left(gb) >= 66) +memcpy(&backup, gb, sizeof(backup)); + if (vui->default_display_window_flag) { //TODO: * 2 is only valid for 420 vui->def_disp_win.left_offset = get_ue_golomb_long(gb) * 2; @@ -552,8 +557,22 @@ static void decode_vui(HEVCContext *s, HEVCSPS *sps) vui->vui_timing_info_present_flag = get_bits1(gb); if (vui->vui_timing_info_present_flag) { +if( get_bits_left(gb) < 66) { +// The alternate syntax seem to have timing info located +// at where def_disp_win is normally located +av_log(s->avctx, AV_LOG_WARNING, + "Strange VUI timing information, retrying...\n"); +vui->default_display_window_flag = 0; +memset(&vui->def_disp_win, 0, sizeof(vui->def_disp_win)); +memcpy(gb, &backup, sizeof(backup)); +alt = 1; +} vui->vui_num_units_in_tick = get_bits_long(gb, 32); vui->vui_time_scale = get_bits_long(gb, 32); +if (alt) { +av_log(s->avctx, AV_LOG_INFO, "Retry got %i/%i fps\n", + vui->vui_time_scale, vui->vui_num_units_in_tick); +} vui->vui_poc_proportional_to_timing_flag = get_bits1(gb); if (vui->vui_poc_proportional_to_timing_flag) vui->vui_num_ticks_poc_diff_one_minus1 = get_ue_golomb_long(gb); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] dpxenc: fix padding in encode_gbrp12
ffmpeg | branch: master | Christophe Gisquet | Wed Aug 20 08:10:44 2014 +| [b3d6543caf3b67e453b7bb5120ba4b3de105f766] | committer: Michael Niedermayer dpxenc: fix padding in encode_gbrp12 It was added per pixel instead of per line. Reviewed-by: James Darnley Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b3d6543caf3b67e453b7bb5120ba4b3de105f766 --- libavcodec/dpxenc.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c index 059d8c6..aca745b 100644 --- a/libavcodec/dpxenc.c +++ b/libavcodec/dpxenc.c @@ -159,11 +159,11 @@ static void encode_gbrp12(AVCodecContext *avctx, const AVPicture *pic, uint16_t value[2] = AV_RL16(src[1] + x) << 4; value[0] = AV_RL16(src[2] + x) << 4; } -for (i = 0; i < pad; i++) -*dst++ = 0; for (i = 0; i < 3; i++) write16(dst++, value[i]); } +for (i = 0; i < pad; i++) +*dst++ = 0; for (i = 0; i < 3; i++) src[i] += pic->linesize[i]/2; } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec: fix aac/ac3 parser bitstream buffer size
ffmpeg | branch: master | Michael Niedermayer | Fri Aug 22 01:15:57 2014 +0200| [fccd85b9f30525f88692f53134eba41f1f2d90db] | committer: Michael Niedermayer avcodec: fix aac/ac3 parser bitstream buffer size Buffers containing copies of the AAC and AC3 header bits were not padded before parsing, violating init_get_bits() buffer padding requirement, leading to potential buffer read overflows. This change adds FF_INPUT_BUFFER_PADDING_SIZE bytes to the bit buffer for parsing the header in each of aac_parser.c and ac3_parser.c. Based on patch by: Matt Wolenetz Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fccd85b9f30525f88692f53134eba41f1f2d90db --- libavcodec/aac_parser.c |2 +- libavcodec/ac3_parser.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/aac_parser.c b/libavcodec/aac_parser.c index ab6ca4e..cb93ba9 100644 --- a/libavcodec/aac_parser.c +++ b/libavcodec/aac_parser.c @@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info, int size; union { uint64_t u64; -uint8_t u8[8]; +uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE]; } tmp; tmp.u64 = av_be2ne64(state); diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c index dd6d77c..131e180 100644 --- a/libavcodec/ac3_parser.c +++ b/libavcodec/ac3_parser.c @@ -166,7 +166,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info, int err; union { uint64_t u64; -uint8_t u8[8]; +uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE]; } tmp = { av_be2ne64(state) }; AC3HeaderInfo hdr, *phdr = &hdr; GetBitContext gbc; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/fic: Check if a frame is available before using it
ffmpeg | branch: master | Michael Niedermayer | Thu Aug 14 05:32:44 2014 +0200| [1b5ec6a0c3309e7a051751b2f989ffa068516d93] | committer: Michael Niedermayer avcodec/fic: Check if a frame is available before using it Fixes null pointer dereference Fixes: ficvf.avi Found-by: Piotr Bandurski Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1b5ec6a0c3309e7a051751b2f989ffa068516d93 --- libavcodec/fic.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/fic.c b/libavcodec/fic.c index d08d240..5615e69 100644 --- a/libavcodec/fic.c +++ b/libavcodec/fic.c @@ -282,8 +282,13 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data, av_log(avctx, AV_LOG_WARNING, "Invalid FIC Header.\n"); /* Is it a skip frame? */ -if (src[17]) +if (src[17]) { +if (!ctx->final_frame) { +av_log(avctx, AV_LOG_WARNING, "Initial frame is skipped\n"); +return AVERROR_INVALIDDATA; +} goto skip; +} nslices = src[13]; if (!nslices) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog