[FFmpeg-cvslog] fftools/ffmpeg: Remove the micor like "#if 1"
ffmpeg | branch: master | Jun Zhao | Fri Nov 9 14:11:24 2018 +0800| [81f2a9f136ca76579adb848dd2ff8dde3bd6393f] | committer: Jun Zhao fftools/ffmpeg: Remove the micor like "#if 1" They are come from 2003 and delete them. Signed-off-by: Jun Zhao > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=81f2a9f136ca76579adb848dd2ff8dde3bd6393f --- fftools/ffmpeg.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index da4259a9a8..9dc42f50fb 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1210,11 +1210,7 @@ static void do_video_out(OutputFile *of, in_picture->pts = ost->sync_opts; -#if 1 if (!check_recording_time(ost)) -#else -if (ost->frame_number >= ost->max_frames) -#endif return; { @@ -2315,14 +2311,12 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output, ist->samples_decoded += decoded_frame->nb_samples; ist->frames_decoded++; -#if 1 /* increment next_dts to use for the case where the input stream does not have timestamps or there are multiple frames in the packet */ ist->next_pts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) / avctx->sample_rate; ist->next_dts += ((int64_t)AV_TIME_BASE * decoded_frame->nb_samples) / avctx->sample_rate; -#endif if (decoded_frame->pts != AV_NOPTS_VALUE) { decoded_frame_tb = ist->st->time_base; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] fftools/ffmpeg: Indent the code
ffmpeg | branch: master | Jun Zhao | Fri Nov 9 20:33:51 2018 +0800| [e24a754916be0f51de9183d2c7eedbe51a185f5b] | committer: Jun Zhao fftools/ffmpeg: Indent the code Signed-off-by: Jun Zhao > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e24a754916be0f51de9183d2c7eedbe51a185f5b --- fftools/ffmpeg.c | 128 +++ 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 68b8e059a2..38c21e944a 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1193,27 +1193,27 @@ static void do_video_out(OutputFile *of, } ost->last_dropped = nb_frames == nb0_frames && next_picture; - /* duplicates frame if needed */ - for (i = 0; i < nb_frames; i++) { -AVFrame *in_picture; -int forced_keyframe = 0; -double pts_time; -av_init_packet(); -pkt.data = NULL; -pkt.size = 0; +/* duplicates frame if needed */ +for (i = 0; i < nb_frames; i++) { +AVFrame *in_picture; +int forced_keyframe = 0; +double pts_time; +av_init_packet(); +pkt.data = NULL; +pkt.size = 0; -if (i < nb0_frames && ost->last_frame) { -in_picture = ost->last_frame; -} else -in_picture = next_picture; +if (i < nb0_frames && ost->last_frame) { +in_picture = ost->last_frame; +} else +in_picture = next_picture; -if (!in_picture) -return; +if (!in_picture) +return; -in_picture->pts = ost->sync_opts; +in_picture->pts = ost->sync_opts; -if (!check_recording_time(ost)) -return; +if (!check_recording_time(ost)) +return; if (enc->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME) && ost->top_field_first >= 0) @@ -1322,17 +1322,17 @@ static void do_video_out(OutputFile *of, fprintf(ost->logfile, "%s", enc->stats_out); } } -ost->sync_opts++; -/* - * For video, number of frames in == number of packets out. - * But there may be reordering, so we can't throw away frames on encoder - * flush, we need to limit them here, before they go into encoder. - */ -ost->frame_number++; +ost->sync_opts++; +/* + * For video, number of frames in == number of packets out. + * But there may be reordering, so we can't throw away frames on encoder + * flush, we need to limit them here, before they go into encoder. + */ +ost->frame_number++; -if (vstats_filename && frame_size) -do_video_stats(ost, frame_size); - } +if (vstats_filename && frame_size) +do_video_stats(ost, frame_size); +} if (!ost->last_frame) ost->last_frame = av_frame_alloc(); @@ -1817,7 +1817,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti } else av_log(NULL, AV_LOG_INFO, "%s%c", buf.str, end); -fflush(stderr); +fflush(stderr); } av_bprint_finalize(, NULL); @@ -1924,46 +1924,46 @@ static void flush_encoders(void) av_assert0(0); } -av_init_packet(); -pkt.data = NULL; -pkt.size = 0; +av_init_packet(); +pkt.data = NULL; +pkt.size = 0; -update_benchmark(NULL); +update_benchmark(NULL); -while ((ret = avcodec_receive_packet(enc, )) == AVERROR(EAGAIN)) { -ret = avcodec_send_frame(enc, NULL); -if (ret < 0) { -av_log(NULL, AV_LOG_FATAL, "%s encoding failed: %s\n", - desc, - av_err2str(ret)); -exit_program(1); -} -} - -update_benchmark("flush_%s %d.%d", desc, ost->file_index, ost->index); -if (ret < 0 && ret != AVERROR_EOF) { +while ((ret = avcodec_receive_packet(enc, )) == AVERROR(EAGAIN)) { +ret = avcodec_send_frame(enc, NULL); +if (ret < 0) { av_log(NULL, AV_LOG_FATAL, "%s encoding failed: %s\n", desc, av_err2str(ret)); exit_program(1); } -if (ost->logfile && enc->stats_out) { -fprintf(ost->logfile, "%s", enc->stats_out); -} -if (ret == AVERROR_EOF) { -output_packet(of, , ost, 1); -break; -} -if (ost->finished & MUXER_FINISHED) { -av_packet_unref(); -continue; -} -av_packet_rescale_ts(, enc->time_base, ost->mux_timebase); -
[FFmpeg-cvslog] fftools/ffmpeg: Put the variable declaration at uppper for block.
ffmpeg | branch: master | Jun Zhao | Fri Nov 9 14:35:30 2018 +0800| [3eccf5be9287c111596c46846f899b8f92381249] | committer: Jun Zhao fftools/ffmpeg: Put the variable declaration at uppper for block. move the variable declaration at start of upper for block and remove the redundant brace. Signed-off-by: Jun Zhao > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3eccf5be9287c111596c46846f899b8f92381249 --- fftools/ffmpeg.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 9dc42f50fb..68b8e059a2 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1196,6 +1196,8 @@ static void do_video_out(OutputFile *of, /* duplicates frame if needed */ for (i = 0; i < nb_frames; i++) { AVFrame *in_picture; +int forced_keyframe = 0; +double pts_time; av_init_packet(); pkt.data = NULL; pkt.size = 0; @@ -1213,10 +1215,6 @@ static void do_video_out(OutputFile *of, if (!check_recording_time(ost)) return; -{ -int forced_keyframe = 0; -double pts_time; - if (enc->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME) && ost->top_field_first >= 0) in_picture->top_field_first = !!ost->top_field_first; @@ -1324,7 +1322,6 @@ static void do_video_out(OutputFile *of, fprintf(ost->logfile, "%s", enc->stats_out); } } -} ost->sync_opts++; /* * For video, number of frames in == number of packets out. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] h264_redundant_pps: Fix logging context
ffmpeg | branch: master | Andreas Rheinhardt | Fri Nov 9 06:31:38 2018 +0100| [6dafcb6fdb6271d35220b889833561705c2b366f] | committer: Michael Niedermayer h264_redundant_pps: Fix logging context The first element of H264RedundantPPSContext is not a pointer to an AVClass as required. Signed-off-by: Andreas Rheinhardt Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6dafcb6fdb6271d35220b889833561705c2b366f --- libavcodec/h264_redundant_pps_bsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h264_redundant_pps_bsf.c b/libavcodec/h264_redundant_pps_bsf.c index cc5a3060f5..af247eef21 100644 --- a/libavcodec/h264_redundant_pps_bsf.c +++ b/libavcodec/h264_redundant_pps_bsf.c @@ -91,7 +91,7 @@ static int h264_redundant_pps_filter(AVBSFContext *bsf, AVPacket *out) if (nal->type == H264_NAL_PPS) { h264_redundant_pps_fixup_pps(ctx, nal->content); if (!au_has_sps) { -av_log(ctx, AV_LOG_VERBOSE, "Deleting redundant PPS " +av_log(bsf, AV_LOG_VERBOSE, "Deleting redundant PPS " "at %"PRId64".\n", in->pts); ff_cbs_delete_unit(ctx->input, au, i); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/imm4: Use ff_set_dimensions()
ffmpeg | branch: master | Michael Niedermayer | Fri Nov 9 23:07:23 2018 +0100| [c305e134ce23b46a1164527ade3e1b7e2ecedf5f] | committer: Michael Niedermayer avcodec/imm4: Use ff_set_dimensions() Fixes: Out of memory Fixes: 10970/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IMM4_fuzzer-5698750043914240 Reviewed-by: Paul B Mahol Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c305e134ce23b46a1164527ade3e1b7e2ecedf5f --- libavcodec/imm4.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/imm4.c b/libavcodec/imm4.c index a4e9b5d4d2..b72f0be28e 100644 --- a/libavcodec/imm4.c +++ b/libavcodec/imm4.c @@ -428,8 +428,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, av_log(avctx, AV_LOG_ERROR, "Frame size change is unsupported.\n"); return AVERROR_INVALIDDATA; } -avctx->width = width; -avctx->height = height; +ret = ff_set_dimensions(avctx, width, height); +if (ret < 0) +return ret; } s->changed_size = 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_lut3d: add cosine 1D interpolation
ffmpeg | branch: master | Paul B Mahol | Sat Nov 10 21:44:35 2018 +0100| [0bc2326b90a7447b040c74f210a4d0ddb7d458d5] | committer: Paul B Mahol avfilter/vf_lut3d: add cosine 1D interpolation > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0bc2326b90a7447b040c74f210a4d0ddb7d458d5 --- libavfilter/vf_lut3d.c | 24 1 file changed, 24 insertions(+) diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c index f328b30a8f..86a33ca4f3 100644 --- a/libavfilter/vf_lut3d.c +++ b/libavfilter/vf_lut3d.c @@ -985,6 +985,7 @@ enum interp_1d_mode { INTERPOLATE_1D_NEAREST, INTERPOLATE_1D_LINEAR, INTERPOLATE_1D_CUBIC, +INTERPOLATE_1D_COSINE, NB_INTERP_1D_MODE }; @@ -1074,6 +1075,7 @@ static const AVOption lut1d_options[] = { { "interp", "select interpolation mode", OFFSET(interpolation), AV_OPT_TYPE_INT, {.i64=INTERPOLATE_1D_LINEAR}, 0, NB_INTERP_1D_MODE-1, FLAGS, "interp_mode" }, { "nearest", "use values from the nearest defined points", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_1D_NEAREST}, INT_MIN, INT_MAX, FLAGS, "interp_mode" }, { "linear", "use values from the linear interpolation", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_1D_LINEAR},INT_MIN, INT_MAX, FLAGS, "interp_mode" }, +{ "cosine", "use values from the cosine interpolation", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_1D_COSINE},INT_MIN, INT_MAX, FLAGS, "interp_mode" }, { "cubic", "use values from the cubic interpolation",0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_1D_CUBIC}, INT_MIN, INT_MAX, FLAGS, "interp_mode" }, { NULL } }; @@ -1100,6 +1102,19 @@ static inline float interp_1d_linear(const LUT1DContext *lut1d, return lerpf(p, n, d); } +static inline float interp_1d_cosine(const LUT1DContext *lut1d, + int idx, const float s) +{ +const int prev = PREV(s); +const int next = NEXT1D(s); +const float d = s - prev; +const float p = lut1d->lut[idx][prev]; +const float n = lut1d->lut[idx][next]; +const float m = (1.f - cosf(d * M_PI)) * .5f; + +return lerpf(p, n, m); +} + static inline float interp_1d_cubic(const LUT1DContext *lut1d, int idx, const float s) { @@ -1183,26 +1198,32 @@ static int interp_1d_##nbits##_##name##_p##depth(AVFilterContext *ctx, \ DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 8, 8) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 8, 8) +DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 8, 8) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 8, 8) DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 16, 9) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 16, 9) +DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 16, 9) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 16, 9) DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 16, 10) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 16, 10) +DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 16, 10) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 16, 10) DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 16, 12) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 16, 12) +DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 16, 12) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 16, 12) DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 16, 14) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 16, 14) +DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 16, 14) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 16, 14) DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 16, 16) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 16, 16) +DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 16, 16) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 16, 16) #define DEFINE_INTERP_FUNC_1D(name, nbits) \ @@ -1251,10 +1272,12 @@ static int interp_1d_##nbits##_##name(AVFilterContext *ctx, void *arg, \ DEFINE_INTERP_FUNC_1D(nearest, 8) DEFINE_INTERP_FUNC_1D(linear, 8) +DEFINE_INTERP_FUNC_1D(cosine, 8) DEFINE_INTERP_FUNC_1D(cubic, 8) DEFINE_INTERP_FUNC_1D(nearest, 16) DEFINE_INTERP_FUNC_1D(linear, 16) +DEFINE_INTERP_FUNC_1D(cosine, 16) DEFINE_INTERP_FUNC_1D(cubic, 16) static int config_input_1d(AVFilterLink *inlink) @@ -1307,6 +1330,7 @@ static int config_input_1d(AVFilterLink *inlink) switch (lut1d->interpolation) { case INTERPOLATE_1D_NEAREST: SET_FUNC_1D(nearest); break; case INTERPOLATE_1D_LINEAR: SET_FUNC_1D(linear); break; +case INTERPOLATE_1D_COSINE: SET_FUNC_1D(cosine); break; case INTERPOLATE_1D_CUBIC: SET_FUNC_1D(cubic);break; default: av_assert0(0); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/vf_lut3d: add spline 1D interpolation
ffmpeg | branch: master | Paul B Mahol | Sat Nov 10 22:06:13 2018 +0100| [c47b48c0a629d65cd15e1d3869fbfbb9ee2ceafc] | committer: Paul B Mahol avfilter/vf_lut3d: add spline 1D interpolation > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c47b48c0a629d65cd15e1d3869fbfbb9ee2ceafc --- doc/filters.texi | 4 libavfilter/vf_lut3d.c | 32 2 files changed, 36 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index d16a8b8b1b..fb1dd8f353 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -11442,8 +11442,12 @@ Available values are: Use values from the nearest defined point. @item linear Interpolate values using the linear interpolation. +@item cosine +Interpolate values using the cosine interpolation. @item cubic Interpolate values using the cubic interpolation. +@item spline +Interpolate values using the spline interpolation. @end table @end table diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c index 86a33ca4f3..1beaf5ac4e 100644 --- a/libavfilter/vf_lut3d.c +++ b/libavfilter/vf_lut3d.c @@ -986,6 +986,7 @@ enum interp_1d_mode { INTERPOLATE_1D_LINEAR, INTERPOLATE_1D_CUBIC, INTERPOLATE_1D_COSINE, +INTERPOLATE_1D_SPLINE, NB_INTERP_1D_MODE }; @@ -1077,6 +1078,7 @@ static const AVOption lut1d_options[] = { { "linear", "use values from the linear interpolation", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_1D_LINEAR},INT_MIN, INT_MAX, FLAGS, "interp_mode" }, { "cosine", "use values from the cosine interpolation", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_1D_COSINE},INT_MIN, INT_MAX, FLAGS, "interp_mode" }, { "cubic", "use values from the cubic interpolation",0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_1D_CUBIC}, INT_MIN, INT_MAX, FLAGS, "interp_mode" }, +{ "spline", "use values from the spline interpolation", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_1D_SPLINE},INT_MIN, INT_MAX, FLAGS, "interp_mode" }, { NULL } }; @@ -1138,6 +1140,27 @@ static inline float interp_1d_cubic(const LUT1DContext *lut1d, return a0 * mu * mu2 + a1 * mu2 + a2 * mu + a3; } +static inline float interp_1d_spline(const LUT1DContext *lut1d, + int idx, const float s) +{ +const int prev = PREV(s); +const int next = NEXT1D(s); +const float x = s - prev; +float c0, c1, c2, c3; + +float y0 = lut1d->lut[idx][FFMAX(prev - 1, 0)]; +float y1 = lut1d->lut[idx][prev]; +float y2 = lut1d->lut[idx][next]; +float y3 = lut1d->lut[idx][FFMIN(next + 1, lut1d->lutsize - 1)]; + +c0 = y1; +c1 = .5f * (y2 - y0); +c2 = y0 - 2.5f * y1 + 2.f * y2 - .5f * y3; +c3 = .5f * (y3 - y0) + 1.5f * (y1 - y2); + +return ((c3 * x + c2) * x + c1) * x + c0; +} + #define DEFINE_INTERP_FUNC_PLANAR_1D(name, nbits, depth) \ static int interp_1d_##nbits##_##name##_p##depth(AVFilterContext *ctx, \ void *arg, int jobnr, \ @@ -1200,31 +1223,37 @@ DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 8, 8) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 8, 8) DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 8, 8) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 8, 8) +DEFINE_INTERP_FUNC_PLANAR_1D(spline, 8, 8) DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 16, 9) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 16, 9) DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 16, 9) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 16, 9) +DEFINE_INTERP_FUNC_PLANAR_1D(spline, 16, 9) DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 16, 10) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 16, 10) DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 16, 10) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 16, 10) +DEFINE_INTERP_FUNC_PLANAR_1D(spline, 16, 10) DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 16, 12) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 16, 12) DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 16, 12) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 16, 12) +DEFINE_INTERP_FUNC_PLANAR_1D(spline, 16, 12) DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 16, 14) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 16, 14) DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 16, 14) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 16, 14) +DEFINE_INTERP_FUNC_PLANAR_1D(spline, 16, 14) DEFINE_INTERP_FUNC_PLANAR_1D(nearest, 16, 16) DEFINE_INTERP_FUNC_PLANAR_1D(linear, 16, 16) DEFINE_INTERP_FUNC_PLANAR_1D(cosine, 16, 16) DEFINE_INTERP_FUNC_PLANAR_1D(cubic, 16, 16) +DEFINE_INTERP_FUNC_PLANAR_1D(spline, 16, 16) #define DEFINE_INTERP_FUNC_1D(name, nbits) \ static int interp_1d_##nbits##_##name(AVFilterContext *ctx, void *arg, \ @@ -1274,11 +1303,13 @@ DEFINE_INTERP_FUNC_1D(nearest, 8) DEFINE_INTERP_FUNC_1D(linear, 8) DEFINE_INTERP_FUNC_1D(cosine, 8) DEFINE_INTERP_FUNC_1D(cubic, 8) +DEFINE_INTERP_FUNC_1D(spline, 8)
[FFmpeg-cvslog] avcodec/hevcdec: fix non-ref frame judgement
ffmpeg | branch: release/4.0 | Mark Wu | Tue Oct 23 12:49:08 2018 +0800| [263b3ad407496a539b57f4fe118c051f7fb5a5f0] | committer: James Almer avcodec/hevcdec: fix non-ref frame judgement After inspecting the source code of x265, mpv and ffmpeg, I've found that ffmpeg mistakenly regards EVC_NAL_BLA_N_LP and HEVC_NAL_IDR_N_LP as non- reference frames, which are acutally reference frames according to the specification in x265, and drops them. This patch should address the problem. I have tested it with mpv. Signed-off-by: Mark Wu Signed-off-by: James Almer (cherry picked from commit 10bc4c3a7df7bb26303067b97311b7eeedfd453e) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=263b3ad407496a539b57f4fe118c051f7fb5a5f0 --- libavcodec/hevcdec.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h index f0f588f2b8..dd951aae06 100644 --- a/libavcodec/hevcdec.h +++ b/libavcodec/hevcdec.h @@ -559,8 +559,6 @@ static av_always_inline int ff_hevc_nal_is_nonref(enum HEVCNALUnitType type) case HEVC_NAL_VCL_N10: case HEVC_NAL_VCL_N12: case HEVC_NAL_VCL_N14: -case HEVC_NAL_BLA_N_LP: -case HEVC_NAL_IDR_N_LP: return 1; break; default: break; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/hevcdec: fix non-ref frame judgement
ffmpeg | branch: release/4.1 | Mark Wu | Tue Oct 23 12:49:08 2018 +0800| [11dff170ef79d26d1de2bcd13b603a6c4c5c9815] | committer: James Almer avcodec/hevcdec: fix non-ref frame judgement After inspecting the source code of x265, mpv and ffmpeg, I've found that ffmpeg mistakenly regards EVC_NAL_BLA_N_LP and HEVC_NAL_IDR_N_LP as non- reference frames, which are acutally reference frames according to the specification in x265, and drops them. This patch should address the problem. I have tested it with mpv. Signed-off-by: Mark Wu Signed-off-by: James Almer (cherry picked from commit 10bc4c3a7df7bb26303067b97311b7eeedfd453e) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=11dff170ef79d26d1de2bcd13b603a6c4c5c9815 --- libavcodec/hevcdec.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h index f0f588f2b8..dd951aae06 100644 --- a/libavcodec/hevcdec.h +++ b/libavcodec/hevcdec.h @@ -559,8 +559,6 @@ static av_always_inline int ff_hevc_nal_is_nonref(enum HEVCNALUnitType type) case HEVC_NAL_VCL_N10: case HEVC_NAL_VCL_N12: case HEVC_NAL_VCL_N14: -case HEVC_NAL_BLA_N_LP: -case HEVC_NAL_IDR_N_LP: return 1; break; default: break; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/hevcdec: fix non-ref frame judgement
ffmpeg | branch: master | Mark Wu | Tue Oct 23 12:49:08 2018 +0800| [10bc4c3a7df7bb26303067b97311b7eeedfd453e] | committer: James Almer avcodec/hevcdec: fix non-ref frame judgement After inspecting the source code of x265, mpv and ffmpeg, I've found that ffmpeg mistakenly regards EVC_NAL_BLA_N_LP and HEVC_NAL_IDR_N_LP as non- reference frames, which are acutally reference frames according to the specification in x265, and drops them. This patch should address the problem. I have tested it with mpv. Signed-off-by: Mark Wu Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=10bc4c3a7df7bb26303067b97311b7eeedfd453e --- libavcodec/hevcdec.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h index f0f588f2b8..dd951aae06 100644 --- a/libavcodec/hevcdec.h +++ b/libavcodec/hevcdec.h @@ -559,8 +559,6 @@ static av_always_inline int ff_hevc_nal_is_nonref(enum HEVCNALUnitType type) case HEVC_NAL_VCL_N10: case HEVC_NAL_VCL_N12: case HEVC_NAL_VCL_N14: -case HEVC_NAL_BLA_N_LP: -case HEVC_NAL_IDR_N_LP: return 1; break; default: break; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/wmaprodec: improve XMA missing samples
ffmpeg | branch: master | bnnm | Sat Oct 27 01:49:50 2018 +0200| [27e114b4511b771ccf2c64ab9f4a3d0391ace4ea] | committer: Paul B Mahol avcodec/wmaprodec: improve XMA missing samples Writes missing (delay) samples after EOF. Signed-off-by: bnnm > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=27e114b4511b771ccf2c64ab9f4a3d0391ace4ea --- libavcodec/wmaprodec.c | 35 --- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 9439bfa771..d0fa974c80 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -210,6 +210,7 @@ typedef struct WMAProDecodeCtx { int subframe_offset; ///< subframe offset in the bit reservoir uint8_t packet_loss; ///< set in case of bitstream error uint8_t packet_done; ///< set when a packet is fully decoded +uint8_t eof_done; ///< set when EOF reached and extra subframe is written (XMA1/2) /* frame decode state */ uint32_t frame_num; ///< current frame number (not used for decoding) @@ -1609,7 +1610,34 @@ static int decode_packet(AVCodecContext *avctx, WMAProDecodeCtx *s, *got_frame_ptr = 0; -if (s->packet_done || s->packet_loss) { +if (!buf_size) { +AVFrame *frame = data; +int i; + +/** Must output remaining samples after stream end. WMAPRO 5.1 created + * by XWMA encoder don't though (maybe only 1/2ch streams need it). */ +s->packet_done = 0; +if (s->eof_done) +return 0; + +/** clean output buffer and copy last IMDCT samples */ +for (i = 0; i < s->nb_channels; i++) { +memset(frame->extended_data[i], 0, +s->samples_per_frame * sizeof(*s->channel[i].out)); + +memcpy(frame->extended_data[i], s->channel[i].out, + s->samples_per_frame * sizeof(*s->channel[i].out) >> 1); +} + +/* TODO: XMA should output 128 samples only (instead of 512) and WMAPRO + * maybe 768 (with 2048), XMA needs changes in multi-stream handling though. */ + +s->eof_done = 1; +s->packet_done = 1; +*got_frame_ptr = 1; +return 0; +} +else if (s->packet_done || s->packet_loss) { s->packet_done = 0; /** sanity check for the buffer length */ @@ -1922,6 +1950,7 @@ static void flush(WMAProDecodeCtx *s) sizeof(*s->channel[i].out)); s->packet_loss = 1; s->skip_packets = 0; +s->eof_done = 0; } @@ -1976,7 +2005,7 @@ AVCodec ff_xma1_decoder = { .init = xma_decode_init, .close = xma_decode_end, .decode = xma_decode_packet, -.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, +.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, }; @@ -1991,7 +2020,7 @@ AVCodec ff_xma2_decoder = { .close = xma_decode_end, .decode = xma_decode_packet, .flush = xma_flush, -.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1, +.capabilities = AV_CODEC_CAP_SUBFRAMES | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, .sample_fmts= (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog