summaryrefslogtreecommitdiff
path: root/libavcodec/pngenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-28 00:03:59 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-28 00:03:59 +0200
commit48a691630833d6b12905475b6bf39fef285872a9 (patch)
treeaaeb0c4d73c6c0c72606aae3c4a1de62b17dc6e7 /libavcodec/pngenc.c
parente2abc0d5cacc22aa900de8ac26160ea1b786a7b5 (diff)
parent512f3ffe9b4bb86767c2b1176554407c75fe1a5c (diff)
Merge commit '512f3ffe9b4bb86767c2b1176554407c75fe1a5c'
* commit '512f3ffe9b4bb86767c2b1176554407c75fe1a5c': dsputil: Split off HuffYUV encoding bits into their own context Conflicts: configure libavcodec/dsputil.c libavcodec/dsputil.h libavcodec/huffyuv.h libavcodec/huffyuvenc.c libavcodec/pngenc.c libavcodec/x86/dsputilenc_mmx.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pngenc.c')
-rw-r--r--libavcodec/pngenc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index 8d9eaa37dc..0d2c291a8a 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -22,7 +22,7 @@
#include "avcodec.h"
#include "internal.h"
#include "bytestream.h"
-#include "dsputil.h"
+#include "huffyuvencdsp.h"
#include "png.h"
#include "libavutil/avassert.h"
@@ -34,7 +34,7 @@
typedef struct PNGEncContext {
AVClass *class;
- DSPContext dsp;
+ HuffYUVEncDSPContext hdsp;
uint8_t *bytestream;
uint8_t *bytestream_start;
@@ -115,7 +115,7 @@ static void sub_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top,
}
}
-static void sub_left_prediction(DSPContext *dsp, uint8_t *dst, const uint8_t *src, int bpp, int size)
+static void sub_left_prediction(PNGEncContext *c, uint8_t *dst, const uint8_t *src, int bpp, int size)
{
const uint8_t *src1 = src + bpp;
const uint8_t *src2 = src;
@@ -128,10 +128,10 @@ static void sub_left_prediction(DSPContext *dsp, uint8_t *dst, const uint8_t *sr
for (x = 0; x < unaligned_w; x++)
*dst++ = *src1++ - *src2++;
size -= unaligned_w;
- dsp->diff_bytes(dst, src1, src2, size);
+ c->hdsp.diff_bytes(dst, src1, src2, size);
}
-static void png_filter_row(DSPContext *dsp, uint8_t *dst, int filter_type,
+static void png_filter_row(PNGEncContext *c, uint8_t *dst, int filter_type,
uint8_t *src, uint8_t *top, int size, int bpp)
{
int i;
@@ -141,10 +141,10 @@ static void png_filter_row(DSPContext *dsp, uint8_t *dst, int filter_type,
memcpy(dst, src, size);
break;
case PNG_FILTER_VALUE_SUB:
- sub_left_prediction(dsp, dst, src, bpp, size);
+ sub_left_prediction(c, dst, src, bpp, size);
break;
case PNG_FILTER_VALUE_UP:
- dsp->diff_bytes(dst, src, top, size);
+ c->hdsp.diff_bytes(dst, src, top, size);
break;
case PNG_FILTER_VALUE_AVG:
for (i = 0; i < bpp; i++)
@@ -172,7 +172,7 @@ static uint8_t *png_choose_filter(PNGEncContext *s, uint8_t *dst,
int cost, bcost = INT_MAX;
uint8_t *buf1 = dst, *buf2 = dst + size + 16;
for (pred = 0; pred < 5; pred++) {
- png_filter_row(&s->dsp, buf1 + 1, pred, src, top, size, bpp);
+ png_filter_row(s, buf1 + 1, pred, src, top, size, bpp);
buf1[0] = pred;
cost = 0;
for (i = 0; i <= size; i++)
@@ -184,7 +184,7 @@ static uint8_t *png_choose_filter(PNGEncContext *s, uint8_t *dst,
}
return buf2;
} else {
- png_filter_row(&s->dsp, dst + 1, pred, src, top, size, bpp);
+ png_filter_row(s, dst + 1, pred, src, top, size, bpp);
dst[0] = pred;
return dst;
}
@@ -479,7 +479,7 @@ static av_cold int png_enc_init(AVCodecContext *avctx)
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
- ff_dsputil_init(&s->dsp, avctx);
+ ff_huffyuvencdsp_init(&s->hdsp);
s->filter_type = av_clip(avctx->prediction_method,
PNG_FILTER_VALUE_NONE,