From 5ac1dd8e231987c022a860c6b1961b038a84b613 Mon Sep 17 00:00:00 2001 From: James Almer Date: Sat, 7 Jan 2017 19:04:39 -0300 Subject: lossless_videodsp: move shared functions from huffyuvdsp Several codecs other than huffyuv use them. Signed-off-by: James Almer --- libavcodec/magicyuv.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'libavcodec/magicyuv.c') diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index 526df6f72f..4e78ff1e21 100644 --- a/libavcodec/magicyuv.c +++ b/libavcodec/magicyuv.c @@ -70,7 +70,6 @@ typedef struct MagicYUVContext { int (*huff_build)(VLC *vlc, uint8_t *len); int (*magy_decode_slice)(AVCodecContext *avctx, void *tdata, int j, int threadnr); - HuffYUVDSPContext hdsp; LLVidDSPContext llviddsp; } MagicYUVContext; @@ -353,24 +352,24 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, switch (pred) { case LEFT: dst = p->data[i] + j * sheight * stride; - s->hdsp.add_hfyu_left_pred(dst, dst, width, 0); + s->llviddsp.add_left_pred(dst, dst, width, 0); dst += stride; if (interlaced) { - s->hdsp.add_hfyu_left_pred(dst, dst, width, 0); + s->llviddsp.add_left_pred(dst, dst, width, 0); dst += stride; } for (k = 1 + interlaced; k < height; k++) { - s->hdsp.add_hfyu_left_pred(dst, dst, width, dst[-fake_stride]); + s->llviddsp.add_left_pred(dst, dst, width, dst[-fake_stride]); dst += stride; } break; case GRADIENT: dst = p->data[i] + j * sheight * stride; - s->hdsp.add_hfyu_left_pred(dst, dst, width, 0); + s->llviddsp.add_left_pred(dst, dst, width, 0); left = lefttop = 0; dst += stride; if (interlaced) { - s->hdsp.add_hfyu_left_pred(dst, dst, width, 0); + s->llviddsp.add_left_pred(dst, dst, width, 0); left = lefttop = 0; dst += stride; } @@ -390,15 +389,15 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, case MEDIAN: dst = p->data[i] + j * sheight * stride; lefttop = left = dst[0]; - s->hdsp.add_hfyu_left_pred(dst, dst, width, 0); + s->llviddsp.add_left_pred(dst, dst, width, 0); dst += stride; if (interlaced) { lefttop = left = dst[0]; - s->hdsp.add_hfyu_left_pred(dst, dst, width, 0); + s->llviddsp.add_left_pred(dst, dst, width, 0); dst += stride; } for (k = 1 + interlaced; k < height; k++) { - s->hdsp.add_hfyu_median_pred(dst, dst - fake_stride, + s->llviddsp.add_median_pred(dst, dst - fake_stride, dst, width, &left, &lefttop); lefttop = left = dst[0]; dst += stride; @@ -417,8 +416,8 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata, uint8_t *r = p->data[2] + j * s->slice_height * p->linesize[2]; for (i = 0; i < height; i++) { - s->hdsp.add_bytes(b, g, width); - s->hdsp.add_bytes(r, g, width); + s->llviddsp.add_bytes(b, g, width); + s->llviddsp.add_bytes(r, g, width); b += p->linesize[0]; g += p->linesize[1]; r += p->linesize[2]; @@ -698,7 +697,6 @@ static int magy_init_thread_copy(AVCodecContext *avctx) static av_cold int magy_decode_init(AVCodecContext *avctx) { MagicYUVContext *s = avctx->priv_data; - ff_huffyuvdsp_init(&s->hdsp); ff_llviddsp_init(&s->llviddsp, avctx); return 0; } -- cgit v1.2.1