diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-28 17:54:32 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-28 18:02:00 +0100 |
commit | 2e88f82a8a50b21a3273785ac1349fd94c1a8aa0 (patch) | |
tree | 2b67d8e5bb10e18729dddfcd1a25b5ea13e17490 /libavcodec | |
parent | 18d870da83b172c89495b6543001b2ecdf4ae1e2 (diff) | |
parent | 92e598a57a7ce4b8ac9ea56274af39f5fd888311 (diff) | |
download | ffmpeg-2e88f82a8a50b21a3273785ac1349fd94c1a8aa0.tar.gz |
Merge commit '92e598a57a7ce4b8ac9ea56274af39f5fd888311'
* commit '92e598a57a7ce4b8ac9ea56274af39f5fd888311':
prores: Drop DSP infrastructure for prores encoder bits
Conflicts:
libavcodec/Makefile
libavcodec/proresdsp.c
libavcodec/proresenc_kostya.c
Note, these changes only affect one of the 2 prores encoders we have
If someone wants to add optimizations to the affected encoder, or needs/wants
this infrastructure, then iam happy to revert this
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/Makefile | 2 | ||||
-rw-r--r-- | libavcodec/proresdsp.c | 24 | ||||
-rw-r--r-- | libavcodec/proresdsp.h | 1 | ||||
-rw-r--r-- | libavcodec/proresenc_kostya.c | 35 |
4 files changed, 26 insertions, 36 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile index f5bb49ef7e..6ff8a1caa1 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -350,7 +350,7 @@ OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o proresdsp.o proresdata.o OBJS-$(CONFIG_PRORES_LGPL_DECODER) += proresdec_lgpl.o proresdsp.o proresdata.o OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o OBJS-$(CONFIG_PRORES_AW_ENCODER) += proresenc_anatoliy.o -OBJS-$(CONFIG_PRORES_KS_ENCODER) += proresenc_kostya.o proresdata.o proresdsp.o +OBJS-$(CONFIG_PRORES_KS_ENCODER) += proresenc_kostya.o proresdata.o OBJS-$(CONFIG_PTX_DECODER) += ptx.o OBJS-$(CONFIG_QCELP_DECODER) += qcelpdec.o \ celp_filters.o acelp_vectors.o \ diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c index f6246331fb..b523064950 100644 --- a/libavcodec/proresdsp.c +++ b/libavcodec/proresdsp.c @@ -20,9 +20,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "config.h" #include "libavutil/attributes.h" #include "libavutil/common.h" -#include "dct.h" #include "dsputil.h" #include "proresdsp.h" #include "simple_idct.h" @@ -33,7 +33,6 @@ #define CLIP(x) (av_clip((x), CLIP_MIN, CLIP_MAX)) -#if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER /** * Add bias value, clamp and output pixels of a slice */ @@ -55,26 +54,9 @@ static void prores_idct_put_c(uint16_t *out, int linesize, int16_t *block, const ff_prores_idct(block, qmat); put_pixels(out, linesize >> 1, block); } -#endif - -#if CONFIG_PRORES_KS_ENCODER -static void prores_fdct_c(const uint16_t *src, int linesize, int16_t *block) -{ - int x, y; - const uint16_t *tsrc = src; - - for (y = 0; y < 8; y++) { - for (x = 0; x < 8; x++) - block[y * 8 + x] = tsrc[x]; - tsrc += linesize >> 1; - } - ff_jpeg_fdct_islow_10(block); -} -#endif av_cold void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) { -#if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER dsp->idct_put = prores_idct_put_c; dsp->idct_permutation_type = FF_NO_IDCT_PERM; @@ -83,8 +65,4 @@ av_cold void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx) ff_init_scantable_permutation(dsp->idct_permutation, dsp->idct_permutation_type); -#endif -#if CONFIG_PRORES_KS_ENCODER - dsp->fdct = prores_fdct_c; -#endif } diff --git a/libavcodec/proresdsp.h b/libavcodec/proresdsp.h index 2b23f35ad1..07871cfbd8 100644 --- a/libavcodec/proresdsp.h +++ b/libavcodec/proresdsp.h @@ -32,7 +32,6 @@ typedef struct ProresDSPContext { int idct_permutation_type; uint8_t idct_permutation[64]; void (* idct_put) (uint16_t *out, int linesize, int16_t *block, const int16_t *qmat); - void (* fdct) (const uint16_t *src, int linesize, int16_t *block); } ProresDSPContext; void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx); diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index aaeec0ebfb..6688a5b417 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -26,11 +26,11 @@ #include "libavutil/opt.h" #include "libavutil/pixdesc.h" #include "avcodec.h" +#include "dct.h" #include "dsputil.h" #include "put_bits.h" #include "bytestream.h" #include "internal.h" -#include "proresdsp.h" #include "proresdata.h" #define CFACTOR_Y422 2 @@ -195,7 +195,7 @@ typedef struct ProresContext { const uint8_t *quant_mat; const uint8_t *scantable; - ProresDSPContext dsp; + void (* fdct) (const uint16_t *src, int linesize, int16_t *block); int mb_width, mb_height; int mbs_per_slice; @@ -264,27 +264,27 @@ static void get_slice_data(ProresContext *ctx, const uint16_t *src, mb_width * sizeof(*emu_buf)); } if (!is_chroma) { - ctx->dsp.fdct(esrc, elinesize, blocks); + ctx->fdct(esrc, elinesize, blocks); blocks += 64; if (blocks_per_mb > 2) { - ctx->dsp.fdct(esrc + 8, elinesize, blocks); + ctx->fdct(esrc + 8, elinesize, blocks); blocks += 64; } - ctx->dsp.fdct(esrc + elinesize * 4, elinesize, blocks); + ctx->fdct(esrc + elinesize * 4, elinesize, blocks); blocks += 64; if (blocks_per_mb > 2) { - ctx->dsp.fdct(esrc + elinesize * 4 + 8, elinesize, blocks); + ctx->fdct(esrc + elinesize * 4 + 8, elinesize, blocks); blocks += 64; } } else { - ctx->dsp.fdct(esrc, elinesize, blocks); + ctx->fdct(esrc, elinesize, blocks); blocks += 64; - ctx->dsp.fdct(esrc + elinesize * 4, elinesize, blocks); + ctx->fdct(esrc + elinesize * 4, elinesize, blocks); blocks += 64; if (blocks_per_mb > 2) { - ctx->dsp.fdct(esrc + 8, elinesize, blocks); + ctx->fdct(esrc + 8, elinesize, blocks); blocks += 64; - ctx->dsp.fdct(esrc + elinesize * 4 + 8, elinesize, blocks); + ctx->fdct(esrc + elinesize * 4 + 8, elinesize, blocks); blocks += 64; } } @@ -1064,6 +1064,19 @@ static av_cold int encode_close(AVCodecContext *avctx) return 0; } +static void prores_fdct(const uint16_t *src, int linesize, int16_t *block) +{ + int x, y; + const uint16_t *tsrc = src; + + for (y = 0; y < 8; y++) { + for (x = 0; x < 8; x++) + block[y * 8 + x] = tsrc[x]; + tsrc += linesize >> 1; + } + ff_jpeg_fdct_islow_10(block); +} + static av_cold int encode_init(AVCodecContext *avctx) { ProresContext *ctx = avctx->priv_data; @@ -1077,7 +1090,7 @@ static av_cold int encode_init(AVCodecContext *avctx) if (!avctx->coded_frame) return AVERROR(ENOMEM); - ff_proresdsp_init(&ctx->dsp, avctx); + ctx->fdct = prores_fdct; ctx->scantable = interlaced ? ff_prores_interlaced_scan : ff_prores_progressive_scan; |