None of the encoder bits are arch-optimized.
---
libavcodec/Makefile | 2 +-
libavcodec/proresdsp.c | 25 +------------------------
libavcodec/proresdsp.h | 2 --
libavcodec/proresenc.c | 39 +++++++++++++++++++++++++++------------
4 files changed, 29 insertions(+), 39 deletions(-)
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index f975f16..fcb36ee 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -291,7 +291,7 @@ OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o
OBJS-$(CONFIG_PRORES_DECODER) += proresdec.o proresdata.o proresdsp.o
-OBJS-$(CONFIG_PRORES_ENCODER) += proresenc.o proresdata.o proresdsp.o
+OBJS-$(CONFIG_PRORES_ENCODER) += proresenc.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 05d312c..1d60897 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_AND_BIAS(x) (av_clip((x) + BIAS, CLIP_MIN, CLIP_MAX))
-#if CONFIG_PRORES_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_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)
{
-#if CONFIG_PRORES_DECODER
dsp->idct_put = prores_idct_put_c;
dsp->idct_permutation_type = FF_NO_IDCT_PERM;
@@ -83,9 +65,4 @@ av_cold void ff_proresdsp_init(ProresDSPContext *dsp)
ff_init_scantable_permutation(dsp->idct_permutation,
dsp->idct_permutation_type);
-#endif
-#if CONFIG_PRORES_ENCODER
- dsp->fdct = prores_fdct_c;
- ff_init_scantable_permutation(dsp->dct_permutation, FF_NO_IDCT_PERM);
-#endif
}
diff --git a/libavcodec/proresdsp.h b/libavcodec/proresdsp.h
index 732d30a..e8a3ea9 100644
--- a/libavcodec/proresdsp.h
+++ b/libavcodec/proresdsp.h
@@ -30,9 +30,7 @@
typedef struct ProresDSPContext {
int idct_permutation_type;
uint8_t idct_permutation[64];
- uint8_t dct_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);
diff --git a/libavcodec/proresenc.c b/libavcodec/proresenc.c
index 7e9ce54..9672399 100644
--- a/libavcodec/proresenc.c
+++ b/libavcodec/proresenc.c
@@ -23,11 +23,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
@@ -191,7 +191,8 @@ typedef struct ProresContext {
int16_t custom_q[64];
const uint8_t *quant_mat;
- ProresDSPContext dsp;
+ uint8_t dct_permutation[64];
+ void (* fdct) (const uint16_t *src, int linesize, int16_t *block);
ScanTable scantable;
int mb_width, mb_height;
@@ -261,27 +262,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;
}
}
@@ -1066,6 +1067,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;
@@ -1079,8 +1093,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
- ff_proresdsp_init(&ctx->dsp);
- ff_init_scantable(ctx->dsp.dct_permutation, &ctx->scantable,
+ ctx->fdct = prores_fdct;
+ ff_init_scantable_permutation(ctx->dct_permutation, FF_NO_IDCT_PERM);
+ ff_init_scantable(ctx->dct_permutation, &ctx->scantable,
interlaced ? ff_prores_interlaced_scan
: ff_prores_progressive_scan);
--
1.8.3.2
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel