aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-26 15:24:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-27 17:28:41 +0200
commit8f53d32dfbe2c727238f366ff649ce8debc17a6b (patch)
treea9535156854b5733da39a664f21a7dd068036bf7
parentfcc6568a10252a69c83e6ce6b166574306631861 (diff)
downloadffmpeg-8f53d32dfbe2c727238f366ff649ce8debc17a6b.tar.gz
avfilter/vf_spp: use AVDCT
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit e3fac208246f5f94cfc4d3abdb1a4770272f96ee) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/vf_spp.c13
-rw-r--r--libavfilter/vf_spp.h6
2 files changed, 9 insertions, 10 deletions
diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c
index 4e4a5795f4..aff1ddf305 100644
--- a/libavfilter/vf_spp.c
+++ b/libavfilter/vf_spp.c
@@ -233,9 +233,9 @@ static void filter(SPPContext *p, uint8_t *dst, uint8_t *src,
const int y1 = y + offset[i + count - 1][1];
const int index = x1 + y1*linesize;
p->pdsp.get_pixels(block, p->src + index, linesize);
- p->fdsp.fdct(block);
- p->requantize(block2, block, qp, p->idsp.idct_permutation);
- p->idsp.idct(block2);
+ p->dct->fdct(block);
+ p->requantize(block2, block, qp, p->dct->idct_permutation);
+ p->dct->idct(block2);
add_block(p->temp + index, linesize, block2);
}
}
@@ -378,11 +378,11 @@ static av_cold int init(AVFilterContext *ctx)
SPPContext *spp = ctx->priv;
spp->avctx = avcodec_alloc_context3(NULL);
- if (!spp->avctx)
+ spp->dct = avcodec_dct_alloc();
+ if (!spp->avctx || !spp->dct)
return AVERROR(ENOMEM);
- ff_idctdsp_init(&spp->idsp, spp->avctx);
- ff_fdctdsp_init(&spp->fdsp, spp->avctx);
ff_pixblockdsp_init(&spp->pdsp, spp->avctx);
+ avcodec_dct_init(spp->dct);
spp->store_slice = store_slice_c;
switch (spp->mode) {
case MODE_HARD: spp->requantize = hardthresh_c; break;
@@ -403,6 +403,7 @@ static av_cold void uninit(AVFilterContext *ctx)
avcodec_close(spp->avctx);
av_freep(&spp->avctx);
}
+ av_freep(&spp->dct);
av_freep(&spp->non_b_qp_table);
}
diff --git a/libavfilter/vf_spp.h b/libavfilter/vf_spp.h
index c8eac3caf2..2dcf813ed3 100644
--- a/libavfilter/vf_spp.h
+++ b/libavfilter/vf_spp.h
@@ -24,8 +24,7 @@
#include "libavcodec/avcodec.h"
#include "libavcodec/pixblockdsp.h"
-#include "libavcodec/idctdsp.h"
-#include "libavcodec/fdctdsp.h"
+#include "libavcodec/avdct.h"
#include "avfilter.h"
#define MAX_LEVEL 6 /* quality levels */
@@ -41,9 +40,8 @@ typedef struct {
uint8_t *src;
int16_t *temp;
AVCodecContext *avctx;
- IDCTDSPContext idsp;
- FDCTDSPContext fdsp;
PixblockDSPContext pdsp;
+ AVDCT *dct;
int8_t *non_b_qp_table;
int non_b_qp_alloc_size;
int use_bframe_qp;