diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2015-01-13 13:00:18 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2015-01-13 13:12:58 +0100 |
commit | 57ede2a5070f42fde19175ef666b63b101bcd983 (patch) | |
tree | 524aa534214830f3b4e918e59eb9dad6c164f2f6 /libavfilter/vf_spp.c | |
parent | b23a8668448d99b4c59daad3d485f17e182f43a3 (diff) | |
download | ffmpeg-57ede2a5070f42fde19175ef666b63b101bcd983.tar.gz |
lavfi: use ff_norm_qscale(), factorize
Diffstat (limited to 'libavfilter/vf_spp.c')
-rw-r--r-- | libavfilter/vf_spp.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c index bdc76ae957..4235544b9d 100644 --- a/libavfilter/vf_spp.c +++ b/libavfilter/vf_spp.c @@ -229,18 +229,6 @@ static inline void add_block(uint16_t *dst, int linesize, const int16_t block[64 } } -// XXX: export the function? -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; -} - static void filter(SPPContext *p, uint8_t *dst, uint8_t *src, int dst_linesize, int src_linesize, int width, int height, const uint8_t *qp_table, int qp_stride, int is_luma, int depth) @@ -284,7 +272,7 @@ static void filter(SPPContext *p, uint8_t *dst, uint8_t *src, } else{ const int qps = 3 + is_luma; qp = qp_table[(FFMIN(x, width - 1) >> qps) + (FFMIN(y, height - 1) >> qps) * qp_stride]; - qp = FFMAX(1, norm_qscale(qp, p->qscale_type)); + qp = FFMAX(1, ff_norm_qscale(qp, p->qscale_type)); } for (i = 0; i < count; i++) { const int x1 = x + offset[i + count - 1][0]; |