1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Michael Niedermayer 2014-02-28 17:54:32 +01:00
commit 2e88f82a8a
4 changed files with 26 additions and 36 deletions

View File

@ -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 \

View File

@ -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
}

View File

@ -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);

View File

@ -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;