dsputil: Split clear_block*/fill_block* off into a separate context
This commit is contained in:
@@ -24,9 +24,9 @@
|
||||
#include "libavutil/imgutils.h"
|
||||
#include "libavutil/internal.h"
|
||||
#include "avcodec.h"
|
||||
#include "dsputil.h"
|
||||
#include "binkdata.h"
|
||||
#include "binkdsp.h"
|
||||
#include "blockdsp.h"
|
||||
#include "hpeldsp.h"
|
||||
#include "internal.h"
|
||||
#include "mathops.h"
|
||||
@@ -113,7 +113,7 @@ typedef struct Bundle {
|
||||
*/
|
||||
typedef struct BinkContext {
|
||||
AVCodecContext *avctx;
|
||||
DSPContext dsp;
|
||||
BlockDSPContext bdsp;
|
||||
HpelDSPContext hdsp;
|
||||
BinkDSPContext binkdsp;
|
||||
AVFrame *last;
|
||||
@@ -880,7 +880,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
||||
} else {
|
||||
put_pixels8x8_overlapped(dst, ref, stride);
|
||||
}
|
||||
c->dsp.clear_block(block);
|
||||
c->bdsp.clear_block(block);
|
||||
v = binkb_get_value(c, BINKB_SRC_INTER_COEFS);
|
||||
read_residue(gb, block, v);
|
||||
c->binkdsp.add_pixels8(dst, block, stride);
|
||||
@@ -904,7 +904,7 @@ static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
||||
break;
|
||||
case 5:
|
||||
v = binkb_get_value(c, BINKB_SRC_COLORS);
|
||||
c->dsp.fill_block_tab[1](dst, v, stride, 8);
|
||||
c->bdsp.fill_block_tab[1](dst, v, stride, 8);
|
||||
break;
|
||||
case 6:
|
||||
for (i = 0; i < 2; i++)
|
||||
@@ -1047,7 +1047,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
||||
break;
|
||||
case FILL_BLOCK:
|
||||
v = get_value(c, BINK_SRC_COLORS);
|
||||
c->dsp.fill_block_tab[0](dst, v, stride, 16);
|
||||
c->bdsp.fill_block_tab[0](dst, v, stride, 16);
|
||||
break;
|
||||
case PATTERN_BLOCK:
|
||||
for (i = 0; i < 2; i++)
|
||||
@@ -1117,7 +1117,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
c->hdsp.put_pixels_tab[1][0](dst, ref, stride, 8);
|
||||
c->dsp.clear_block(block);
|
||||
c->bdsp.clear_block(block);
|
||||
v = get_bits(gb, 7);
|
||||
read_residue(gb, block, v);
|
||||
c->binkdsp.add_pixels8(dst, block, stride);
|
||||
@@ -1130,7 +1130,7 @@ static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb,
|
||||
break;
|
||||
case FILL_BLOCK:
|
||||
v = get_value(c, BINK_SRC_COLORS);
|
||||
c->dsp.fill_block_tab[1](dst, v, stride, 8);
|
||||
c->bdsp.fill_block_tab[1](dst, v, stride, 8);
|
||||
break;
|
||||
case INTER_BLOCK:
|
||||
xoff = get_value(c, BINK_SRC_X_OFF);
|
||||
@@ -1310,7 +1310,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
|
||||
avctx->pix_fmt = c->has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
|
||||
|
||||
ff_dsputil_init(&c->dsp, avctx);
|
||||
ff_blockdsp_init(&c->bdsp, avctx);
|
||||
ff_hpeldsp_init(&c->hdsp, avctx->flags);
|
||||
ff_binkdsp_init(&c->binkdsp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user