#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "internal.h"
-#include "libavcodec/avcodec.h" //for reference to FF_QSCALE_TYPE
#include "vf_fspp.h"
#define OFFSET(x) offsetof(FSPPContext, x)
20, 27, 26, 23, 20, 15, 11, 5
};
-static inline int norm_qscale(int qscale, int type)
-{
- switch (type) {
- case FF_QSCALE_TYPE_MPEG1: return qscale;
- case FF_QSCALE_TYPE_MPEG2: return qscale >> 1;
- case FF_QSCALE_TYPE_H264: return qscale >> 2;
- case FF_QSCALE_TYPE_VP56: return (63 - qscale + 2) >> 2;
- }
- return qscale;
-}
-
//This func reads from 1 slice, 1 and clears 0 & 1
static void store_slice_c(uint8_t *dst, int16_t *src,
ptrdiff_t dst_stride, ptrdiff_t src_stride,
if (t < 0) t = 0; //t always < width-2
t = qp_store[qy + (t >> qpsh)];
- t = norm_qscale(t, p->qscale_type);
+ t = ff_norm_qscale(t, p->qscale_type);
if (t != p->prev_q) p->prev_q = t, p->mul_thrmat((int16_t *)(&p->threshold_mtx_noq[0]), (int16_t *)(&p->threshold_mtx[0]), t);
p->column_fidct((int16_t *)(&p->threshold_mtx[0]), block + x * 8, block3 + x * 8, 8); //yes, this is a HOTSPOT
p->row_fdct(block + 8 * 8, p->src + y * stride + 8 + x0 + 2 - (y & 1), stride, (es - 4) >> 2);
p->column_fidct((int16_t *)(&p->threshold_mtx[0]), block, block3, es&(~1));
- p->row_idct(block3 + 0 * 8, p->temp + (y & 15) * stride + x0 + 2 - (y & 1), stride, es >> 2);
+ if (es > 3)
+ p->row_idct(block3 + 0 * 8, p->temp + (y & 15) * stride + x0 + 2 - (y & 1), stride, es >> 2);
if (!(y1 & 7) && y1) {
if (y1 & 8)
return AVERROR(ENOMEM);
}
av_frame_copy_props(out, in);
+ out->width = in->width;
+ out->height = in->height;
}
filter(fspp, out->data[0], in->data[0], out->linesize[0], in->linesize[0],