#include "libavutil/avassert.h"
#include "libavutil/opt.h"
+
#include "internal.h"
+#include "qp_table.h"
#include "libpostproc/postprocess.h"
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) {
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,
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);
}
{ 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),