mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-13 21:26:33 +02:00
avcodec/mjpegdec: fix shift_output() with lowres
Fixes Ticket2940 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
7caaa72e62
commit
ce22820627
@ -1047,13 +1047,14 @@ static av_always_inline void mjpeg_copy_block(MJpegDecodeContext *s,
|
|||||||
static void shift_output(MJpegDecodeContext *s, uint8_t *ptr, int linesize)
|
static void shift_output(MJpegDecodeContext *s, uint8_t *ptr, int linesize)
|
||||||
{
|
{
|
||||||
int block_x, block_y;
|
int block_x, block_y;
|
||||||
|
int size = 8 >> s->avctx->lowres;
|
||||||
if (s->bits > 8) {
|
if (s->bits > 8) {
|
||||||
for (block_y=0; block_y<8; block_y++)
|
for (block_y=0; block_y<size; block_y++)
|
||||||
for (block_x=0; block_x<8; block_x++)
|
for (block_x=0; block_x<size; block_x++)
|
||||||
*(uint16_t*)(ptr + 2*block_x + block_y*linesize) <<= 16 - s->bits;
|
*(uint16_t*)(ptr + 2*block_x + block_y*linesize) <<= 16 - s->bits;
|
||||||
} else {
|
} else {
|
||||||
for (block_y=0; block_y<8; block_y++)
|
for (block_y=0; block_y<size; block_y++)
|
||||||
for (block_x=0; block_x<8; block_x++)
|
for (block_x=0; block_x<size; block_x++)
|
||||||
*(ptr + block_x + block_y*linesize) <<= 8 - s->bits;
|
*(ptr + block_x + block_y*linesize) <<= 8 - s->bits;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user