mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/ffv1dec: Fix copying planes of paletted formats
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
8b1f66cf5c
commit
3a4d387195
@ -898,7 +898,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
|||||||
const uint8_t *src[4];
|
const uint8_t *src[4];
|
||||||
uint8_t *dst[4];
|
uint8_t *dst[4];
|
||||||
ff_thread_await_progress(&f->last_picture, INT_MAX, 0);
|
ff_thread_await_progress(&f->last_picture, INT_MAX, 0);
|
||||||
for (j = 0; j < 4; j++) {
|
for (j = 0; j < desc->nb_components; j++) {
|
||||||
int pixshift = desc->comp[j].depth > 8;
|
int pixshift = desc->comp[j].depth > 8;
|
||||||
int sh = (j == 1 || j == 2) ? f->chroma_h_shift : 0;
|
int sh = (j == 1 || j == 2) ? f->chroma_h_shift : 0;
|
||||||
int sv = (j == 1 || j == 2) ? f->chroma_v_shift : 0;
|
int sv = (j == 1 || j == 2) ? f->chroma_v_shift : 0;
|
||||||
@ -906,6 +906,12 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
|
|||||||
(fs->slice_y >> sv) + ((fs->slice_x >> sh) << pixshift);
|
(fs->slice_y >> sv) + ((fs->slice_x >> sh) << pixshift);
|
||||||
src[j] = f->last_picture.f->data[j] + f->last_picture.f->linesize[j] *
|
src[j] = f->last_picture.f->data[j] + f->last_picture.f->linesize[j] *
|
||||||
(fs->slice_y >> sv) + ((fs->slice_x >> sh) << pixshift);
|
(fs->slice_y >> sv) + ((fs->slice_x >> sh) << pixshift);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (desc->flags & AV_PIX_FMT_FLAG_PAL ||
|
||||||
|
desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) {
|
||||||
|
dst[1] = p->data[1];
|
||||||
|
src[1] = f->last_picture.f->data[1];
|
||||||
}
|
}
|
||||||
av_image_copy(dst, p->linesize, src,
|
av_image_copy(dst, p->linesize, src,
|
||||||
f->last_picture.f->linesize,
|
f->last_picture.f->linesize,
|
||||||
|
Loading…
Reference in New Issue
Block a user