Merge commit 'b9ee5f2cab3ffe1c962e542346b1ed61394864ec'

* commit 'b9ee5f2cab3ffe1c962e542346b1ed61394864ec':
  indeo3: replace use of copy_block4 with put_pixels
  mjpegdec: use put_pixels instead of copy_block8

Conflicts:
	libavcodec/mjpegdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-02-09 12:19:21 +01:00
commit e5212354ea
2 changed files with 14 additions and 9 deletions

View File

@ -410,7 +410,8 @@ if (*data_ptr >= last_ptr) \
}
static int decode_cell_data(Cell *cell, uint8_t *block, uint8_t *ref_block,
static int decode_cell_data(Indeo3DecodeContext *ctx, Cell *cell,
uint8_t *block, uint8_t *ref_block,
int pitch, int h_zoom, int v_zoom, int mode,
const vqEntry *delta[2], int swap_quads[2],
const uint8_t **data_ptr, const uint8_t *last_ptr)
@ -656,14 +657,16 @@ static int decode_cell(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
}
zoom_fac = mode >= 3;
error = decode_cell_data(cell, block, ref_block, plane->pitch, 0, zoom_fac,
mode, delta, swap_quads, &data_ptr, last_ptr);
error = decode_cell_data(ctx, cell, block, ref_block, plane->pitch,
0, zoom_fac, mode, delta, swap_quads,
&data_ptr, last_ptr);
break;
case 10: /*-------------------- MODE 10 (8x8 block processing) ---------------------*/
case 11: /*----------------- MODE 11 (4x8 INTER block processing) ------------------*/
if (mode == 10 && !cell->mv_ptr) { /* MODE 10 INTRA processing */
error = decode_cell_data(cell, block, ref_block, plane->pitch, 1, 1,
mode, delta, swap_quads, &data_ptr, last_ptr);
error = decode_cell_data(ctx, cell, block, ref_block, plane->pitch,
1, 1, mode, delta, swap_quads,
&data_ptr, last_ptr);
} else { /* mode 10 and 11 INTER processing */
if (mode == 11 && !cell->mv_ptr) {
av_log(avctx, AV_LOG_ERROR, "Attempt to use Mode 11 for an INTRA cell!\n");
@ -671,7 +674,7 @@ static int decode_cell(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
}
zoom_fac = mode == 10;
error = decode_cell_data(cell, block, ref_block, plane->pitch,
error = decode_cell_data(ctx, cell, block, ref_block, plane->pitch,
zoom_fac, 1, mode, delta, swap_quads,
&data_ptr, last_ptr);
}

View File

@ -987,11 +987,12 @@ static int ljpeg_decode_yuv_scan(MJpegDecodeContext *s, int predictor,
return 0;
}
static av_always_inline void mjpeg_copy_block(uint8_t *dst, const uint8_t *src,
static av_always_inline void mjpeg_copy_block(MJpegDecodeContext *s,
uint8_t *dst, const uint8_t *src,
int linesize, int lowres)
{
switch (lowres) {
case 0: copy_block8(dst, src, linesize, linesize, 8);
case 0: s->dsp.put_pixels_tab[1][0](dst, src, linesize, 8);
break;
case 1: copy_block4(dst, src, linesize, linesize, 4);
break;
@ -1067,8 +1068,9 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
ptr = data[c] + block_offset;
if (!s->progressive) {
if (copy_mb)
mjpeg_copy_block(ptr, reference_data[c] + block_offset,
mjpeg_copy_block(s, ptr, reference_data[c] + block_offset,
linesize[c], s->avctx->lowres);
else {
s->dsp.clear_block(s->block);
if (decode_block(s, s->block, i,