#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
+#include "libavutil/mem_internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "internal.h"
+#include "qp_table.h"
#include "vf_pp7.h"
enum mode {
AVFrame *out = in;
int qp_stride = 0;
- uint8_t *qp_table = NULL;
+ int8_t *qp_table = NULL;
- if (!pp7->qp)
- qp_table = av_frame_get_qp_table(in, &qp_stride, &pp7->qscale_type);
+ if (!pp7->qp) {
+ int ret = ff_qp_table_extract(in, &qp_table, &qp_stride, NULL, &pp7->qscale_type);
+ if (ret < 0) {
+ av_frame_free(&in);
+ return ret;
+ }
+ }
if (!ctx->is_disabled) {
const int cw = AV_CEIL_RSHIFT(inlink->w, pp7->hsub);
out = ff_get_video_buffer(outlink, aligned_w, aligned_h);
if (!out) {
av_frame_free(&in);
+ av_freep(&qp_table);
return AVERROR(ENOMEM);
}
av_frame_copy_props(out, in);
inlink->w, inlink->h);
av_frame_free(&in);
}
+ av_freep(&qp_table);
return ff_filter_frame(outlink, out);
}
{ NULL }
};
-AVFilter ff_vf_pp7 = {
+const AVFilter ff_vf_pp7 = {
.name = "pp7",
.description = NULL_IF_CONFIG_SMALL("Apply Postprocessing 7 filter."),
.priv_size = sizeof(PP7Context),