X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_pp.c;h=5cd89932f8d4211a4c2e9d49122b050b7ee20a51;hb=a04ad248a05e7b613abe09b3bb067f555108d794;hp=524ef1bb0a81adf905c158f7f8d98d1cfcecf982;hpb=2ac399d7faa5ac80088715780769522d1141b549;p=ffmpeg diff --git a/libavfilter/vf_pp.c b/libavfilter/vf_pp.c index 524ef1bb0a8..5cd89932f8d 100644 --- a/libavfilter/vf_pp.c +++ b/libavfilter/vf_pp.c @@ -26,7 +26,9 @@ #include "libavutil/avassert.h" #include "libavutil/opt.h" + #include "internal.h" +#include "qp_table.h" #include "libpostproc/postprocess.h" @@ -126,8 +128,9 @@ static int pp_filter_frame(AVFilterLink *inlink, AVFrame *inbuf) const int aligned_w = FFALIGN(outlink->w, 8); const int aligned_h = FFALIGN(outlink->h, 8); AVFrame *outbuf; - int qstride, qp_type; - int8_t *qp_table ; + int qstride = 0; + int8_t *qp_table = NULL; + int ret; outbuf = ff_get_video_buffer(outlink, aligned_w, aligned_h); if (!outbuf) { @@ -137,7 +140,13 @@ static int pp_filter_frame(AVFilterLink *inlink, AVFrame *inbuf) av_frame_copy_props(outbuf, inbuf); outbuf->width = inbuf->width; outbuf->height = inbuf->height; - qp_table = av_frame_get_qp_table(inbuf, &qstride, &qp_type); + + ret = ff_qp_table_extract(inbuf, &qp_table, &qstride, NULL, NULL); + if (ret < 0) { + av_frame_free(&inbuf); + av_frame_free(&outbuf); + return ret; + } pp_postprocess((const uint8_t **)inbuf->data, inbuf->linesize, outbuf->data, outbuf->linesize, @@ -146,9 +155,10 @@ static int pp_filter_frame(AVFilterLink *inlink, AVFrame *inbuf) qstride, pp->modes[pp->mode_id], pp->pp_ctx, - outbuf->pict_type | (qp_type ? PP_PICT_TYPE_QP2 : 0)); + outbuf->pict_type | (qp_table ? PP_PICT_TYPE_QP2 : 0)); av_frame_free(&inbuf); + av_freep(&qp_table); return ff_filter_frame(outlink, outbuf); } @@ -181,7 +191,7 @@ static const AVFilterPad pp_outputs[] = { { NULL } }; -AVFilter ff_vf_pp = { +const AVFilter ff_vf_pp = { .name = "pp", .description = NULL_IF_CONFIG_SMALL("Filter video using libpostproc."), .priv_size = sizeof(PPFilterContext),