summaryrefslogtreecommitdiff
path: root/libavcodec/proresenc_kostya.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-28 17:54:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-28 18:02:00 +0100
commit2e88f82a8a50b21a3273785ac1349fd94c1a8aa0 (patch)
tree2b67d8e5bb10e18729dddfcd1a25b5ea13e17490 /libavcodec/proresenc_kostya.c
parent18d870da83b172c89495b6543001b2ecdf4ae1e2 (diff)
parent92e598a57a7ce4b8ac9ea56274af39f5fd888311 (diff)
downloadffmpeg-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/proresenc_kostya.c')
-rw-r--r--libavcodec/proresenc_kostya.c35
1 files changed, 24 insertions, 11 deletions
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;